Section 12: The Box Office Closes - Final Summary & Candidate Scorecard
Executive Summary: We replay the interview as the signal each phase recorded, then give a 100-point scorecard with the answers that cost points here: the Redis lock, the locked section, "just autoscale", charging before holding. Jordan's morning becomes a cold trace to run aloud, score bands map totals to readiness, and a short catalog shows where the question hides under other names.
The prompt looked like CRUD, and for an average day of 6.3 orders a second a CRUD drawing is roughly right. The interviewer was scoring whether you found the two problems inside it: many fans grabbing the same seat at the same instant, and 3,000,000 people arriving for 60,000 seats. Nearly every point comes from how you handled those two.
The Arc, Replayed as Signal
| Section | What you did | Signal the interviewer recorded |
|---|---|---|
| 1. Problem Understanding & Clarifications | Asked about seating type, hold length, payment, limits; named bots as users | Found the contention and the flash crowd before drawing a box |
| 2. Requirements (Functional & Non-Functional) | Seat sold at most once; all-or-nothing holds; hold p99 ≤ 500 ms; served map ≤ 2 s behind the database | Invariants a test could check |
| 3. Scale Estimation & Workload Analysis | 33,000 joins/s; 150× over a 20,000 req/s design load; 67 admissions/s; sell-out in about 6 min | The problem is contention and admission |
| 4. API Design (with Pushback) | Hold as a resource; 409 with alternatives; idempotent checkout | A lost race becomes a sale; a retry never becomes a second charge |
| 5. Data Modeling | Row per seat per show; GA counters; unique (show_id, seat_id) | The invariant lives in the schema |
| 6. High-Level Architecture | 7.5 KB bitmap from the change stream; inventory partitioned by show | Reads kept off the inventory |
| 7. Deep Dive: Seat Holds & Contention | Conditional updates in sorted seat order, lazy expiry, row-count check, the 4-ticket limit inside the hold | Correctness in one statement |
| 8. Deep Dive: The On-Sale & the Virtual Waiting Room | Edge-issued signed tokens, a sealed random draw, watermark with feedback | Admission control, fairness designed in |
| 9. Interviewer Deep-Dive Challenges | Bots, slow PSP, hoarding, double click, stale map | A mechanism and a number per escalation |
| 10. Reliability, Fairness & Abuse | Failover with admission paused; rotating barcodes | Failure planned for mid-on-sale |
| 11. Follow-up Feature Evolution | Resale, lotteries, price-locking holds, flights | New features extend the model |
Key Insight: Two mechanisms do most of the work. The hold turns "sold at most once" into a property of one statement. The waiting room turns 3,000,000 arrivals into 20,000 active shoppers. Almost every other choice protects one of them (idempotency, the unique constraint, bot defences) or keeps load off them (the bitmap, 100,000 edge polls/s).
Quick check before moving on:
Sign in to continue reading
The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.
Sign in to read the full lesson