Design the backend for a real-time collaborative document editor (like Google Docs). Focus on conflict resolution and consistency.

system-design · Senior level · software-engineering

What the interviewer is really asking

Probes understanding of distributed state synchronization, operational transformation or CRDTs, and WebSocket-based real-time architecture.

What to say

What to avoid

Example answers

Strong: I'd use OT with a central server as the arbiter: clients send ops with a revision number. The server serializes ops, transforms any concurrent ones, and broadcasts the transformed op to all clients. This is how Google Docs works — the server is the source of truth for ordering.

Weak: Use a database lock — only one user can edit at a time.

Want questions matched to your role? Paste a job title, job description, or CV and get a personalized set, or go Pro to unlock the full bank.