HLD-102·Storage & Caching
Easy · 500 ptsPastebin & Ephemeral Text Snippet Store
Design a developer text-snippet sharing service where viral incident logs and code pastes experience sudden read spikes while raw snippet payloads are durably retained.
Max p99
≤ 55 ms
Availability
≥ 99.4%
Budget
≤ $1,950
Functional Requirements
- FR-1POST /pastes — Creates and stores UTF-8 text (up to 512 KB) with optional TTL and returns a unique paste_id.
- FR-2GET /pastes/{paste_id} — Views/fetches raw snippet content with low read latency under viral skew.
- FR-3PUT & DELETE /pastes/{paste_id} — Updates or deletes snippets by owner token and invalidates/expires cached entries.
- FR-4Service must remain responsive when underlying blob/database storage experiences 5x latency degradation.
Workload Profile
Baseline Load15,000 Read RPS / 1,200 Write RPS
Viral Snippet Peak48,000 Read RPS / 3,500 Write RPS
Active Working Set16 GB hot snippets (1.2 TB total archive)
Traffic DistributionZipfian read skew on shared paste_id links
Consistency Model
Eventual consistency (< 5s) acceptable for CDN/cache edge reads; newly created pastes must be durably persisted.
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