Skip to the guide

Design a collaborative editor (like Google Docs)

AdvancedCase study12 pages

Several people edit one document at once, each sees the others' typing within a fraction of a second, and nobody's words get lost. It's friends writing one wedding speech around a table, with one of them holding the pen and writing each suggestion down in the order she hears it.

It's also asked as "design Google Docs" or "design a shared whiteboard like Figma or Miro". The move behind it is taught in Real-time collaboration. Interviewers like it because the boxes are few and the hard parts are exact: who orders two edits made at once, and what happens to an edit when its server dies. Its closest case study is File storage and sync, where files are saved whole and a clash becomes a second copy.

Below is a full mock interview following the seven steps of the framework. You're the candidate: at each Guess before you read on, stop and answer first.

Step 1 · Clarify the features and cut the scope

Minutes 0–5 · How this step works

Interviewer: Design a collaborative document editor, like Google Docs.

You: A few questions first. What's in a document: text with formatting, or also tables, images and comments?

Interviewer: Text with basic formatting. Comments can wait.

You: How many people edit one document at once?

Interviewer: Up to 100, like Google Docs. Most documents have one or two.

You: Do we show who's in the document and where they're typing? And does editing work offline?

Interviewer: Faces and cursors, yes. A train tunnel mustn't lose anyone's typing, but full offline editing comes later.

You: Sharing and history?

Interviewer: Owners share with view or edit rights, and removing someone must stop them at once. Users can open older versions.

You: Then I'll cover live editing of formatted text for up to 100 editors, faces and cursors, short disconnects, sharing with instant removal, and version history. Out: comments, images and tables, full offline editing, search across documents and export. OK?

Interviewer: Good.

Each answer shapes the design: 100 editors fit one server, so one server orders each document. Short disconnects mean apps keep and resend unconfirmed edits, instant removal means the server holding the connections hears of it, and history means keeping every change.

Step 2 · Non-functional requirements

Minutes 5–8 · How this step works

You: Say 5 million editors at peak on 2 million open documents, about half that on average. Your own typing shows at once, and other editors in your region see it within 200 ms at p99. Opening a document takes under a second at p99. Editing is 99.99% available. An edit the server has acknowledged is never lost, and every editor's copy ends up identical, with one order of changes per document. A removed editor is cut off within a second.