Design Real-Time Collaborative Editing for a Shared Document Workspace
Last updated: November 29, 2026
Quick Overview
Design the backend for a browser-based document editor, offered as part of an AWS workspace product, where many users can type in the same document at once and see each other's cursors with low latency.
Amazon
November 29, 20260
0
0 solved
Design the backend for a browser-based document editor, offered as part of an AWS workspace product, where many users can type in the same document at once and see each other's cursors with low latency.
A classic hard collaboration design question used in Amazon senior loops. The interviewer checks that you choose between operational transformation and CRDTs with a reason, route every editor of a document to the same place, and persist edits without losing keystrokes.
What the Interviewer Expects
- Pick OT with a central sequencer or a CRDT, and justify the choice
- Route all sessions for a document to one session server
- Persist an operation log plus periodic snapshots
- Handle reconnects and offline edits by replaying from a version
- Broadcast presence (cursors, selections) on a separate lossy channel
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How does a client that was offline for an hour rejoin?
- What happens if the session server for a hot document crashes?
- How would you support a document with 200 concurrent editors?
- How would you implement version history and restore?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: open a document, edit rich text concurrently, see others' changes and cursors in under 200 ms, view version history. Non-functional: no lost edits once acknowledged; every client c...
High-Level Design
- Gateway terminates WebSockets and routes each document's sessions to one document session server, chosen via a lookup in a coordination store (document ID to server lease).
- **Session serve...