Inkwell Docs asks for real-time co-editing with up to 50 editors per document. Deliver the scope, an operation rate, a catch-up API, an operation log, the session path, a merge approach and a sequencing choice.
How interviewers level this design
- Junior: routes a document's editors to one place and stores an ordered operation log.
- Mid-level: explains OT or CRDT merging, versioned catch-up, snapshots and a separate presence channel.
- Senior: handles sequencer failover, offline edits that rebase on reconnect, and the memory cost of CRDT metadata.
Inkwell Docs lets up to 50 people edit one document at once. Every keystroke becomes an operation (insert "a" at position 120), and operations from different people arrive in different orders. If each client simply applied what it received, their copies would drift apart.
Two families of answers exist. Operational transformation keeps a central sequencer per document that orders operations and transforms late ones against what came before. Conflict-free replicated data types give every character a unique, ordered identity so replicas converge in any order. Either way, a document needs an ordered operation log, periodic snapshots, and a separate, short-lived presence channel for cursors. You will size the operation rate, define the API and log, draw the session path and choose the merge approach.
Order operations per document, merge concurrent edits without loss and keep presence separate from the document log.