Loading...

The Schedule Cleaner

A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
medium
Seniority
mid, senior

Problem

Users hit play, pause, rewind, and scrub on our streaming platform, producing overlapping viewing intervals. The analytics team needs total unique watch time, but first the overlaps need to be collapsed. Given a list of [start, end] intervals that may overlap and arrive in any order, produce the smallest set of non-overlapping intervals that covers the same time.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.