← Back to practice catalog

System design interview guide

Design Ticketmaster

TL;DR:

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.

Overview diagram for Design Ticketmaster

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.

  1. 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.
  2. Name the hard constraints out loud. Never oversell. Fair admission under spike. Abandoned holds return. Adjacent seats as one bundle when required.
  3. Separate admission from inventory. The waiting room protects the seat map. Inventory owns who holds which seat.
  4. Deep-dive one fight. Usually atomic hold / conditional seat update, or waiting-room admission. Leave bots as a short edge filter.
  5. 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.

SignalRough estimateWhat it implies
People at sale open~2M concurrent intentEdge + waiting room must absorb the herd
Seats for a hot event~5K–50KInventory is small vs browsers; contention is per seat
Browse : buy~100 : 1Most traffic is read; buy path must be gated
Hold window~5–15 minRelease jobs and hold store matter as much as checkout
Peak buy attemptstens of thousands / s at openWithout 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

DecisionChoiceWhyCost
Flash-sale entryVirtual waiting room / token queueBounds who can hit inventoryUX wait; fairness tuning
Seat ownershipConditional update per seat_id (or seat group)One winner; no oversellHot seats still contend
HoldSoft reserve with TTLStops abandoned carts from locking the mapNeed release worker + clear UX
Seat-map readsCache / CDN with short TTL + invalidate on holdSurvives browse stormMap can lag a few seconds
Adjacent seatsBundle reserve in one transactionPrevents split pairsHarder under contention
PaymentCharge against hold id (idempotent)Same retry ≠ second ticketHold 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

  1. Admitted buyer requests hold for seat_ids (or a section+row bundle).
  2. Inventory runs a conditional update: seats still available → set held, hold_id, expires_at, buyer id.
  3. If any seat fails, roll the bundle back; return “no longer available.”
  4. Buyer pays with hold_id + idempotency key. On success, seats go sold and a ticket record is created.
  5. On payment failure or hold expiry, seats return to available.

Write path — hold expiry

  1. A release worker (or DB TTL + sweeper) finds holds past expires_at still in held.
  2. Conditional update: still held for that hold_id → available.
  3. In-flight payment that arrives late must see hold gone and fail safely—not invent a seat.

Read path — seat map

  1. Serve layout + availability snapshot from cache keyed by event_id (and section).
  2. On hold/sale, invalidate or patch the affected seats.
  3. 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_left integer 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

FailureWhat the user seesWhat the system does
Sale opens, queue longPosition / wait estimateAdmit 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 downRetry / try another methodKeep hold until TTL; no silent sold
Release worker lagSeats look held too longAlert on expired-but-held count; manual reclaim path

API design

Hottest calls:

APIPurpose
POST /events/{id}/queueEnter waiting room
GET /events/{id}/admissionPoll token / position
GET /events/{id}/seat-mapCached availability
POST /holdsConditional seat reserve (TTL)
POST /checkoutsPay 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

  1. Flash sale is an admission problem before it is a database problem.
  2. Per-seat (or seat-group) conditional updates prevent oversell—not one global counter.
  3. Holds need a TTL + release path, or the venue looks sold out forever.
  4. Seat-map reads can be cached; ownership cannot.
  5. 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.

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)

  1. Clarify requirements. Confirm functional scope, users, consistency needs, and which non-functional goals matter most (latency, availability, cost).
  2. Rough capacity. Estimate QPS, storage, and bandwidth so your data model and partitioning story are grounded.
  3. APIs and core flows. Define a minimal API and walk 1–2 critical read/write paths end to end.
  4. Data model and storage. Choose stores for each access pattern; call out hot keys, indexes, and retention.
  5. Scale and failure. Add caching, sharding, replication, queues, or fan-out as needed; say what breaks in failure modes.
  6. 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.