All challenges
Multiple ChoiceIntermediate 45s

Oversell Prevention in Ticket Booking

What is the most robust way to prevent overselling a limited ticket inventory under high concurrency?
Options
  1. 1Check availability in the application first, then insert the order without any guard
  2. 2Rely on a read replica's natural lag to recompute the available stock on each request
  3. 3Reserve inventory atomically with a conditional write or lock, and expire unpaid reservations
  4. 4Cache the stock count in memory and decrement it on the client before submitting

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle