DSA Factory
Free Low-level design lessonsLow-level design · Stage 1 · Case studies · Step 6

Case study: movie ticket booking

Seats are a shared, scarce resource: the model, the double-booking race, and how holds, locks and constraints prevent it. About 14 minutes.

Quick check

Why does the 'hold' step exist between selecting a seat and paying?

  1. ATo reserve the seat for a short time so the user doesn't pay for a seat someone else takes
  2. BTo make payments faster
  3. CTo write an audit log
Show the answer

To reserve the seat for a short time so the user doesn't pay for a seat someone else takes. It makes the payment step safe, with an expiry so seats aren't blocked forever.

Lock it in

4 questions on this idea

Short questions that apply the idea to new cases: trace it, work out a number, put steps in order. A wrong answer explains itself.

Answer them in your browserFree account, no card. Your progress is saved, and the idea comes back in a quick review later.
Sign up free to solve