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
≤ $6,250
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.
Relevant practice for
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.
Click an item in Inventory above, or press B to add a component, double-click to name, C to connect.
Design Write-up
Write under ### Architecture for Diagram to take that up directly
Compulsory section · if not written yet, Diagram reads from the start of your write-up.
Architecture: required·FRs mentioned: 0/4·0 boxes · 0 edges
0 words