Loading…
Every intervals problem we index, grouped by the curriculum module that teaches its pattern. Each problem ships with multiple approaches, complexity analysis, and a line-by-line walkthrough in Java and Python.
Grouped by curriculum module
Intervals guide
Overview
Intervals is ranges on a line that test sorting and sweep-line reasoning, and it shows up occasionally in technical interviews. Interval questions test whether you sort by the right key and then sweep to merge, insert, or count overlaps.
Our library indexes 7 Intervals problems (2 easy, 5 medium, 0 hard), each solved brute-force → optimal in Java and Python with a line-by-line walkthrough and interview talking points. They're grouped below by the curriculum module that teaches the underlying pattern, so related problems reinforce one another.
If you remember one thing about Intervals, make it this: Sort by start (or end) first, then a single linear sweep handles merging and overlap detection. Once that clicks, the signature patterns — sort + sweep, merge intervals, sweep line — start to feel like a checklist you run on every new problem.
Study playbook
Common pitfalls
Frequently asked
Keep exploring