Uploaded October 2026 | Updated November 2026, 5 days ago
Four friends pick four seats together. A stranger grabs one first. In a System Design Interview you get exactly this question: design seat booking for BookMyShow.
System Design Interview, Day 005. Most candidates say "keep a booked column in the seats table: the user picks a seat, check that it's free, then mark it booked". Say only that, and your chances drop right there. Between the check and the booking, another user can grab the same seat. And people don't book one seat, they book four or five together.
- Fix 1: serve the seat map from a cache, even if it's a few seconds old, because lots of people look at it again and again. But a seat is confirmed only by a check in the database
- Fix 2: all the seats together, or none. Four friends pick row F, seats 5 to 8. One transaction, one conditional update: set the four seats to HELD, only if all four are still FREE. Four rows updated means the hold is confirmed. Only three means roll back, because half a booking is useless
- Fix 3: a hold with a timer. The seats stay HELD for, say, ten minutes with a countdown on the screen. Payment arrives: BOOKED. The timer runs out: the seats are FREE again on their own
- Fix 4: an idempotent payment. Even if the gateway's callback arrives twice, one key per booking means only one booking is created
- Fix 5: split by show. Partition the data by show ID, so one big film's first day doesn't slow down the other shows
- The follow-up that separates a hire from a maybe: the payment succeeded, but the hold had already expired and the seats went to someone else. Now what? Keep the hold timer a little longer than the payment gateway's timeout, so it happens less. If it still happens, check the seats again before confirming: still free, book them; not free, refund automatically and tell the user clearly. Never quietly give the same seat to two people
That's what a strong answer sounds like: the seat map from a cache, the decision from a conditional update in the database, a group's seats in one transaction or none, a hold with a timer, idempotent payments, partition by show ID, and on a late payment a fresh check or a refund.
Next System Design Interview episode: design WhatsApp. Comment and tell me: do you pick a middle seat or a corner seat?
kgptalkie.com
#shorts #SystemDesign #SystemDesignInterview #SeatBooking #BookMyShow #Idempotency #DatabaseTransactions #BackendInterview #InterviewPrep #SoftwareEngineering #Concurrency #KGPTalkie
Four friends pick four seats together. A stranger grabs one first. In a System Design Interview you get exactly this question: design seat booking for BookMyShow.
System Design Interview, Day 005. Most candidates say "keep a booked column in the seats table: the user picks a seat, check that it's free, then mark it booked". Say only that, and your chances drop right there. Between the check and the booking, another user can grab the same seat. And people don't book one seat, they book four or five together.
- Fix 1: serve the seat map from a cache, even if it's a few seconds old, because lots of people look at it again and again. But a seat is confirmed only by a check in the database
- Fix 2: all the seats together, or none. Four friends pick row F, seats 5 to 8. One transaction, one conditional update: set the four seats to HELD, only if all four are still FREE. Four rows updated means the hold is confirmed. Only three means roll back, because half a booking is useless
- Fix 3: a hold with a timer. The seats stay HELD for, say, ten minutes with a countdown on the screen. Payment arrives: BOOKED. The timer runs out: the seats are FREE again on their own
- Fix 4: an idempotent payment. Even if the gateway's callback arrives twice, one key per booking means only one booking is created
- Fix 5: split by show. Partition the data by show ID, so one big film's first day doesn't slow down the other shows
- The follow-up that separates a hire from a maybe: the payment succeeded, but the hold had already expired and the seats went to someone else. Now what? Keep the hold timer a little longer than the payment gateway's timeout, so it happens less. If it still happens, check the seats again before confirming: still free, book them; not free, refund automatically and tell the user clearly. Never quietly give the same seat to two people
That's what a strong answer sounds like: the seat map from a cache, the decision from a conditional update in the database, a group's seats in one transaction or none, a hold with a timer, idempotent payments, partition by show ID, and on a late payment a fresh check or a refund.
Next System Design Interview episode: design WhatsApp. Comment and tell me: do you pick a middle seat or a corner seat?
kgptalkie.com
#shorts #SystemDesign #SystemDesignInterview #SeatBooking #BookMyShow #Idempotency #DatabaseTransactions #BackendInterview #InterviewPrep #SoftwareEngineering #Concurrency #KGPTalkie










