Preparing your design workspace

Loading the problem and your latest saved attempt…

Music Playlist System

Design a durable playlist service that preserves ordered tracks across edits and supports efficient reads.

Problem statement

For this exercise, assume an authenticated user owns playlists, adds catalog tracks, removes tracks, reorders entries, and reads an ordered playlist. Concurrent edits from the owner's devices are possible, and a retried mutation must not create duplicate entries or apply a move twice.

The service must preserve a stable playlist revision and return a deterministic order after conflicts. Design the data model, mutation and read APIs, storage and cache boundaries, and failure recovery. Exclude audio streaming, recommendations, social collaboration, and catalog ingestion.

What to build

  1. An owner can create a playlist and idempotently add, remove, or reorder track entries.
  2. An owner can read a stable ordered playlist revision with pagination for long playlists.
  3. Concurrent edits return deterministic applied or conflict outcomes without silently losing changes.

At scale

  • For this exercise, assume peak traffic is 20,000 playlist-page reads and 1,000 playlist edits per second, with repeated reads of the same playlist across an owner's devices.
  • For this exercise, assume most playlists contain fewer than 500 entries, a playlist may contain up to 50,000 entries, and one read returns at most 100 entries.
  • For this exercise, assume a playlist page should return within 300 milliseconds at the 95th percentile and an acknowledged edit must survive a single service restart.
  • For this exercise, assume cross-device edits can overlap and clients retry after timeouts; each accepted edit takes effect once and a conflicting edit is reported instead of silently overwriting another change.