Lesson 13 of 30
A Google-Docs-style collaborative editor is one of the hardest prompts in this genre — the honest interview expectation is naming the right concepts (OT/CRDTs, presence, optimistic local edits) and reasoning about why each is needed, not implementing a merge algorithm on a whiteboard.
14 min read
Every option explains itself — why the right one is right, and why each wrong one is wrong. Miss one and it comes back later on a spaced-repetition schedule.
Question 1 of 3
Why doesn't 'lock the document while one person is editing' work as a design for a Google-Docs-style collaborative editor?
Hints without spoilers, and a plain explanation of why a wrong answer was wrong — answered only from this lesson. Free account, no card.
Sign up freeWhat interviewers actually ask about this, and what a strong answer has to cover.
A strong answer covers
Likely follow-ups
The prompt: "Design the frontend architecture for a Google-Docs-style collaborative text editor where multiple users edit the same document simultaneously." This is a genuinely hard, advanced prompt, and it's worth being explicit about the expectation up front: naming the right concepts and reasoning about why they're needed is the real signal here, not implementing a conflict-resolution algorithm from scratch in the room.
The core problem. When two users edit the same document at nearly the same moment, their edits need to merge into one consistent final state without simply overwriting each other. If user A inserts a word at position 10 and user B deletes a word at position 5 within the same second, naively applying both edits in the order they arrive can corrupt the document — the positions each edit refers to shift under each other.
Two real, established families of algorithms solve this class of problem, and naming both is the actual interview signal:
Both exist to let concurrent edits merge deterministically without a central lock forcing users to take turns. Knowing that they exist, what problem they solve, and roughly how they differ is the expected depth — implementing either one is not.
Presence. Showing other users' live cursor positions and selections is a real, separate piece of this design. Cursor movement is high-frequency and low-stakes — losing a stray cursor update costs nothing — so it typically travels over a lightweight, frequent real-time channel kept separate from the actual document-edit stream, which needs stronger delivery guarantees.
Local optimistic edits vs. reconciled shared state. A user's own keystrokes have to feel instant — applied to their local view immediately, with zero round-trip latency, regardless of what's happening on the network. The eventual, merged state — once other users' concurrent edits are reconciled in via OT or a CRDT — updates the document around that local edit rather than blocking it.
This prompt shows up specifically to see whether a candidate has the vocabulary and reasoning for genuinely hard, unsolved-by-simple-means problems — the bar is informed reasoning about the right concepts, not whiteboard-implementing a CRDT.