HLDArena
HLD-302·Transactions & Locking
Hard · 1,500 pts

Global 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
≤ $6,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.

Relevant practice for

Click an item in Inventory above, or press B to add a component, double-click to name, C to connect.

Design Write-up

Write under ### Architecture for Diagram to take that up directly

Compulsory section · if not written yet, Diagram reads from the start of your write-up.
Architecture: required·FRs mentioned: 0/4·0 boxes · 0 edges
0 words
Hidden Cases #4–#7 run automatically on Submit
Case 1: Smoke & API ContractInput Workload
Read RPS
2,000 rps
Write RPS
400 rps
Key Distribution
Uniform (Low Skew)
Chaos Fault
None (Healthy Cluster)
Expected Pass CriteriaASSERTIONS
• Tail Latency: p99 ≤ 280 ms
• Availability: ≥ 99.4%
Valid end-to-end Client → Compute → Storage topology