AlgoViz

Design an inventory management system

medium 80 min

Count goods in several places, promise them to orders without ever promising too much, ship or let go, and explain every count.

Watch lesson4:28

Remember it

The few things worth knowing cold, and how to make them stick.

Memory hook

A tag on the jar: on the shelf, and not for sale.

Max's jam cellar. Jars on the shelf are on hand, paper tags are holds, the sand timer is the end of a promise, and the book is the ledger.

Cheat sheet

Stored
on hand, held
Worked out
available = on hand - held
Receive
on hand up, movement
Reserve
held up, no movement
Ship
both down, movement, available same
Release, expire
held down
Reserve phases
plan (reads), hold (writes)
Promise ends
shipped, released, expired
Database
conditional UPDATE, row count

Spot it when you see

  • A limited thing is promised now and used later.
  • "Cancel" and "timeout" appear in the task.
  • Somebody asks why a number is what it is.

Tricks that stick

  • TAGS: Two counts, All or nothing, Give back by picks, Sum of the ledger.
  • Ship never changes available.
  • Read the clock on touch, sweep for tidiness.

Do not forget

  • isInStock before decrement.
  • A stored available.
  • Holds in the ledger.
  • Listeners under the lock.
  • Giving back without picks.
  • A transfer in one step.