Design Room-Level Hotel Reservations Without Double Booking
Quick Overview
Explore a room-level hotel reservation design where searches may be stale but overlapping stays can never both be confirmed. The discussion covers half-open date ranges, expiring holds, atomic booking, idempotent retries, payment failures, and reconciliation.
Design Room-Level Hotel Reservations Without Double Booking
Company: Lead
Role: Software Engineer
Category: System Design
Difficulty: medium
Interview Round: Onsite
# Design Room-Level Hotel Reservations Without Double Booking
Design a hotel reservation service that models individual room numbers rather than abstract room types. Users search for rooms available across a requested date range, place a short-lived hold, and confirm or cancel a booking.
The design must prevent two users from confirming the same room for overlapping nights. Search results should help users avoid repeatedly selecting a room already being held, while the final booking path must remain correct even if any cache or real-time availability indicator is stale.
### Constraints & Assumptions
- Treat stays as half-open date ranges: check-in is included and check-out is excluded.
- A hold expires after a configurable duration if it is not confirmed.
- The same request may be retried.
- Search may be eventually consistent; confirmation may not double-book.
### Clarifying Questions to Ask
- Can a booking change rooms during one stay?
- How fresh must search and hold indicators be?
- Are payment authorization and reservation confirmation one atomic business operation?
- What cancellation, extension, and overbooking policies apply?
### What a Strong Answer Covers
- Room-level entities and interval or room-night availability modeling
- A durable, atomic contention point for holds and confirmations
- Hold expiration, retries, idempotency, and payment failure handling
- Fast search and real-time hints that do not become correctness authorities
- Date boundaries, time zones, observability, and reconciliation
### Follow-up Questions
- What happens when two users hold the same room simultaneously?
- How do expired holds get reclaimed after a worker outage?
- How would you search a long date range efficiently?
- Can a cache ever safely decide that a room is bookable?
Quick Answer: Explore a room-level hotel reservation design where searches may be stale but overlapping stays can never both be confirmed. The discussion covers half-open date ranges, expiring holds, atomic booking, idempotent retries, payment failures, and reconciliation.
Design Room-Level Hotel Reservations Without Double Booking
Lead
Jul 8, 2026, 12:00 AM
mediumSoftware EngineerOnsiteSystem Design
0
0
Design Room-Level Hotel Reservations Without Double Booking
Design a hotel reservation service that models individual room numbers rather than abstract room types. Users search for rooms available across a requested date range, place a short-lived hold, and confirm or cancel a booking.
The design must prevent two users from confirming the same room for overlapping nights. Search results should help users avoid repeatedly selecting a room already being held, while the final booking path must remain correct even if any cache or real-time availability indicator is stale.
Constraints & Assumptions
Treat stays as half-open date ranges: check-in is included and check-out is excluded.
A hold expires after a configurable duration if it is not confirmed.
The same request may be retried.
Search may be eventually consistent; confirmation may not double-book.
Clarifying Questions to Ask Guidance
Can a booking change rooms during one stay?
How fresh must search and hold indicators be?
Are payment authorization and reservation confirmation one atomic business operation?
What cancellation, extension, and overbooking policies apply?
What a Strong Answer Covers Guidance
Room-level entities and interval or room-night availability modeling
A durable, atomic contention point for holds and confirmations
Hold expiration, retries, idempotency, and payment failure handling
Fast search and real-time hints that do not become correctness authorities
Date boundaries, time zones, observability, and reconciliation
Follow-up Questions Guidance
What happens when two users hold the same room simultaneously?
How do expired holds get reclaimed after a worker outage?
How would you search a long date range efficiently?
Can a cache ever safely decide that a room is bookable?