AlgoViz

Ask the question that changes the build

easy 12 min

Use one concrete counterexample to settle an ambiguous business rule before implementation.

Theory

Read or listen first. About 1 min.

What it is

A library promises to keep a returned book on the pickup shelf for two days. One developer starts the clock when the book reaches the shelf. Another starts it when a member receives an email. Both can show a passing demo.

Why it exists

Ask what happens when the member’s notification is delayed. A book shelved Monday at 09:00 with a notice delivered Tuesday at 09:00 has two different deadlines. Put both on a timeline, ask the policy owner which one applies, then decide which event must be stored. Receipt time would require a delivery signal the system may never receive.

One book, two credible outcomes

EventShelf clockNotice clock
Monday 09:00 · shelvedClock startsWaiting
Tuesday 09:00 · notified24 hours left48 hours left
Wednesday 10:00 · pickupExpiredEligible

Understand it

Work through the decision

Reserve from shelving when the library controls that timestamp and can afford a shorter window after notification delays.

Start at notification when the promise is two days of notice. Define what counts as delivery and how to handle missing receipts.

Give the agent a check

  • Give it the Monday timeline, the agreed start event, and the expected result exactly at expiry. Ask for the first failing check.

The shortcut

  • Ask the assistant to implement a two-day hold immediately.

What a reviewer can hear

SignalExample
WeakAsk the assistant to implement a two-day hold immediately.
CompetentUse the delayed-email example. The answer changes the source timestamp and the storage requirements.
StrongChoose a pickup that is expired using shelf time and still eligible under notice time. A noon pickup on the first day separates neither policy.

Summary

The whole topic in one minute.

Move the clock until the two answers disagree.

Sources