We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design and AI Engineering, by Roni Das. 984 interactive lessons.
Start LearningSystem design interview guide
in this guide
7 parts open to everyone · 3 with a free account · 3 with the course
You can read 7 of 13 parts. A free account opens the deep dive; the course opens all of it.
Most "design X" questions reward breadth, caching, sharding, CDNs. BookMyShow rewards depth on one nasty property: a single seat is a unit of inventory that must be sold exactly once, even when tens of thousands of users select it concurrently and a payment step (which can take 30-120s and fail) sits in the middle of the transaction. It probes whether you understand distributed locks, lock TTLs and their failure modes, optimistic vs pessimistic concurrency, idempotency, saga/compensation, and how to shed load with a waiting room before correctness even comes into play. The read path is easy; the interviewer is watching how you protect the write path.
This page is the free part.
₹1,111 in India$25 everywhere elseonce, for the whole course
The System Design course covers the BookMyShow design across a run of lessons, not one page. These 4 alone are about 113 minutes of step-by-step reading, 2 of them with code you run in the browser, all with a quiz.
Always clarify these in the first 5 minutes of the interview. Do not start drawing boxes until both lists are agreed.
This guide is built on these 6 lessons. Each one teaches one piece of the BookMyShow design above, step by step.
Lifetime access for ₹1,111 in India or $25 elsewhere. Interactive diagrams, quizzes, and 20 capstone projects to practise on.
This one question is not enough for the interview.
Each question has why it is asked, a full answer, what the interviewer listens for, the follow-ups, the common mistakes and a diagram (268 diagrams in all). A PDF you keep, junior to staff level.
Two courses by the author of this page:
770 lessons · 18 free to read
₹1,111 in India · $25 elsewhere, once
Get System DesignYou own this course
214 lessons · 10 free to read
₹1,333 in India · $35 elsewhere, once
Get Generative AI and Agentic AIYou own this course
Save your progress and get the interview checklist PDF
In the 2024 Coldplay India on-sale, roughly 1.3 crore (13 million) people fought for ~174,000 tickets that sold out in about 90 minutes, peaking near 5,000 booking attempts per second against a seat map where each seat can be sold exactly once.
A seat-level ticketing system where the hard part isn't scale, it's correctness under contention: 50,000 people clicking the same seat at the same millisecond, and exactly one of them must win. The design centers on a temporary seat-hold lock (Redis, ~10 min TTL, acquired with an atomic Lua compare-and-set), a virtual waiting room that gates the herd before it ever touches the booking service, and a payment saga that keeps the seat held until money clears, then either confirms the booking or releases the seat. Reads (seat maps, show listings) are massively cached and scale horizontally; writes (the actual booking) are funneled through a narrow, strongly-consistent path.
Where it shows up
A staple at Indian product companies and FAANG-India loops (Flipkart, Razorpay, Swiggy, Atlassian, Microsoft IDC, Amazon India, PhonePe) because it forces the candidate to reason about strict inventory concurrency, temporary locks with expiry, and payment-booking atomicity rather than just CRUD + caching. It's the canonical "no double-booking under a thundering herd" problem.
Spec sheetBookMyShow
worked through below, with the maths
The hard parts of this design are taught step by step in the System Design course: Load Shedding, Saga Pattern and Distributed Locks.
Mutual exclusion across network boundaries. Redlock, ZooKeeper locks, and why they're harder than you think.
Why some operations are safe to retry and others charge you twice, and how to make everything safe.
Long-lived transactions without distributed locking, orchestration vs choreography for microservices.
Cache-aside is said to degrade gracefully when the cache fails. Measured, unwrapped it answered 0.0 percent of requests, and wrapped it answered 13.0, which is exactly the database's capacity.
all part of
System Design Masterclass
770 lessons · about 287 hours · 18 free to read
₹1,111in India, by UPI
$25everywhere else, by PayPal
You own this course
Continue with Distributed Lockspay once,
yours for life
Live from the course bench
Real interview questions, live diagrams and measured lab results, pulled at random from the lessons. A new set every time you come back.
Show your math. Pulling numbers from thin air signals you have not thought about the load.
Peak booking attempts/sec (single hot on-sale)
~5,000 writes/sec attempted
Grounded in the Coldplay India on-sale: ~1.3 crore users, ~174,000 tickets over a ~90-minute window, reported around 4,800-4,900 booking attempts/sec at peak. This is the number your write path must survive, most attempts will lose the race for a seat.
Read:write ratio
~450:1
Estimated ~3 reads (seat map refresh, availability checks, price lookups) per booking attempt, vs ~32 successful writes/sec. Seat-status reads are the dominant load and are what you cache aggressively; confirmed bookings are a thin trickle by comparison.
Concurrent users in the waiting room
10+ million queued, dispatched ~2,000-2,500/sec
With 1.3 crore users and a fixed inventory, the waiting room holds the herd and admits a steady, controlled trickle to the booking service. Dispatch rate is tuned to what the booking + payment backend can actually absorb, not to demand.
Seat-hold TTL
~5-10 minutes
Long enough to complete a real payment (UPI/card/netbanking can take 30-120s plus user think-time), short enough that abandoned holds don't sterilize inventory during a fast on-sale. Industry write-ups commonly cite a 10-minute hold.
Inventory footprint
Tiny per show, huge in aggregate
One multiplex screen is ~150-300 seats; a single show's seat state is a few KB and fits comfortably in memory/Redis. The challenge is not data volume but the number of concurrent shows (tens of thousands live) and write contention on the hot ones.
Peak bandwidth
hundreds of MB/sec
Coldplay-scale events report ~700+ MB/sec and multiple TB transferred over the event. Most of this is seat-map and asset reads served from CDN/cache, not the booking path.
The system splits hard into a read plane and a write plane, because they have opposite requirements. The read plane, movie/event catalog, city/cinema/show listings, and the seat map, is overwhelmingly the traffic (roughly 450 reads per write) and tolerates being slightly stale. It's served from a CDN for static assets and a cache (Redis/ElastiCache) for seat maps and show metadata, fronted by stateless API servers behind a load balancer. This plane scales horizontally with no coordination. The write plane is the entire interview. It's narrow on purpose. Before a user can even attempt a booking on a hot show, they pass through a virtual waiting room (BookMyShow has used Queue-it and Cloudflare Waiting Room): the edge issues a signed token granting a queue position, and the room admits users to the live booking service at a controlled rate, a few thousand per second, regardless of how many millions are waiting. This is load-shedding: it converts an uncontrollable thundering herd into a bounded, predictable stream the backend can actually handle. Without it, the 2015 IPL-final collapse (500k+ simultaneous users) repeats. Once admitted, seat selection acquires a temporary hold in Redis. The hold is a key like seat:{showId}:{seatId} set with an atomic compare-and-set (a Lua script: "set this key to my userId only if it doesn't exist") and a TTL of ~10 minutes. Redis is the source of truth for "who currently holds this seat" precisely because that operation is atomic and sub-millisecond. If the SET succeeds, the user owns the seat; if it fails, someone else got it and the UI immediately reflects that. Because it's a single atomic op, two users clicking the same seat in the same millisecond can never both win. Holding a seat is not booking it. Payment sits in the middle, and it's slow and failure-prone, so the booking is modeled as a saga (an orchestrated state machine): create order → reserve inventory (the Redis hold) → initiate payment → on payment success, persist the booking durably to Postgres/Aurora and mark the seat permanently sold; on payment failure, timeout, or abandonment, run the compensating action, release the Redis hold so the seat returns to the pool. The hold's TTL is the safety net: even if a server crashes mid-saga, the lock auto-expires and inventory is never permanently lost. Payment confirmation arrives via webhook, which is deduplicated with an idempotency key so a retried or duplicated webhook can't create a second booking or release something it shouldn't. The confirmed booking is the only thing written to the durable relational store, where a unique constraint on (show_id, seat_id) is the final, absolute backstop against double-booking. In a real interview, sketch this on the whiteboard before diving into any single box.
In a real interview, sketch this on the whiteboard before diving into any single box.
Walk through each service. The interviewer wants to hear what each one owns, not just the names.
Sits in front of the booking service for hot on-sales. Issues signed JWT-style tokens with a queue position and expiry, and admits users to the live system at a fixed, tunable rate (e.g., ~2,000-2,500/sec) no matter how many millions are queued. This is pure load-shedding: it protects every downstream component by converting an unbounded herd into a bounded stream. BookMyShow has used Queue-it and Cloudflare Waiting Room for this.
Serves movies, events, cities, cinemas, and showtimes. Read-heavy, cache-friendly, eventually-consistent. Backed by a search index for discovery and a cache for hot listings. Scales horizontally with stateless replicas; has no role in correctness.
Returns the live seat layout and status for a given show. Reads the authoritative hold state from Redis and merges it with the booked state from the durable store, then caches the rendered map briefly. This is the highest-QPS component during an on-sale; it must be fast (<100-200ms) and is allowed to be a second or two stale for browsing, the real check happens at hold time.
The heart of concurrency control. Acquires per-seat holds via an atomic Lua compare-and-set with a ~10-minute TTL (key: seat:{showId}:{seatId} -> userId). Uses a quorum/RedLock setup across multiple Redis nodes for hot events to survive a node failure without split-brain. Auto-expiry means abandoned holds self-heal, no orphaned locks freezing inventory.
Drives create-order → reserve → pay → confirm/compensate. On success, writes the booking durably and marks seats sold; on any failure or timeout, emits ReleaseInventory to drop the Redis holds and cancel the order. Decouples the slow payment step from the fast lock step and makes partial failures recoverable instead of corrupting inventory.
Integrates UPI/cards/netbanking via a PSP (Razorpay/PayU-style). Payment is asynchronous: the user is redirected, and the result arrives via webhook. The handler is strictly idempotent, each webhook is keyed by event/payment id (stored in Redis/DB for a few hours) so duplicate or retried callbacks are no-ops. This prevents double-charges and double-bookings from PSP retries.
The system of record for confirmed bookings, payments, and seat ownership. A UNIQUE constraint on (show_id, seat_id) among active bookings is the absolute, last-line guarantee against double-booking, even if every layer above it has a bug, the database rejects the second insert. Sharded by show/event for the largest catalogs; reads can use replicas.
Sends booking confirmations and tickets/QR codes over email/SMS/in-app after a booking is confirmed. Off the critical path, fired from a queue so a slow SMS provider can never delay or block the booking commit.
Carries saga commands/events (ReserveInventory, InitiatePayment, ReleaseInventory, ConfirmOrder) and notification jobs with at-least-once delivery and retries. At-least-once is the reason every consumer must be idempotent.
shows. One row per screening/event instance. The unit everything else hangs off. Hot rows during an on-sale are a tiny subset of all live shows; route those to dedicated…
Every table for BookMyShow, its keys, and which store fits it and why.
Preventing double-booking: the atomic compare-and-set, not a read-then-write. The naive design, read 'is seat A1 free?', then write 'book A1', has a race: two requests both read 'free', both write, both succeed. The fix is to make claim a single…
6 deep dives on the parts that break at scale: Preventing double-booking: the atomic compare-and-set, not a read-then-write; Pessimistic DB locks (SELECT ... FOR UPDATE) vs. the Redis-hold approach; Lock TTL: the abandoned-cart problem and the failure modes of expiry.
Redis hold as live source of truth + DB UNIQUE constraint as backstop (vs. DB-only locking). Redis gives sub-millisecond atomic claims and free TTL-based auto-expiry, keeping DB transactions short and the database off the contention hot path. The cost is a hard…
6 decisions an interviewer expects you to defend, each with the alternative and why it loses here.
A user wants six seats together, all or nothing. How do you hold them without leaving them stuck with three?
3 follow-up questions with model answers, the interview scorecard for this question, and a mock interview on Design BookMyShow with the AI tutor.
BookMyShow's current design is, in large part, a reaction to a public failure: during the 2015 IPL final on-sale, roughly 500,000 users hit the system simultaneously and it collapsed. The lessons from that, distributed Redis-based seat locking and a virtual queue for high-demand events, became the template. The 2024 Coldplay India on-sale is the modern stress test that gets quoted in interviews: about 1.3 crore (13 million) users competing for ~174,000 tickets across three days, sold out in roughly 90 minutes, peaking near ~4,800 booking attempts/sec, with the herd gated by a virtual waiting room (Queue-it / Cloudflare Waiting Room). Public engineering write-ups consistently describe the same shape: Redis as the live hold store with an atomic Lua compare-and-set and a ~10-minute TTL, a saga/compensation flow around an asynchronous payment step with idempotent webhook handling, eventually-consistent cached seat maps for the read-heavy browse path, and a durable relational store (Postgres/Aurora) as the final system of record with a uniqueness guarantee. Treat the specific instance counts and per-second cost figures in third-party blogs as informed estimates, not official numbers, but the architectural pattern (waiting room + Redis hold + saga + DB backstop) is well-corroborated and is what interviewers expect you to converge on.
If any of these topics are fuzzy, the interviewer will catch it. Each lesson is 15 to 60 minutes with diagrams, code, and a quiz.
Distributed Locks
advanced / distributed systems core
Idempotency
foundation / core fundamentals
Saga Pattern
advanced / distributed systems core
Cache-Aside Pattern
foundation / caching strategies
Rate Limiting for Resilience
advanced / reliability resilience
Design a Payment System
capstone / capstone
Redis Cache
foundation / caching strategies
28 walkthroughs of the products Indian interviewers ask about, each with the real scale numbers, the architecture and the trade-offs that company had to make.
interview readiness
Three questions from this guide. Answer them without scrolling up, the way you would have to in the room.
India: UPI, cards or netbanking through Razorpay. Elsewhere: card or PayPal. Download at once from My packs.
NEWSystem Design Hands-On
Postgres Sharding: Complete Hands-On (PgBouncer + Citus). 2 h 36 min and 20 chapters: one PostgreSQL loaded until it breaks, then four shards behind a router you write, PgBouncer and Citus, with the 139-page slide deck. The first 15 minutes are free to watch.
Free PDF · 79 pages
25 real tech interview questions, answered in full
Five from each of our AI, GenAI, Inference, Maths for ML and Forward Deployed packs. Each with a diagram and a model answer. Free by email.
free tool
Check these numbers yourself
Put in your own guesses for BookMyShow and see requests per second, storage, bandwidth and servers, with every sum written out.
Open the Capacity EstimatorIt is really nice and good Please join the course