Coding Interview Solutions

A free, growing library of worked solutions to the problems that actually show up in coding interviews β€” each with a step-by-step walkthrough, clean code in Python, Java, and C++, and the time and space complexity spelled out. They’re organized by the algorithm patterns interviewers test most, so you can drill a weakness instead of grinding at random.

304 solutions across 15 patterns Β· no account or paywall required.

The highest-leverage β€” and most-feared β€” interview pattern: breaking a problem into overlapping subproblems and reusing their answers.

Recursion made visual. Traversals, depth, and path problems that teach you to think in terms of a node and its subtrees.

The warm-up round of almost every interview. In-place manipulation, prefix sums, and string parsing fundamentals.

BFS, DFS, and the realization that most grid problems are graph problems in disguise.

Pointer gymnastics. Reversal, fast/slow pointers, and cycle detection without losing your place.

The single most useful trade in interviews: spend memory to buy speed with a hash map.

LIFO and FIFO as problem-solving tools β€” especially the monotonic stack that unlocks "next greater element" problems.

Not just for sorted arrays. The real skill is spotting a monotonic search space and halving it.

Two indices, one pass, no extra memory. The elegant alternative to a nested loop.

Systematic brute force: build a candidate, and undo your last choice the moment it can't work.

Take the best choice available right now β€” and be ready to argue why that's optimal.

A contiguous range that expands and contracts in a single pass β€” the fix for most substring problems.

When you repeatedly need the smallest or largest thing, a heap gives it to you in log time.

Working directly in binary: XOR tricks and bit masks that feel like magic until you see why they work.

Primes, GCD, modular arithmetic, and overflow-safe tricks β€” the problems that reward knowing the right formula.

Reading solutions isn’t practicing

SkillFlow picks your next problem from your weakest topic, times you like a real interview, and asks AI follow-up questions afterward. Free, no credit card.

Start practicing free β†’