HLD-305·Messaging & Fan-out
Hard · 1,500 ptsReal-Time Group Chat & Channel Persistence
Design a persistent multi-device chat backend supporting direct messages and active group channels with ordered message history, read-after-write delivery, and automatic node failover.
Max p99
≤ 70 ms
Availability
≥ 99.5%
Budget
≤ $6,200
Functional Requirements
- FR-1POST /channels/{channel_id}/messages — Appends an ordered message and triggers channel fan-out.
- FR-2GET /channels/{channel_id}/history — Fetches recent paginated messages for reconnecting clients.
- FR-3PATCH & DELETE /channels/{channel_id}/messages/{message_id} — Edits or deletes messages and propagates updates across channel caches.
- FR-4Authors and channel participants must observe newly sent/edited messages immediately without stale cache gaps.
Workload Profile
Baseline Messaging55,000 Read RPS / 12,000 Message Write RPS
Live Event Peak140,000 Read RPS / 32,000 Write RPS
Active Working Set36 GB hot channel buffers & presence state
Traffic DistributionHeavy skew on active mega-channels (channel_id)
Consistency Model
Per-channel read-after-write consistency required; cache layers must be updated or invalidated on message commit.
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