Design real-time collaboration like Google Docs
PremiumReal-timeHard
- Operational transformation
- CRDT
- Conflict resolution
Quick answer
This real-time interview question asks you to design real-time collaboration like Google Docs. Aim for a design that delivers updates to many users with low delay, then explain connections, fan-out, ordering and trade-offs. Interviewers want to see how you keep latency low, handle reconnects and stay correct under load.
The problem
Design the real-time collaboration engine behind a document editor like Google Docs. Up to 100 people can have one document open and several type in the same sentence at once; every copy must converge to exactly the same text, no edit may be lost, and a user must never see their own typing lag.
The document is plain text with simple formatting ranges (bold, italic, headings).
What must the system do?
- Edit: Insert, delete and format text at a position; local edits appear instantly.
- Converge: All connected clients show the same document after all edits are delivered, regardless of arrival order.
How well must it do it?
- Latency: Remote edits appear within 300 ms in the same region.
- Correctness: Convergence must hold under any interleaving of edits; it is not acceptable to pick a winner and drop the loser.
What scale should you design for?
Use these numbers in your estimates.
The scale numbers unlock with this questionUnlock
Key concepts
- Operational transformation
- CRDT
- Conflict resolution
- WebSocket
- Single writer ordering
- Snapshots
How you’ll practise
- Requirements
- Estimate
- Connections
- Message flow
- Delivery guarantees
- Wrap-up
Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.
What do interviewers look for?
In any real-time design round.
- Clarifies latency, ordering and delivery guarantees
- Chooses a connection model with reasons
- Explains fan-out to many receivers
- Handles reconnects, missed messages and duplicates
- Plans for hot spots and sudden traffic spikes
- States trade-offs between consistency and speed
Questions people ask about this interview question
- Which design type is this question?
- It is a real-time question. You design real-time collaboration like Google Docs and explain your choices the way you would in an interview.
- Is this question asked at entry level?
- It is marked Hard. It suits engineers preparing for senior interviews, where you are expected to drive the discussion and go deep on trade-offs.
- What should I cover first?
- Start with who sends and receives updates, how fast they must arrive and what order matters. Agree on scope with the interviewer before you design anything.
- Can I practise it for free?
- It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.
Related questions
Updated · Written by the SevyDevy team