HLDArena
HLD-308·Messaging & Fan-out
Hard · 1,500 pts

Multiplayer Document Cursor & Operation Relay

Design a real-time collaborative document backend persisting CRDT/OT edit operations and serving live document snapshots during large company all-hands sessions.

Max p99
≤ 60 ms
Availability
≥ 99.5%
Budget
≤ $6,200

Functional Requirements

  • FR-1POST /docs/{doc_id}/ops — Appends ordered edit operation and broadcasts to active collaborators.
  • FR-2GET /docs/{doc_id}/state — Loads latest compacted document snapshot + trailing op log.
  • FR-3PATCH & DELETE /docs/{doc_id}/ops — Updates, cancels, or deletes doc_id records and immediately invalidates or updates cached state (read-after-write).
  • FR-4Reconnecting collaborators must see all acknowledged edits immediately (read-after-write) despite storage brownouts.

Workload Profile

Baseline Editing48,000 Read RPS / 13,000 Op Write RPS
All-Hands Doc Surge135,000 Read RPS / 36,000 Op Write RPS
Active Working Set24 GB active document state & op buffers
Fault Scenario7x storage gray-latency spike in Wave 3

Consistency Model

Read-after-write operation visibility required per doc_id; circuit-breaker / write buffering needed for brownout survival.

Design Write-up
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 ≤ 120 ms
• Availability: ≥ 99.5%
Valid end-to-end Client → Compute → Storage topology