[--]Topic
Intervals Problems
Interval problems — merge, schedule, detect overlap, and the meeting-rooms / non-overlapping family.
Easy · 1
Medium · 4
Interval problems are a small but high-frequency interview topic. They share a common opening move: sort by start time (or end time), then sweep. Once sorted, the answer falls out of a single linear pass — merging overlaps, counting concurrent events, or selecting the maximum non-overlapping subset.
The pattern shows up in three flavors. Merging combines overlapping intervals into a smaller set (Merge Intervals, Insert Interval). Scheduling decides feasibility — can all meetings fit in K rooms (Meeting Rooms II)? Selection picks the maximum non-overlapping subset, usually using an end-time-sort plus greedy choice (Non-overlapping Intervals, Activity Selection).
The Ratta interval track covers Insert Interval, Merge Intervals, Non-overlapping Intervals, Meeting Rooms, and Meeting Rooms II. Each problem demonstrates the sort-then-sweep template and includes the heap-based variant for scheduling problems where it applies, in C++, Java, Python, and Go.