Preparing your design workspace

Loading the problem and your latest saved attempt…

Design an Exact-Room Hotel Reservation System

Design a hotel booking service that offers temporary holds on exact room numbers and prevents overlapping confirmed stays under concurrency.

Problem statement

For this exercise, assume a guest searches one hotel's exact rooms for a half-open stay interval, places a five-minute hold on one room number, and then confirms or releases it. The same room must never have overlapping active holds or confirmed bookings.

Availability reads may be briefly stale, but a successful hold or confirmation must be decided by authoritative SQL state. In-memory state may accelerate reads and realtime updates, but it cannot independently confirm inventory.

Retried client requests must not create duplicate holds or bookings, expired holds must stop blocking inventory, and operator room blocks must use the same overlap rules. Payments, loyalty, dynamic pricing, room-type overbooking, housekeeping, and check-in operations are outside scope.

What to build

  1. Guests can list exact room numbers that appear available for one hotel and stay interval.
  2. Guests can idempotently place or release a five-minute hold on one exact room without overlapping another active hold, booking, or operator block.
  3. Guests can idempotently confirm, inspect, or cancel a booking while preserving a durable outcome across retries and timeouts.
  4. Operators can block an exact room for a date interval and receive a conflict instead of invalidating an overlapping confirmed booking.

At scale

  • Assume 20,000 hotels and 2 million rooms, with room inventory naturally partitioned by hotel.
  • Assume peak traffic of 3,000 availability reads per second and 150 hold, confirmation, cancellation, or block writes per second.
  • Target p95 availability reads under 300 ms and authoritative booking writes under 800 ms.
  • Keep booking writes available through a single application-node failure, but fail closed when authoritative inventory state cannot be reached.