HLDArena
HLD-245·Caching & Consistency
Medium · 1,000 pts

"Who Viewed Your Profile" Aggregation & Privacy Feed

Design a LinkedIn-style profile-view tracking and viewer-insight feed that deduplicates repeated visits within rolling windows, enforces anonymous/semi-private viewer privacy modes, and serves instant 90-day trend counts.

Max p99
≤ 52 ms
Availability
≥ 99.6%
Budget
≤ $6,850

Functional Requirements

  • FR-1POST /v1/profiles/{target_user_id}/views — Records viewer impression asynchronously with rolling-window deduplication.
  • FR-2GET /v1/profiles/{target_user_id}/viewers — Returns paginated recent viewers (masked per viewer privacy tier) and 90-day trend sparkline.
  • FR-3PATCH /v1/users/{viewer_id}/privacy-mode — Updates viewer visibility mode (full profile, semi-private title, or anonymous) for impressions.
  • FR-4High-profile executive and creator pages must absorb viral view bursts without hot-partitioning storage.

Workload Profile

Business-Hours Browsing30,000 Viewer Feed Read RPS / 11,000 Impression Write RPS
Viral Hiring Post Surge82,000 Read RPS / 28,000 Impression Write RPS
Active Working Set26 GB recent 90-day viewer rings, dedup bloom/keys & privacy flags
Traffic DistributionExtreme write/read skew on viral recruiter & executive target_user_id

Consistency Model

Buffered eventual (< 5s) impression rollup and deduplication; privacy mode changes reflected on read hydration.

Relevant practice for

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
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.6%
Valid end-to-end Client → Compute → Storage topology