System Design Round — Design Google Docs (Deep Dive on Chunking, ACLs & Concurrency)
Prompt: Design a Collaborative Document Editor (Google Docs)
1. Requirements & Scoping
I started by clarifying target personas, core workflows, and scale assumptions before jumping into any boxes. We spent a solid chunk of the opening phase locking down functional requirements (document creation, sharing/permissions, collaborative editing) alongside non-functional targets (latency, durability, concurrent editors per doc) so there was zero ambiguity on scope.
2. End-to-End User & Backend Workflow
Before drawing the architecture, I walked through the lifecycle from both sides:
- Client perspective: How a user opens, views, and edits a document, and what interaction events leave the browser.
- Backend perspective: What happens behind the scenes the moment a client opens an existing document — authentication, permission checks, fetching document state, and establishing an active editing session.
3. High-Level Design (APIs, Storage & Bottlenecks)
- Outlined the core APIs needed for document metadata, access control, and edit operations (the interviewer was happy keeping API signatures at a clean high level).
- Proposed an initial high-level storage layout, explaining what belongs in relational vs. document/blob stores and the trade-offs of each choice.
- Proactively called out system bottlenecks in the initial topology — asking where degraded performance would be acceptable vs. where we'd need caching, partitioning, or async buffering.
4. Deep Dive (~15–20 mins): Database Schema, ACLs & Document Chunking
This was the heaviest part of the round. The interviewer drilled deep into the data layer:
- Relational schema & permissions: Walked table-by-table through SQL modeling for document ownership and fine-grained ACLs (verifying whether User A vs. User B has read/write access).
- Document chunking: Discussed splitting large documents into smaller, bounded chunks instead of rewriting entire payloads on every keystroke so edits don't overwhelm backend servers.
- SQL vs. NoSQL for chunks: Debated storing individual chunks in SQL vs. NoSQL, plus how the backend reassembles chunks efficiently on a cold document load.
- Concurrent persistence: How to safely update stored chunks when multiple editors are modifying the same document simultaneously.
5. Concurrency Ordering & Real-Time Sync
We spent the final stretch on multiplayer synchronization:
- Deterministic ordering: When dozens of users edit the same section concurrently, how do we establish a strict sequential order of operations without lost updates?
- Real-time fanout trade-offs: How changes are pushed to active viewers/collaborators, whether near-instant delivery is realistic at scale, and where latency vs. consistency trade-offs show up.
Key Takeaway: Don't treat "Design Google Docs" as just saying *"use WebSockets + OT/CRDT"*. Be ready to spend 20 minutes defending your SQL permission tables, document chunking strategy, cold-read reconstruction, and concurrent write ordering.