System design interview guide
Design Ticketmaster
You open the seat map for a stadium show that has 500 seats while about 2 million people are trying to buy. You expect to hold one seat and pay before anyone else takes it. The painful failure is the sale frozen for 30 minutes, because every request locked the single counter of seats left.

Problem statement
Ticketing: high-concurrency inventory, holds, fair flash-sale access.
Introduction
Stadium show. Five hundred seats. About two million people hit Request at once. You expect to hold one seat, pay, and walk out with a ticket. The painful failure is not “sold out.” It is the sale frozen for thirty minutes because every request locked one global seats-left counter.
Interviewers want that story: flash sales are an admission problem first and an inventory problem second. If everyone reaches the seat map together, your database design does not matter.
This guide walks one purchase from waiting room to paid ticket. You will queue buyers before checkout, hold a seat with a TTL, make the seat assignment atomic so two people cannot win the same seat, and say what happens when payment never finishes.
How to approach
Do not open with Kafka topics. Open with the sale path.
- Scope the purchase loop. Browse event → enter waiting room for a hot sale → get admitted → pick seats → hold with TTL → pay → ticket issued. Resale and dynamic pricing stay thin unless asked.
- Name the hard constraints out loud. Never oversell. Fair admission under spike. Abandoned holds return. Adjacent seats as one bundle when required.
- Separate admission from inventory. The waiting room protects the seat map. Inventory owns who holds which seat.
- Deep-dive one fight. Usually atomic hold / conditional seat update, or waiting-room admission. Leave bots as a short edge filter.
- Close with failure. Payment timeout, double-click checkout, section hot shard, map stale after hold.
In the room: “I will optimize for no oversell and fair admission first. I will accept eventual consistency on the seat-map preview, and strong consistency on who owns each seat.”
Capacity estimation
Use the numbers as a story about where the system hurts—not as memorization.
| Signal | Rough estimate | What it implies |
|---|---|---|
| People at sale open | ~2M concurrent intent | Edge + waiting room must absorb the herd |
| Seats for a hot event | ~5K–50K | Inventory is small vs browsers; contention is per seat |
| Browse : buy | ~100 : 1 | Most traffic is read; buy path must be gated |
| Hold window | ~5–15 min | Release jobs and hold store matter as much as checkout |
| Peak buy attempts | tens of thousands / s at open | Without a queue, the seat DB melts |
Implications:
- Do not let 2M browsers open write transactions on seats.
- Shard inventory by event and section, never one global counter.
- Holds need a durable record and a reliable expiry path.
- Seat-map reads can be cached; seat ownership cannot.
Design decisions
| Decision | Choice | Why | Cost |
|---|---|---|---|
| Flash-sale entry | Virtual waiting room / token queue | Bounds who can hit inventory | UX wait; fairness tuning |
| Seat ownership | Conditional update per seat_id (or seat group) | One winner; no oversell | Hot seats still contend |
| Hold | Soft reserve with TTL | Stops abandoned carts from locking the map | Need release worker + clear UX |
| Seat-map reads | Cache / CDN with short TTL + invalidate on hold | Survives browse storm | Map can lag a few seconds |
| Adjacent seats | Bundle reserve in one transaction | Prevents split pairs | Harder under contention |
| Payment | Charge against hold id (idempotent) | Same retry ≠ second ticket | Hold must outlive payment attempt |
High-level architecture
[ Buyer app ] -- browse / queue / hold / pay --> [ API / Gateway ]
|
+------------------+------------------+------------------+
| | | |
[ Waiting room ] [ Seat map read ] [ Inventory / Hold ] [ Payments ]
admit tokens cached layout conditional seat charge vs hold
rate batches CDN / edge TTL + release job idempotency key
| | | |
[ Queue / tokens ] [ Event catalog ] [ Seat DB (by section) ] [ Payment PSP ]
|
[ Ticket / confirmation ]
(async email, wallet pass)
Who owns what. Waiting room owns admission. Inventory owns holds and sold state. Payments owns charge idempotency. Seat-map read is a cached projection, not the source of truth for ownership.
In the interview: narrate one buyer left-to-right, then say the 2M spike dies in the waiting room, not on the seat row.
Detailed design
Write path — hold and pay
- Admitted buyer requests hold for
seat_ids(or a section+row bundle). - Inventory runs a conditional update: seats still
available→ setheld,hold_id,expires_at, buyer id. - If any seat fails, roll the bundle back; return “no longer available.”
- Buyer pays with
hold_id+ idempotency key. On success, seats gosoldand a ticket record is created. - On payment failure or hold expiry, seats return to
available.
Write path — hold expiry
- A release worker (or DB TTL + sweeper) finds holds past
expires_atstill inheld. - Conditional update: still
heldfor thathold_id→available. - In-flight payment that arrives late must see hold gone and fail safely—not invent a seat.
Read path — seat map
- Serve layout + availability snapshot from cache keyed by
event_id(and section). - On hold/sale, invalidate or patch the affected seats.
- Client may show a seat that another buyer just held; checkout is the authority.
Deep dive: no oversell under flash sale
The interview fight is almost always “how do two buyers not get the same seat?”
- Per-seat conditional update (compare-and-set on status) is the core answer. One transaction wins; the other retries or picks another seat.
- Never decrement a single
seats_leftinteger for the whole stadium as the only lock—that is the thirty-minute freeze story. - Shard by event + section so one hot lower bowl does not serialize the upper deck.
- For adjacent seats, reserve the group in one transaction (or two-phase: soft-hold all, then commit) so A12 cannot leave A13 orphaned mid-checkout.
- Waiting room admission rate should match inventory write capacity, not marketing hype.
Key challenges
- Thundering herd if the waiting room is skipped or tokens are too generous.
- Hold abandonment without a reliable TTL release permanently shrinks supply.
- Stale seat map after a hold looks like inventory bugs to users.
- Payment retries without idempotency create double charges or double tickets.
- Bot buyers exhaust holds before humans enter; need edge filters before the map.
Scaling the system
- Put waiting-room state at the edge or a dedicated queue service; keep seat DB behind admission.
- Shard seat rows by event/section; split a hot section if one table owns the contention.
- Cache seat-map reads aggressively; keep hold/sale writes on the primary inventory path.
- Autoscale release workers with open-hold count, not only checkout QPS.
- Rate-limit hold creation per user/session after admission.
Failure handling
| Failure | What the user sees | What the system does |
|---|---|---|
| Sale opens, queue long | Position / wait estimate | Admit in batches; do not open raw inventory |
| Seat taken at hold | “Pick another seat” | Failed CAS; refresh map patch |
| Hold expired mid-pay | “Hold expired—try again” | Late payment cannot mark sold |
| Payment PSP down | Retry / try another method | Keep hold until TTL; no silent sold |
| Release worker lag | Seats look held too long | Alert on expired-but-held count; manual reclaim path |
API design
Hottest calls:
| API | Purpose |
|---|---|
POST /events/{id}/queue | Enter waiting room |
GET /events/{id}/admission | Poll token / position |
GET /events/{id}/seat-map | Cached availability |
POST /holds | Conditional seat reserve (TTL) |
POST /checkouts | Pay against hold_id (idempotent) |
Buyer Waiting room Inventory Payments
|-- enter queue ---->| | |
|<-- admit token ----| | |
|-- POST /holds ------------------------->| |
| | | CAS available→held|
|<-- hold_id ----------------------------| |
|-- POST /checkout ------------------------------------------>|
| | |<-- confirm -------|
| | | held→sold |
|<-- ticket --------------------------------------------------------------------------|
Green Dashboard. Angry Users. The Production Mindset System Design Interviews Expect.
Dashboards can be green while buyers rage. Classic case: checkout success rate looks fine, but held-but-expired seats piled up because the release job stalled. The map showed half the venue “unavailable” while nobody was actually paying.
What it looks like. Support hears “everything is greyed out.” Revenue is flat. Inventory “utilization” looks high. No 5xx spike.
Why it happens. Teams alerted on payment errors and API latency, not on expired holds still in held or time-to-release p99.
What good teams do. Track expired-held count, hold→pay conversion, waiting-room admit rate vs inventory write QPS, and oversell attempts (failed CAS). Alert when release lag crosses the hold TTL.
How to use this in an interview. One war story: stuck holds → false sold-out → measure release lag → sweeper + alert. One failure, one metric, one fix.
Bottlenecks and tradeoffs
- Fair FIFO waiting room vs randomized batch admission (speed vs “I was first”).
- Long holds improve conversion and starve the map; short holds frustrate slow payers.
- Strong consistency on every seat-map tile is usually wrong; strong consistency on hold/sale is right.
- Building a full bot platform eats the interview; say edge rate limits + device attestation lightly.
Interview tips
You might say: “Hot sales enter a waiting room so admission matches inventory capacity. Seats are held with a TTL and assigned with a conditional update so only one buyer wins.”
Interview Push: “What if two people hold the same seat?”
Land here: “They cannot both succeed. Hold is a compare-and-set on seat status. The loser gets availability error and refreshes. Oversell is a bug in that CAS, not a queue tuning issue.”
You might say: “Abandoned checkouts return via hold expiry and a release worker.”
Interview Push: “Is the seat map strongly consistent?”
Land here: “The map is a cached projection and can lag. Ownership is strongly consistent at hold and checkout. I will not put 2M browsers on row locks for a prettier map.”
What should stick
- Flash sale is an admission problem before it is a database problem.
- Per-seat (or seat-group) conditional updates prevent oversell—not one global counter.
- Holds need a TTL + release path, or the venue looks sold out forever.
- Seat-map reads can be cached; ownership cannot.
- Payment must be idempotent against the hold.
Key Takeaways
- Start from one purchase path: queue → map → hold → pay → ticket.
- Waiting room + sharded inventory + TTL holds are the core trio.
- Measure release lag and failed CAS (oversell attempts), not only checkout 200s.
- Keep resale, dynamic pricing, and deep bot warfare out of the critical path unless asked.
Related Topics
- How to Prepare for System Design Interviews - Multi-week study plan and pacing
- Vaccine Booking Flow - Appointment inventory and holds under load
- Booking Waitlist - Fair admission when supply is scarce
- Design Uber - Atomic accept under contention
- System design interview guides - Full guide catalog
Quick revision notes
The problem in your own words. A ticketing app must let many people try to buy limited seats without selling any seat twice, and must admit hot-sale traffic fairly.
The design in one breath. Queue buyers in a waiting room, serve the seat map from cache, hold seats with a TTL via conditional updates sharded by section, then charge idempotently against the hold and release on expiry.
The choices you must defend. Waiting room vs open map. Per-seat CAS vs global counter. Hold length. Bundle reserve for adjacent seats. Cached map vs strongly consistent tiles.
The mistakes that cost points. One global seats-left lock, no hold expiry, non-idempotent payment, and letting the full herd hit inventory at T0.
What interviewers expect
Virtual waiting room or token queue. Hold seat with expiry. Atomic decrement inventory shard.
Interview workflow (template)
- Clarify requirements. Confirm functional scope, users, consistency needs, and which non-functional goals matter most (latency, availability, cost).
- Rough capacity. Estimate QPS, storage, and bandwidth so your data model and partitioning story are grounded.
- APIs and core flows. Define a minimal API and walk 1–2 critical read/write paths end to end.
- Data model and storage. Choose stores for each access pattern; call out hot keys, indexes, and retention.
- Scale and failure. Add caching, sharding, replication, queues, or fan-out as needed; say what breaks in failure modes.
- Tradeoffs. Name alternatives you rejected and why (e.g. strong vs eventual consistency, sync vs async).
Frequently asked follow-ups
- How do you prevent overselling seats?
- How do you handle a flash sale spike?
- How do you serve the seat map under load?
- How do you stop bots from grabbing inventory?
- When do you put buyers in a waiting room?
Deep-dive questions and strong answer outlines
Flash sale?
Enqueue users; issue purchase tokens; shard inventory by section; optimistic concurrency per seat.
Hold?
Reserve seat TTL 10 min; payment confirms; release on timeout cron.
Oversell?
Conditional update on seat status; single winner per seat_id.
Waiting room?
FIFO queue at edge; randomize batch admission; rate-limit add-to-cart.
Adjacent seats?
Lock seat group as transaction bundle or two-phase reserve.
AI feedback on your design
After a practice session, InterviewCrafted summarizes strengths, gaps, and interviewer-style expectations—similar to a written debrief. See a static example report, then practice this problem to get feedback on your own answer.
FAQs
Q: Geo restrictions?
A: Rules engine at checkout—brief.
Q: Dynamic pricing?
A: Price service read at hold time—lock price in hold record.
Q: Secondary market?
A: Separate transfer workflow.
Q: Map UI?
A: Client renders; server authoritative inventory.
Practice interactively
Open the practice session to use the canvas and stages, then review AI feedback.