HLD-302·Transactions & Locking
Hard · 1,500 ptsGlobal Hotel Room Inventory & Overbooking Guard
Design a travel reservation engine managing date-range room allotments across properties during peak holiday flash promotions with zero double-bookings.
Max p99
≤ 140 ms
Availability
≥ 99.4%
Budget
≤ $5,600
Functional Requirements
- FR-1GET /hotels/{hotel_id}/rooms — Queries available room-night inventory for check-in/out dates.
- FR-2POST /hotels/{hotel_id}/book — Atomically decrements allotment across requested nights with idempotency.
- FR-3DELETE /hotels/{hotel_id}/rooms — Releases canceled or expired leases/holds atomically and immediately refreshes cached availability.
- FR-4Must guarantee RPO = 0 and zero overbooking when a primary database node crashes.
Workload Profile
Baseline Searches26,000 Read RPS / 4,500 Booking Write RPS
Holiday Promo Surge60,000 Read RPS / 22,000 Concurrent Write RPS
Active Working Set16 GB active 365-day room allotment matrix
Contention ProfileHigh skew on destination resort hotel_id inventory
Consistency Model
Strict serializable room-night inventory locking + RPO = 0 synchronous/quorum replication; zero stale cache double-sells.
Solutions Locked
Sign in and either achieve AC or complete 3 official submissions on this question to inspect community diagrams and writeups.
Loading solutions...
Submission History (0)Select to replay
No submissions yet
Click Submit in the top bar to evaluate against all 7 judge cases and save each run here.
Design Write-up
0 boxes · 0 edges
0 words