HLDArena
HLD-307·Caching & Consistency
Hard · 1,500 pts

Live Gaming Leaderboard & Rank Aggregator

Design a global esports leaderboard handling tens of thousands of concurrent match score increments per second while serving real-time Top-100 and player percentile lookups.

Max p99
≤ 55 ms
Availability
≥ 99.5%
Budget
≤ $6,000

Functional Requirements

  • FR-1POST /leaderboards/{tournament_id}/score — Records a player match score delta.
  • FR-2GET /leaderboards/{tournament_id}/top — Returns sorted top-K standings and caller rank.
  • FR-3PATCH & DELETE /leaderboards/{tournament_id}/score — Updates, cancels, or deletes tournament_id records and immediately invalidates or updates cached state (read-after-write).
  • FR-4Players must immediately see their updated score reflected after match completion (read-after-write).

Workload Profile

Baseline Matches50,000 Rank Read RPS / 14,000 Score Write RPS
Finals Burst130,000 Read RPS / 38,000 Write RPS
Active Working Set28 GB sorted rank sets & player scores
Contention ProfileHigh skew on flagship global tournament_id

Consistency Model

Read-after-write rank accuracy required (write-through sorted cache or immediate cache invalidation + durable backing store).

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