Build a Continue Watching Row With Constant-Time Updates

Last updated: November 29, 2026

Quick Overview

Design a structure that tracks each Disney+ profile's partially watched titles: update(profile, title, progress) moves the title to the front, titles at 95% or more drop off, the row holds at most N titles, and get_row returns titles most recent first.

Disney
Coding & Algorithms
Software Engineer
Disney
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Medium

0

0

0 solved


Design a structure that tracks each Disney+ profile's partially watched titles: update(profile, title, progress) moves the title to the front, titles at 95% or more drop off, the row holds at most N titles, and get_row returns titles most recent first.

A design-a-data-structure round in the style of Disney Streaming onsites, based on the Continue Watching row on the Disney+ home screen. The interviewer checks O(1) updates, correct eviction, and that you think about per-profile isolation.

What the Interviewer Expects
  • Separate state per profile
  • Use an ordered hash map (or hash map plus doubly linked list) for O(1) move-to-front
  • Remove finished titles instead of keeping them at the front
  • Evict the least recent title when over capacity
  • Explain what a hand-rolled linked list version would look like
Key Topics to Cover
LRU
ordered dictionaries
linked lists
hash maps
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you sync this row across a TV, phone and browser that update concurrently?
  • How would series be represented, so the row shows the next episode rather than the finished one?
  • How would you persist this so a restart does not lose the row?
  • What if product wants the row ranked by predicted resume likelihood instead of recency?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Operations: update(profile, title, progress) with progress in [0, 1], remove(profile, title), and get_row(profile, limit). Rules: an update makes the title most recent; progress at or above 0.95...

High-Level Design

This is LRU-cache shaped, keyed by profile. Each profile gets an OrderedDict mapping title to progress, which in CPython is a hash map plus a doubly linked list. move_to_end(key, last=False) makes...


Submit Your Answer
Markdown supported