Complexity & Problem-Solving
Think in trade-offs before you write a line.
The foundation every algorithm interview rests on: how to break a problem down, reason about time and space complexity, understand amortized cost, and pick the right data structure - plus the catalog of patterns the rest of the path drills.
Lessons in this stage
- 01
How to Solve It
IntermediateA repeatable method for attacking any interview problem - clarify, examples, brute force, optimize, code, test - and how to think out loud while you do it.
14 min - 02
Big-O in Practice
IntermediateReading the time complexity of real code: loops, nested loops, halving, and the common complexity classes from O(1) to O(2^n).
16 min - 03
Space Complexity
IntermediateThe other axis interviewers probe: auxiliary space, the hidden cost of the recursion call stack, and the classic time-vs-space trade-off.
12 min - 04
Amortized Analysis
AdvancedWhy ArrayList.add is O(1) 'on average' even though it sometimes copies everything: amortized cost and the doubling trick.
12 min - 05
Choosing a Data Structure
IntermediateA decision guide from the operations a problem needs (lookup, order, dedupe, range, priority) to the Java structure that delivers them.
14 min - 06
The Pattern Catalog
IntermediateA map of the recurring patterns - two pointers, sliding window, BFS/DFS, binary search, dynamic programming - and how to recognize which a problem wants.
13 min