43. Design Flash-Sale Ticket Booking (Ticketmaster / IRCTC Tatkal)
1
The interview prompt2
43.1 What do you ask first?3
43.2 How big is this, really?4
43.3 What are the doors?5
43.4 What do we store?6
43.5 What does the whole system look like?7
43.6 How does the waiting room work?8
43.7 How does seat locking work?9
43.8 How do you rate-limit bots?10
43.9 How do you keep it fair?11
43.10 What would you say in the last five minutes?12
Score yourself13
Variations to practise14
Sources15
Code lab43. Design Flash-Sale Ticket Booking (Ticketmaster / IRCTC Tatkal)
Variations to practise
3 min read+10 XP
Chapters used
Approach (1), Estimation (2), Caching (12, 13), Transactions and seat holds (17), Message queues and backpressure (22), Idempotency (24), Rate limiting and bots (25), CDNs (26), Live-event pre-scaling (41), Checkout and payments (42).
Try these variations
Each is a common follow-up. Answer in two minutes, then check the sketch.
- "General admission, no seat numbers." → No seat rows: a stock counter per ticket type with conditional decrements (Chapter 42), bucketed if hot.
- "Pre-registration lottery." → Accounts register days ahead; a lottery picks winners and assigns time slots; only winners can join the queue in their slot.
- "Tatkal: thousands of trains, each with its own quota." → A waiting room per train class or per popular route; holds per berth; quotas per train in separate rows.
- "Resale." → Tickets re-listed at a capped price inside the platform; the original ticket is cancelled and a new one issued to the buyer.