🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Design a Ticket Booking System: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. What causes double booking in "check, then act" code?
  2. Q2. What does this print? (code)
  3. Q3. After running UPDATE seats SET status='HELD' ... WHERE id='B7' AND status='FREE', how does the app know whether it got the seat?
  4. Q4. Why should seat holds have an expiry time?
  5. Q5. What does this print? (code)
  6. Q6. A family books 4 seats and the third seat is already taken. What should happen?
  7. Q7. Why confirm bookings from the payment gateway's webhook rather than only from the browser redirect?
  8. Q8. Payment succeeds but the user's hold had already expired and the seat was sold to someone else. What should the system do?
  9. Q9. Can the seat map shown while browsing come from a cache with a few seconds of staleness?
  10. Q10. What does a virtual waiting room do during a booking rush?