Skip to content

Practice Problems — 21 Flagship Deep Dives (one per core pattern) ​

The 21 core patterns each get their canonical problem walked through brute force → intermediate → optimized. Every approach has its own interactive Execution Trace so you can see how each algorithm actually runs on the same example input.

Why walk the ladder instead of jumping to the optimized solution? ​

That's what interviews measure. The optimized solution is 20% of the grade; the walk from brute → optimized is 60%. Being able to articulate why the brute force is too slow and what specific insight unlocks the next approach is the senior signal that gets you leveled up.

How each page is structured ​

text
1. PROBLEM        — statement, examples, constraints
2. APPROACH 1     — Brute Force
   ├─ Intuition    │ Java code │ Execution Trace │ Complexity
3. APPROACH 2     — Intermediate improvement
   ├─ Insight from brute
4. APPROACH 3     — Optimized
   ├─ Insight from intermediate
5. COMPLEXITY SUMMARY — one comparison table
6. WHEN TO USE WHICH  — interviewer-signal decision guide
7. RELATED PROBLEMS   — variations that reuse the same ladder

The 21 pages ​

Part A — Windows & Pointers ​

Part B — Search & Order ​

Part C — Graphs & Sets ​

Part D — Greedy & Recursion ​

Part E — Dynamic Programming ​

Part F — Specialized ​

The pattern chapters vs these pages ​

You want to…Use…
Learn the pattern first timePattern chapters (Part II)
Practice a specific problemThese pages
See multiple approaches to one problemThese pages
See a pattern applied across many problemsPattern chapters
Revise before interviewPattern chapters + cheat sheets

Both cross-link. Every problem page links to its pattern chapter; every pattern chapter links to its canonical problem.

Released under MIT license.

💡 Quick shortcuts
H HintsR Run JavaA AI Help