The whole course ▾

System Design · Mock interview 7 of 20

Design Ticketmaster

Updated 22 Oct 2026 · By Akshay, software engineer, India · 9 min read

Design a ticket booking system like Ticketmaster.

Try it first

Before you read the interview, answer the question yourself. Give yourself 10 minutes: say your design out loud, or sketch it on paper. What would you ask? Which numbers matter? Which boxes, and what's the hard part? Then read on, and score yourself with the feedback at the end.

The video for this mock interview is coming soon.

New System Design videos go up at 6 pm. Subscribe on YouTube so you don't miss it.

Got a doubt? Ask in the comments under the video.Subscribe

Requirements

Requirements
Clarifying questions
->
Assigned seats? -> Yes, on a seat map
->
Biggest sale? -> 50,000 seats, 2M fans
->
Time to pay? -> A 10-minute hold
->
Fairness? -> Bots must not win
Functional requirements
Browse and search events
See which seats are free
Hold seats while paying
Book, and receive a ticket
Non-functional requirements
->
Never sell a seat twice
->
Survive 2M fans at 10:00
->
Browsing fast; booking exact
->
Fair: first come, first served
Out of scope
Reselling tickets
Tools for venues
Prices that change with demand
interviewer
Hi there. Let's get started.
candidate
Sure. I'll draw as I go.
interviewer
Design a ticket booking system, like Ticketmaster.
candidate
Okay. Most of the year that's a quiet catalogue of events. Then a famous singer announces a tour, and for ten minutes it's one of the busiest systems on earth. Which one are we designing? Let me ask a few questions.
interviewer
Good instinct. Go ahead.
candidate
Do fans pick assigned seats on a seat map, or just buy general entry?
interviewer
Assigned seats.
candidate
What's the biggest sale we must survive?
interviewer
A stadium: fifty thousand seats, and two million fans trying at the same moment.
candidate
How long does a fan get to pay?
interviewer
Seats are held for ten minutes.
candidate
And fairness?
interviewer
Bots must not win.
candidate
Okay. So this is as much about people as about databases.
candidate
So, what it must do. Browse and search events. See which seats are free, on a map. Hold the chosen seats while the fan pays. And book them, sending the fan a ticket.
candidate
And how well. Never sell the same seat twice: no exceptions. Survive two million fans arriving at ten o'clock. Browsing must be fast, and can be a second out of date, but booking must be exact. And fair: fans are served in the order they arrived, not by who refreshes fastest.
interviewer
Agreed.
candidate
I'll leave out reselling tickets, the tools venues use to set up seat maps, and prices that change with demand. Does that match what you had in mind?
interviewer
Yes. Focus on the big sale.

Estimation

Estimation
Back of the envelope
A normal day: ~1,000 requests/s
10:00 sale: 2M fans, ~1M requests/s
Seats: 50,000 rows, about 5 MB
Seats per fan <= 4 -> 12,500+ bookings
WHAT THE NUMBERS DECIDE
Thedataistiny;the
crowdishuge.Thedesign
isaboutcontrollingthe
crowd.
candidate
Let me size it. I suspect the numbers are very lopsided.
interviewer
What load must this handle?
candidate
Let me compare the size of the data with the size of the crowd.
candidate
On a normal day, maybe a thousand requests a second, mostly browsing. At ten o'clock on sale day, two million fans clicking and refreshing could send around a million requests a second. Yet the data is tiny: fifty thousand seat rows, a few megabytes. And with at most four seats per fan, the stadium sells out in about twelve and a half thousand bookings. That's around eighty hopeful requests for every booking.
candidate
So storage isn't the problem. A million requests a second chasing twelve thousand bookings is the problem: almost everyone leaves without tickets, and they all try at once. The design is about controlling the crowd, while keeping seat sales exactly correct.
interviewer
That's the key insight. Keep going.

API and data

API and data
Events
venue, date, on sale
at
Seats
row, number, status,
held until
Bookings
fan, seats, payment
1 : 50,000
1 : up to 4
Endpoints
1
GET /events?city=…
2
GET /events/{id}/seats -> the
seat map
3
POST /holds {seats} ->
10-minute hold
4
POST /bookings {hold, payment
key}
candidate
The API follows the booking steps: look, hold, pay.
interviewer
What does the API look like?
candidate
Four endpoints, following a fan from browsing to a ticket.
candidate
GET slash events, filtered by city and date. GET an event's seats returns the seat map, with each seat's status. POST slash holds, with the chosen seats, places a ten-minute hold, and returns a hold ID and its expiry time. And POST slash bookings turns a hold into tickets, with an idempotency key for the payment.
interviewer
Why a separate hold step?
candidate
Paying takes a minute or two. The hold keeps the seats safe while the fan pays.
candidate
Three tables. Events: where, when, and the moment sales open. Seats: one row per seat per event, with its status, available, held or sold, and when a hold runs out. And bookings: which fan bought which seats, and the payment. All three in one relational database, because selling a seat must be a single, consistent decision.
interviewer
Not NoSQL?
candidate
Fifty thousand rows is tiny. Here I want transactions more than scale.

