Design a Collaborative Document Editor
xAIFrontend Engineer · OnsiteLast updated
Design collaborative editing with an explicit operation model, OT or CRDT convergence, durable history, reconnect recovery, access control, and separate presence state.
Design a collaborative document editor where several users can edit the same document and see each other's changes.
Constraints & Assumptions
The source names collaborative-document design without specifying an algorithm or scale. Define a concrete initial document model, such as plain text, and discuss rich text or offline editing as explicit extensions. Separate durable edits from ephemeral cursor presence.
Clarifying Questions
Must offline edits merge? What ordering and conflict behavior should users see? Are documents plain text or structured rich text? Who can edit, view, or share? What history and recovery guarantees are required?
Follow-up questions
- Why is last-write-wins replacement of the whole document inadequate? How do concurrent insertions at the same position converge? What changes when a client reconnects with old edits or loses permission?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.