Intervals
Sort ranges by start (or end) time, then sweep through them, merging or counting overlaps as you go. Expect it when a problem talks about meetings, bookings or ranges, as in Merge Intervals. Sorting first leaves a single pass over the data.
15 problems · 4 with a video · 3 to practice in an AI round
| # | Problem | Difficulty | Video | AI round |
|---|---|---|---|---|
| 1 | Merge Intervals | Medium | AI round | |
| 2 | Insert Interval | Medium | AI round | |
| 3 | Non-overlapping Intervals | Medium | AI round | |
| 4 | Meeting Rooms II | Medium | — | |
| 5 | The Skyline Problem | Hard | ||
| 6 | Interval List Intersections | Medium | — | |
| 7 | My Calendar I | Medium | — | |
| 8 | Count Odd Numbers in an Interval Range | Easy | — | |
| 9 | Remove Covered Intervals | Medium | — | |
| 10 | Meeting Rooms III | Hard | — | |
| 11 | Find Right Interval | Medium | — | |
| 12 | Meeting Rooms | Easy | — | |
| 13 | Employee Free Time | Hard | — | |
| 14 | Divide Intervals Into Minimum Number of Groups | Medium | — | |
| 15 | Maximum Score of Non-overlapping Intervals | Hard | — |
Sort by what interviews ask
Sign in to see how many companies ask each problem, sort all 500 by it or by likes, and tick off what you solve.
Practice in an AI round
Three of these are AI rounds: 30 minutes, an AI agent beside your code, then a scored report.
Practice Merge Intervals in an AI roundYour first AI round is free.