HLDArena
HLD-237·Caching & Edge
Medium · 1,000 pts

Personalized Music Home Shelf & Real-Time Skip Feedback

Design Spotify / YouTube Music’s personalized home shelf service combining precomputed collaborative-filtering candidates with real-time skip/play session signals.

Max p99
≤ 52 ms
Availability
≥ 99.5%
Budget
≤ $5,700

Functional Requirements

  • FR-1GET /recommendations/{user_id} — Serves low-latency ranked shelves blended with recent session context.
  • FR-2POST /events/playback — Ingests play/skip/like events to update short-term taste vectors.
  • FR-3PATCH & DELETE /recommendations/{user_id} — Updates, revokes, or deletes user_id entries with bounded TTL or explicit cache/index invalidation.
  • FR-4Must sustain morning commute spikes and survive 6x backing feature-store latency spikes.

Workload Profile

Steady Listening36,000 Shelf Read RPS / 7,500 Playback Event RPS
Commute & Friday Release Peak102,000 Read RPS / 20,000 Event RPS
Active Working Set28 GB user candidate shelves & track embeddings
Traffic DistributionActive listener user_id sessions + viral new album releases

Consistency Model

Bounded eventual taste-vector refresh (< 3s) acceptable; fallback to cached shelf on feature timeout.

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