Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Video Watch and Like Experience

Design the client and backend boundaries for displaying one published video and keeping its like button correct through retries and hot traffic.

Problem statement

For this exercise, assume an authenticated viewer opens a detail surface for one already-published on-demand video, receives the metadata and playback descriptor needed to display it, sees the aggregate like count and their own current like state, and can set that state to liked or not liked.

The client may update the button optimistically, but it must reconcile with authoritative backend state after success, rejection, timeout, reconnect, or a response arriving out of order. Retried or concurrent requests from the same user must never create more than one active like for the same video.

Video upload, transcoding, catalog or feed discovery, recommendations, comments, live streaming, watch-progress sync, and adaptive-bitrate design are outside scope.

Focus on component data flow, API contracts, durable state, media delivery boundaries, failure handling, and a suddenly hot video; code-level component implementation is outside this HLD exercise.

What to build

  1. An authenticated viewer can open an already-published video and receive display metadata, a playable media descriptor, the aggregate like count, and the caller's current like state.
  2. A viewer can idempotently set the video's desired state to liked or not liked, with retries and concurrent requests converging to one active per-user state.
  3. The client can render an optimistic like change and then reconcile it with an accepted, rejected, ambiguous, or newer authoritative result without leaving a stale button state.

At scale

  • For this exercise, assume 5 million daily viewers, peaks of 20,000 video-detail reads and 5,000 like-state mutations per second, and one hot video receiving 2,000 mutations per second.
  • For this exercise, target 300 milliseconds p95 for healthy video-detail metadata reads and accepted like-state mutations, excluding media-byte transfer time.
  • For this exercise, an accepted per-user like state is durable immediately, while the aggregate count may lag accepted changes by up to five seconds and must never become negative.
  • For this exercise, published video assets are immutable and edge-cacheable; acknowledged metadata and like state survive a single-zone failure, while count projections and caches are rebuildable.