High-level design

High-level design
Fan's
app
CDN
event pages
API
gateway
Event
service
Seat
map
cache
refreshed
every
second
event page
seat map
1
2
who's free
3
Booking
service
Seats DB
the source
of truth
Payment
provider
hold seats
4
conditional
hold
5
charge,
with key
6
held ->
sold
7
TWO RISKS
Aseatmustneverbe
soldtwice.Andtwo
millionfansarriveat
10:00:00.
candidate
Now the design. Browsing and booking are built very differently.
interviewer
Walk me through buying a ticket.
candidate
Browsing first, because that's most of the traffic, and it's the easy part.
candidate
Event pages and photos come straight from the CDN, so the fan's app barely touches our servers while browsing. The seat map goes through the API gateway to the event service, which reads it from a seat map cache, refreshed every second from the database. A map a second old is fine, because the real decision happens at the next step.
interviewer
How does the cache know a seat changed?
candidate
It doesn't need to. It reloads the whole map every second. Fifty thousand seats is small enough.
candidate
Booking is different. A hold goes to the booking service, which writes it straight to the seats DB, the source of truth, with a condition that only succeeds if the seats are still free. The fan has ten minutes. They pay through the payment provider, with an idempotency key, and when the payment succeeds, the booking service turns the held seats into sold ones and sends the tickets.
interviewer
What if the booking service crashes mid-hold?
candidate
The hold is already in the database, with its expiry. Nothing is half done, and the hold simply runs out if nobody pays.
interviewer
Where can this break?
candidate
Two places. A seat must never be sold twice, however the requests interleave. And at ten o'clock and zero seconds, two million fans press the button together.
interviewer
Correctness first.

Deep dive: never sold twice

Deep dive: never sold twice
Lock, then check
SELECT … FOR UPDATE on each seat
Others wait in line for the lock
Slow under a huge crowd
A conditional write
Hold only WHERE still available
One write wins, the other changes nothing
No waiting on locks
THE CHOICE
Aconditionalwrite,all
seatsinonetransaction:
fourseatsheldtogether,
ornone.
High-level design
Fan's
app
CDN
event pages
API
gateway
Event
service
Seat
map
cache
refreshed
every
second
event page
seat map
1
2
who's free
3
Booking
service
Seats DB
the source
of truth
Payment
provider
hold seats
4
conditional
hold
5
charge,
with key
6
held ->
sold
7
held until 10:12
a sweeper frees old
holds
TWO RISKS
Aseatmustneverbe
soldtwice.Andtwo
millionfansarriveat
10:00:00.
interviewer
Let's start with correctness.
interviewer
Two fans click the same seat at the same moment. Who gets it, and how do you guarantee only one does?
candidate
Two options.
candidate
Option one: lock each seat row with select for update, check it's free, then hold it. Correct, but under a crowd, requests pile up waiting for locks. Option two: one conditional write. Set the seats to held, for this fan, until ten minutes from now, where they're still available. The database applies the two writes one after the other: the first changes four rows, the second changes none, so that fan hears: those seats were just taken.
candidate
I'd use the conditional write, inside one transaction, so all of a fan's seats are held together, or none of them. Nobody wants two seats side by side to turn into one in row A and one in row Z. And the condition treats a seat whose hold has expired as available again.
interviewer
Good detail.
interviewer
The seat map showed a seat as free, but it was already held. Is that a bug?
candidate
No, that's the design. The map is cached and can be a second old, but the hold is a conditional write on the source of truth. The fan just hears: those seats were just taken, here are the nearest similar ones.
candidate
And holds end on their own. Each held seat stores the moment its hold expires, and the hold condition counts an expired seat as free, so an abandoned checkout can't block a seat. A small sweeper job also releases expired holds every few seconds, so the map shows them free again quickly.
interviewer
Why both the expiry check and a sweeper?
candidate
The check keeps it correct. The sweeper keeps the map honest.
interviewer
The fan's payment succeeds a few seconds after their hold expired, and someone else already took the seat. Now what?
candidate
Confirming is also a conditional write: mark the seats sold only where they're still held by this hold. Here it changes nothing, so the booking fails, and an automatic refund goes out, with an apology. To make it rarer, the app warns fans as their timer runs low.
interviewer
Fair enough.

Deep dive: ten o'clock

