Backend System Design: Design a Scalable Backend for a Real-Time Collaborative Document Editor
Interview Experience
Round 1 System Design
Problem
Design the backend for a real-time collaborative document editor (think Google Docs). Multiple users edit the same document simultaneously. Changes must appear on all clients within 500ms. The system must handle merge conflicts, offline editing with sync-on-reconnect, and document history (full undo).
Requirements:
- 1M concurrent documents, up to 50 simultaneous editors per document
- Operations: insert, delete, format — all at character granularity
- History: unlimited undo per user, full document version history
Follow-ups
- Walk through Operational Transformation (OT) vs. CRDTs — which would you choose and why?
- How does your system handle a user who goes offline for 10 minutes and comes back with 200 buffered operations?
- What is your persistence model — event sourcing, periodic snapshots, or both?
- Describe the WebSocket session lifecycle: how do you handle reconnects and ensure no operations are lost or duplicated?
Full Details
Round 1 System Design
Problem
Design the backend for a real-time collaborative document editor (think Google Docs). Multiple users edit the same document simultaneously. Changes must appear on all clients within 500ms. The system must handle merge conflicts, offline editing with sync-on-reconnect, and document history (full undo).
Requirements:
- 1M concurrent documents, up to 50 simultaneous editors per document
- Operations: insert, delete, format — all at character granularity
- History: unlimited undo per user, full document version history
Follow-ups
- Walk through Operational Transformation (OT) vs. CRDTs — which would you choose and why?
- How does your system handle a user who goes offline for 10 minutes and comes back with 200 buffered operations?
- What is your persistence model — event sourcing, periodic snapshots, or both?
- Describe the WebSocket session lifecycle: how do you handle reconnects and ensure no operations are lost or duplicated?
About This Question
This is a candidate experience report from a merge interview for a backend role during the onsite round.
It covers the following topics: Onsite, System Design, System Design .