HLD-212·Caching & Consistency
Medium · 1,000 ptsSocial Follow Graph & Blocklist Lookup Service
Design a directed social-graph edge store serving high-QPS follow/block checks across feed and messaging services with instant block enforcement.
Max p99
≤ 45 ms
Availability
≥ 99.5%
Budget
≤ $5,100
Functional Requirements
- FR-1POST /graph/{user_id}/edges — Creates or removes a follow/block edge to target_id.
- FR-2GET /graph/{user_id}/edges — Queries follower/following lists and block relationships.
- FR-3PATCH & DELETE /graph/{user_id}/edges — Updates, cancels, or deletes user_id records and immediately invalidates or updates cached state (read-after-write).
- FR-4Newly created block/unfollow actions must take effect immediately without stale cached edges (read-after-write).
Workload Profile
Baseline Graph Queries42,000 Read RPS / 4,500 Edge Write RPS
Creator Shoutout Surge118,000 Read RPS / 14,000 Write RPS
Active Working Set26 GB hot adjacency & block lists
Traffic DistributionZipfian skew on high-follower user_id nodes
Consistency Model
Read-after-write consistency required so block and unfollow actions immediately invalidate or update adjacency caches.
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