Deep dive: ten o'clock
A virtual waiting room
1
Arrive before 10: join the waiting room
2
At 10: everyone gets a random place
3
Admit a few thousand at a time
4
Show the place and the expected wait
WHY RANDOM PLACES?
Randomorderatopening
timemakesarrivingearly,
refreshing,andspeed
botsuseless.
High-level design
Fan's
app
CDN
event pages
API
gateway
Event
service
Seat
map
cache
refreshed
every
second
event page
seat map
1
2
who's free
3
Booking
service
Seats DB
the source
of truth
Payment
provider
hold seats
4
conditional
hold
5
charge,
with key
6
held ->
sold
7
held until 10:12
a sweeper frees old
holds
Waiting
room
queue at the
edge
join
admitted,
with token
2,000 admitted a minute
TWO RISKS
Aseatmustneverbe
soldtwice.Andtwo
millionfansarriveat
10:00:00.
interviewer
Now, the crowd.
interviewer
Two million fans arrive at ten o'clock exactly. What happens?
candidate
If I let them all straight into booking, the writes stay correct, but the booking service and the database drown, and the fastest refreshers and the bots win. So I wouldn't let them all in.
candidate
Fans who arrive before ten join a virtual waiting room, a light page served at the edge. At ten, everyone inside gets a random place in the queue, so arriving at nine fifty or nine fifty-nine makes no difference, and refreshing doesn't help. Then the system admits a few thousand fans at a time, as fast as booking can handle. Everyone sees their place, and the expected wait.
interviewer
What does a fan see while waiting?
candidate
Their place, the expected wait, and a note that refreshing won't move them.
interviewer
Why random, and not first come, first served, by the millisecond?
candidate
At that scale, the millisecond winners are bots, and people on the fastest connections. Randomising everyone who arrived before opening makes early arrival, refreshing and raw speed useless. Fans who arrive after ten join the back of the line, in order.
candidate
So the waiting room sits in front of everything. An admitted fan gets a signed token, valid for a few minutes, and the gateway refuses booking requests without one. The booking service sees a steady stream of fans, however many millions are waiting outside. When the seats run out, everyone still in line is told at once.
interviewer
What about bots joining the queue thousands of times?
candidate
Require a verified account to join, with a check like a CAPTCHA. One place in line per account. A limit of four tickets per account. And rate limits on everything, per account. A bot with ten thousand fake accounts is much harder to run than a bot that refreshes fast.
interviewer
Can the waiting room itself fall over?
candidate
It's built to be the simplest part: a static page from the CDN, plus a small token service that only tracks places in line, and both scale out easily. If anything has to strain at ten o'clock, it should be the waiting room, which is cheap, never the booking service, which is precious.
interviewer
Nice way to put it.

Wrap-up

Wrap-up
Next steps
1
Live seat map: server-sent events
2
Freed seats go to the next in line
3
Watch admission rate and hold success
4
One hot event per database shard
INTERVIEWER'S FEEDBACK
Strong:conditionalholds,holdsthat
expire,afairwaitingroom,idempotent
payment.Nexttime:putanumberon
theadmissionrate.Verdict:stronghire.
interviewer
We're almost at time.
interviewer
What would you improve with more time?
candidate
A few things.
candidate
First, a live seat map, with server-sent events, so seats grey out as they're taken. Second, seats freed by expired holds go straight to fans still in the waiting room. Third, I'd watch the admission rate, how many holds succeed, and payment failures, and tune the admission speed live. And fourth, I'd spread events across database shards, so one stadium sale can't slow down everyone else's concerts.
interviewer
Which would you do first?
candidate
The freed seats. Every expired hold is a ticket someone in the line is waiting for.
interviewer
Okay, let's stop there. Excellent. You saw early that the data is tiny and the crowd is huge. Your conditional write makes double selling impossible, holds expire on their own, and the waiting room turns a stampede into a fair line. If I push on one thing: put a number on how many fans you admit a minute, and why. I'd say a strong hire.
candidate
Thank you. I'll work out that admission rate next time.
Interviewer's feedback

Strong: conditional holds, holds that expire, a fair waiting room, idempotent payment. Next time: put a number on the admission rate. Verdict: strong hire.

Score yourself

Interviewers score these seven things. Give your own attempt a tick for each one you did.

  • Asks before drawing. Agrees what the system does, and how well: scale, speed, consistency.
  • Turns users into requests a second and bytes a day, and says what the numbers decide.
  • A small, clear contract, and a data model that fits how the data is read.
  • A working path end to end before any detail. Every box has a reason.
  • Picks the hard parts, compares two options, and chooses one with a trade-off said out loud.
  • What breaks, what happens then, and how users notice. Retries, duplicates, limits.
  • Thinks out loud, checks in with the interviewer, and takes a hint without losing the thread.

0 of 7

Your progress stays on this device.
New System Design videos at 6 pm

Lessons on weekdays, the week's revision on Saturday, a mock interview on Sunday.