Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Personalized Session Playlist Ranking System

Design a real-time ranking system that turns 10,000 eligible tracks into one ordered, fixed 10-track session playlist.

Problem statement

For this exercise, assume an upstream eligibility service supplies a request-specific set of 10,000 tracks. Your system must use the current request context, user history, and track features to return one ordered list of 10 distinct tracks at once.

The list is fixed for that session; playback, skips, saves, replays, and follow-up listening are recorded for future training and evaluation but never reorder the active session.

Engagement outcomes include playlist completion or percent played, early and later skips, saves or library additions, and follow-up plays from a track or related artist.

User features include age, region, account tenure, top genres and artists, listening recency and frequency, and the usual listening window by time of day. Track features include pretrained acoustic and collaborative embeddings, genre tags, artist identity, metadata, and global popularity.

Request features include time of day, day of week, device type, and entry point. Historical user-track features use the preceding 28 days of playback, skip, replay, playlist or library addition, and implicit play-sequence events.

Design the point-in-time feature and training data path, online ranking and whole-list ordering path, versioning, fallback behavior, and outcome logging. Candidate generation, music delivery, rights management, and mid-session adaptation are outside scope.

What to build

  1. Given one request and 10,000 eligible candidates, return one ordered list of 10 distinct tracks and keep that list unchanged for the session.
  2. Rank with a reproducible versioned view of the stated user, track, request, and preceding-28-day user-track features without using future outcomes.
  3. Record playlist completion, skips, saves, replays, and follow-up listening with enough identity and timing to build leakage-safe training and evaluation data.
  4. A retry with the same request identity returns the committed playlist, while a scorer or online-feature failure produces an explicit versioned fallback or unavailable outcome.

At scale

  • Each request ranks exactly 10,000 eligible candidate tracks and returns one ordered list of 10 distinct tracks at once.
  • Historical user-track features use a rolling 28-day window over playback, skip, replay, save, and sequence events.
  • For this exercise, assume 5,000 playlist-generation requests per second at peak and a 300-millisecond p95 response target in healthy operation.
  • For this exercise, assume accepted playback outcomes become available to the feature pipeline within 15 minutes, and retain rebuildable event history for at least 35 days.
  • For this exercise, assume a committed request result remains retryable for 30 minutes and survives a single-zone failure; an uncertain result is never silently regenerated under the same request identity.