Scope
Functional
- Normal store: catalog, search, cart, checkout, orders.
- Flash sale: limited stock at a set time; max 1 unit per user; reserved units must be paid within 10 minutes or released.
Non-functional
- Zero oversell. Fair (roughly first-come), bot-resistant.
- The sale must not degrade the rest of the site.
- Peak: 5M users, ~1M requests/s in the first seconds.
Size
- 1M requests/s for a few seconds, then tailing off; only 10k can succeed.
- The ratio is the insight: 99% of requests will fail. Make failure cheap and early.
The everyday store
- Catalog: denormalised product documents, heavily cached, served via CDN for anonymous pages.
- Cart: key-value by
user_id(Redis/DynamoDB). Prices re-validated at checkout. - Inventory: reservation at checkout, decrement at payment, release on timeout (same pattern as seat holds in Case Study C11 of the book).
The flash-sale path
The 30-second summary
Say it in the interview
"The normal store is a cached catalog, KV carts and transactional checkout with inventory reservations. The flash sale gets its own funnel: an edge waiting room with bot checks admits users at a controlled rate; a stateless sale service runs an atomic Lua script that decrements stock and enforces one per user; winners are queued for durable order creation; and a sold-out flag at the edge rejects everyone else for free. It runs on isolated capacity so the store keeps working."
Follow-up questions the interviewer may ask
- How do you stop bots from buying everything?
- Why not just decrement stock in the database?
- What if Redis loses the counter?
- How do you make the sale fair across regions?
Model answers to each of these are in the book.