Design a service to view/add/remove viewers of a document (like the feature in google doc).

Medium
Company: Premium
GoogleAmazon

Imagine you're building a collaborative document editing service, similar to Google Docs. A key feature is the ability to track and manage who currently has the document open for viewing or editing. We need to design a system that allows us to efficiently:

  1. Add a viewer to a document's active viewers list.
  2. Remove a viewer from the document's active viewers list.
  3. Retrieve the current list of viewers for a document.

This problem focuses on the core domain model and concurrency aspects, rather than the complexities of distributed systems. We will assume an in-memory data structure to manage the viewer lists for each document.

Requirements

Interview Simulation

Experience a realistic interview conversation. The interviewer will ask clarifying questions,and you'll reveal your understanding of the requirements.

Interviewer

Let's start by understanding the scope. What are the core functionalities this system needs to provide?

💡 Interview Tip

Identify the Actors (Who uses the system?) and their Use Cases (What are they trying to achieve?). Start with the 'Happy Path' scenarios.

Press ⌘ + Enter to submit

Premium Content

View detailed solutions.

UNLOCK PREMIUM