Python data engineering interview problem. Difficulty: intermediate. Pattern: Intervals. About 14 minutes. Part of the Pro drill bank.
Minimum removals to make intervals non-overlapping. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.
Implement erase_overlap_intervals(intervals: list) -> int.
Input: erase_overlap_intervals([[1, 2], [2, 3], [3, 4], [1, 3]]) Output: 1 Remove [1,3].
Topics: lakebench, python, greedy, erase.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Minimum removals to make intervals non-overlapping.
Implement `erase_overlap_intervals(intervals: list) -> int`. Example: `[[1, 2], [2, 3], [3, 4], [1, 3]]` → `1`. Keep the harness.