Design Ticketmaster
hard 55 minSell numbered seats to far more people than there are seats.
Agree on the scope
Ask what changes the design, then commit to a short list.
Clarifying requirements
Interviewer
Let's design a ticket service like Ticketmaster.
You
The core is unique stock that cannot be restocked. Before I draw:
- Numbered seats, or general admission too? I will do numbered.
- How big is the largest sale? I would assume 14 million visitors for 50,000 to 80,000 seats.
- How long may a shopper keep seats? I suggest ten minutes.
- Do we take payment ourselves? I assume a card provider.
- Resale, transfers, dynamic prices?
Interviewer
Numbered seats, that size of sale, a provider for cards. Transfers are a small addition; no resale. What worries you in the big sale?
You
Three naive ideas fail:
- Letting all in: at 100,000 queries a second, 14 million first queries alone take 140 seconds.
- Telling most to try again: the luckiest and fastest win, and everyone presses reload.
- First come, first served with no line: the first seconds decide, and the servers fall over.
Functional requirements
- Find events by artist, venue, date, place and kind
- Seat map with free seats
- Hold up to eight seats for ten minutes
- Pay and receive tickets
- Organisers manage events, prices and seats
- A fair line for large sales
- Alerts for sales and changes
Out of scope for now
- Resale market
- Dynamic prices
- Door hardware
- Organiser payouts
Non-functional requirements
| Quality | Target | Why |
|---|---|---|
| Correctness | no seat sold twice | Two people, one chair |
| Availability | 99.99%, 53 minutes a year | A lost sale minute does not return |
| Search | 200 ms p99 | Cached |
| Hold | 500 ms p99 | A click should feel decided |
| Checkout | 2 s p99 without bank prompts | The provider is the slow part |
| Place in line | a few seconds old | Nobody needs more |
| Durability | no paid order lost | It is the fan's property |
| Freshness | map 1 to 5 s, search 60 s | The hold decides anyway |
| Fairness | speed wins nothing | Trust |
Why these questions
Each answer changes the design
| You ask | If the answer is | Then |
|---|---|---|
| Numbered seats? | General admission | A counter per section, see inventory |
| How many visitors for one sale? | Thousands | No waiting room |
| Can payment take minutes? | Yes | A paying state that time does not free |
| Adjacent seats wanted? | Always | Hold all or none, and suggest a near pair |
| Is first come, first served the law? | Yes | Order by arrival and say so |