Algorithms are a skill, not trivia -- and skills decay without reps. Pick a topic below, read the warm-up, work through the easy problems with their full solutions explained like textbook examples, then use the links at the bottom to go test yourself on the harder stuff.
Arrays & Hashing
The bar everyone starts on. Most array problems come down to trading time for space: a hash map turns an O(n) search int…
2 easy reps · 4 to level up onTwo Pointers
Instead of nesting loops over an array, walk two indices toward (or away from) each other, using the sortedness or struc…
2 easy reps · 3 to level up onSliding Window
A specialization of two pointers for 'best contiguous subarray/substring' problems. Grow a window from the right, shrink…
2 easy reps · 3 to level up onStacks
Whenever a problem cares about 'the most recent unmatched thing,' reach for a stack: matching brackets, undo history, ne…
2 easy reps · 3 to level up onBinary Search
Any time the search space is monotonic -- sorted array, or 'if X works then everything bigger/smaller also works' -- you…
2 easy reps · 3 to level up onLinked Lists
No random access, so the tools are different: dummy head nodes to avoid edge cases, fast/slow pointers to find midpoints…
2 easy reps · 3 to level up onTrees
Recursion's home turf. Most tree problems are a DFS or BFS with a small twist, and the recursive solution is usually sho…
2 easy reps · 3 to level up onHeaps / Priority Queues
For 'give me the smallest/largest so far, repeatedly' problems, a heap keeps the current best at the top in O(log n) per…
2 easy reps · 3 to level up onDynamic Programming
Leg day. The hardest topic for most people because the skill isn't the code, it's spotting the recurrence: how does the …
2 easy reps · 4 to level up onGraphs
Trees generalized: nodes can have multiple parents, cycles are possible, and the graph might not even be connected. The …
2 easy reps · 4 to level up on