Search
⌘K
Get Premium
Common Problems

Google Docs

Real-time Updates
ByStefan Mai·Published ·
hard

Try This Problem Yourself

Practice with guided hints and real-time feedback

Understanding the Problem

📄 What is Google Docs? Google Docs is a browser-based collaborative document editor. Users can create rich text documents and collaborate with others in real-time.
In this writeup we'll design a system that supports the core functionality of Google Docs, dipping into websockets and collaborative editing systems. We'll start with the requirements (like a real interview), then move on to complete the design following our Delivery Framework.

Functional Requirements

Core Requirements
  1. Users should be able to create new documents.
  2. Multiple users should be able to edit the same document concurrently.
  3. Users should be able to view each other's changes in real-time.
  4. Users should be able to see the cursor position and presence of other users.
Below the line (out of scope)
  1. Sophisticated document structure. We'll assume a simple text editor.
  2. Permissions and collaboration levels (e.g. who has access to a document).
  3. Document history and versioning.

Non-Functional Requirements

Set Up

Planning the Approach

Defining the Core Entities

Defining the API

High-Level Design

1) Users should be able to create new documents.

2) Multiple users should be able to edit the same document concurrently.

Collaborative Edits Breakdown

3) Users should be able to view each other's changes in real-time.

When the Document is Loaded

When Updates Happen

4) Users should be able to see the cursor position and presence of other users.

Potential Deep Dives

1) How do we scale to millions of websocket connections?

2) How do we keep storage under control?

Some additional deep dives you might consider

What is Expected at Each Level?

Mid-level

Senior

Staff

References

Purchase Premium to Keep Reading

Unlock this article and so much more with Hello Interview Premium

Schedule a mock interview

Meet with a FAANG senior+ engineer or manager and learn exactly what it takes to get the job.

Schedule a Mock Interview