Design a watch history and resume-playback service
I was asked this
No reports yet. Sign in to say where you were asked it.
A system design interview question asked in Google's first round (coding), last asked Sep 2025. It tests api design, storage and consistency.
Design the service behind a video platform's watch history: it records which titles each user watched and how far they got, so playback resumes at the right point on any device, and "continue watching" and history lists are fast. Define the APIs, the data model, idempotent progress updates, sync across devices, privacy controls, and how it scales for reads and writes.
Requirements
- Functional: report playback progress while watching; get the resume position for a title; list a user's history and their "continue watching" row; mark a title finished; delete one item or the whole history; pause history recording.
- Non-functional: hundreds of millions of users and frequent progress heartbeats (tens of seconds apart) from every active player; resume lookups in tens of milliseconds; a newer position from one device must not be overwritten by an older one from another; history deletions are honoured everywhere.
Clarifying questions
- How often do players report progress, and how many concurrent viewers are there at peak?
- Are there profiles within one account? Does each have its own history?
- When two devices play the same title, whose position wins?
- How long is history kept, and are there legal deletion requirements?
- Is the history used by recommendations, and how fresh must that copy be?
What a strong answer covers
- API:
PUT /users/{u}/progress/{title}withposition,duration,device_id,client_timestampand a sequence number;GET /users/{u}/progress/{title};GET /users/{u}/history?cursor=;DELETEfor one item or all. - Idempotent writes: an update applies only if it is newer (by client timestamp plus a per-session sequence number), so retries and out-of-order heartbeats are harmless.
- Data model: a wide-column or key-value store partitioned by user, with rows keyed by title for resume and a secondary ordering by last watched for the history list.
- Write load: clients throttle heartbeats, and the service may buffer the latest position per session in a cache and flush periodically, accepting a few seconds of loss; always write on pause, stop and app close.
- Cross-device sync: last-writer-wins with the rule above, and a fresh read on app start or title open; push updates optional.
- Privacy: profile-level isolation, pause and delete, and propagating deletions to caches, analytics and the recommendation feed through an event stream.
- Scale: hot partitions for heavy users are rare but possible; caching of the "continue watching" row; multi-region replication with the user's home region taking writes.
Follow-ups
- Episodes of a series: resume the next episode once the current one is finished.
- A family shares one profile on two TVs at once. What should happen?
- How do you rebuild a user's history if the cache layer lost writes?
Where it's asked
- Google · First round: coding · Last asked Sep 202545 min · Coding in a Google Doc, no syntax highlighting or autocomplete · No AI
What it tests
api design · storage · consistency
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
