HLDArena
HLD-227·Caching & Consistency
Medium · 1,000 pts

Geo-Sharded Dating Deck & Mutual Swipe Matcher

Design Tinder / Bumble’s candidate recommendation deck and low-latency right-swipe mutual match detector across dense metropolitan geohash cells.

Max p99
≤ 55 ms
Availability
≥ 99.5%
Budget
≤ $5,650

Functional Requirements

  • FR-1GET /deck/{user_id} — Fetches precomputed nearby candidate profile cards excluding already-swiped users.
  • FR-2POST /swipes — Records left/right swipe and immediately detects mutual right-swipe matches.
  • FR-3PATCH & DELETE /deck/{user_id} — Updates, cancels, or deletes user_id records and immediately invalidates or updates cached state (read-after-write).
  • FR-4Must guarantee read-after-write mutual match detection and never resurface swiped profiles.

Workload Profile

Evening Baseline32,000 Deck Read RPS / 9,000 Swipe Write RPS
Sunday Night Peak86,000 Read RPS / 24,000 Swipe Write RPS
Active Working Set26 GB active swipe bitsets & candidate decks
Traffic DistributionDense geo skew in major metro user_id / cell_id shards

Consistency Model

Read-after-write consistency on swipe state so swiped cards do not reappear and mutual matches fire instantly.

Design Write-up
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 ≤ 110 ms
• Availability: ≥ 99.5%
Valid end-to-end Client → Compute → Storage topology