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

Geo-Indexed Vacation Rental Search & Date-Range Lock Engine

Design Airbnb’s flagship architecture combining S2/Geohash date-filtered property search with strict non-overlapping night-range reservation locking.

Max p99
≤ 120 ms
Availability
≥ 99.4%
Budget
≤ $8,000

Functional Requirements

  • FR-1GET /listings/search?cell={s2_cell}&checkin=... — Filters available properties in geo cell and date range.
  • FR-2POST /listings/{listing_id}/book — Atomically locks `(listing_id, night_date)` rows; zero double-bookings.
  • FR-3DELETE /listings/search/{listing_id} — Releases canceled or expired leases/holds atomically and immediately refreshes cached availability.
  • FR-4Must never double-book overlapping stays or lose confirmed bookings during primary DB crash.

Workload Profile

Baseline Browsing38,000 Search Read RPS / 3,200 Booking Write RPS
Summer Holiday Drop95,000 Search Read RPS / 18,000 Concurrent Book RPS
Active Working Set28 GB active 365-day listing availability calendars
Consistency GateStrict serializable night-date reservation + RPO = 0 failover

Consistency Model

Strict serializable `(listing_id, date)` locking + synchronous/quorum replication; zero double-booking.

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
320 rps
Key Distribution
Uniform (Low Skew)
Chaos Fault
None (Healthy Cluster)
Expected Pass CriteriaASSERTIONS
• Tail Latency: p99 ≤ 240 ms
• Availability: ≥ 99.4%
Valid end-to-end Client → Compute → Storage topology