HLD-315·Messaging & Fan-out
Hard · 1,500 ptsShort-Video Multi-Stage Recall, Watch-Signal & Feed Ranker
Design TikTok / Reels’ "For You" candidate retrieval and real-time watch/skip feature pipeline updating user interest embeddings within seconds.
Max p99
≤ 62 ms
Availability
≥ 99.5%
Budget
≤ $8,900
Functional Requirements
- FR-1GET /fyp/{user_id} — Runs low-latency candidate recall + ranking excluding already-watched video_ids.
- FR-2POST /fyp/{user_id}/signals — Streams watch-duration, completion, and skip events into feature store.
- FR-3PATCH & DELETE /fyp/{user_id} — Updates, cancels, or deletes user_id records and immediately invalidates or updates cached state (read-after-write).
- FR-4Must guarantee already-watched videos do not repeat (read-after-write bloom/history) under 65ms p99.
Workload Profile
Baseline Swipes58,000 Feed Read RPS / 14,000 Watch Signal RPS
Prime-Time Evening Peak150,000 Read RPS / 32,000 Signal Write RPS
Active Working Set42 GB user seen-video bloom filters & item embeddings
Traffic DistributionHeavy hot-item skew on trending viral audio/video candidates
Consistency Model
Read-after-write seen-filter updates per user_id so swiped videos are never served twice in the same session.
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