HLD-119·Caching & Edge
Easy · 500 ptsDistributed Cache Proxy & Consistent Hashing Router
Design a Mcrouter/Twemproxy-style caching router that maps hot key lookups across sharded cache pools using consistent hashing while coalescing cold-key misses.
Max p99
≤ 28 ms
Availability
≥ 99.5%
Budget
≤ $2,400
Functional Requirements
- FR-1GET /cache/{cache_key} — Routes read to consistent-hash ring shard and coalesces concurrent misses.
- FR-2PUT /cache/{cache_key} — Writes value with TTL to backing store and updates shard ring.
- FR-3PATCH & DELETE /cache/{cache_key} — Updates, revokes, or deletes cache_key entries with bounded TTL or explicit cache/index invalidation.
- FR-4Must remain available and avoid origin thundering herds when a cache/storage node crashes.
Workload Profile
Baseline Lookups24,000 Read RPS / 1,500 Write RPS
Hot-Key Ring Burst64,000 Read RPS / 4,000 Write RPS
Active Working Set12 GB hot session & object cache
Traffic DistributionZipfian skew on popular cache_key prefixes
Consistency Model
Bounded eventual cache refresh (< 3s TTL/invalidation propagation); writes durably stored.
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