20 articles · written by the instructors

Writing.

The reasoning behind the curriculum: why a pattern works, where the standard explanation goes wrong, and what actually transfers to the next problem. No listicles, no top-ten roundups.

TREESFEATURED

Why your BST validation passes the samples and dies on depth

A local check is never a tree invariant. The classic validate-BST bug, why every shallow test misses it, and why the two standard fixes are secretly the same fix.

LHDr. Lena Hoff7 min read
PATTERNSFEATURED

The sliding window invariant you should write down before you code

Most sliding-window bugs are not loop bugs. They happen because nobody ever stated, in one sentence, what must be true of the window between iterations.

NVNina Verma8 min read
PATTERNSFEATURED

Two pointers: the exchange argument, properly

Everyone says 'move the smaller one'. Here is why discarding that element can never discard a valid answer — and how to reuse the argument on problems that look nothing like Two Sum.

KTKenji Tanaka6 min read
FUNDAMENTALS

Reading a call stack without a debugger

Recursion stops being mysterious the moment you can draw the stack on paper. A method for tracing any recursive function by hand, and the three places people get it wrong.

KTKenji Tanaka7 min read
COMPLEXITY

Big-O is a promise about growth, not a speed rating

Why an O(n log n) solution can lose to an O(n²) one, what the notation actually guarantees, and how to read a constraint line to pick a target complexity before you write code.

LHDr. Lena Hoff8 min read
FUNDAMENTALS

When hashing stops being O(1)

Hash maps are taught as constant-time lookup and then used as if that were unconditional. Here is what the guarantee actually depends on, and the four ways it quietly fails.

NVNina Verma6 min read
FUNDAMENTALS

Recursion to iteration, without breaking the base case

Raising the recursion limit works right up until it segfaults. A mechanical procedure for converting any recursive function to an explicit stack, including the post-order case people get wrong.

KTKenji Tanaka7 min read
PATTERNSFEATURED

The eight dynamic programming recurrences that cover most interviews

DP is not one topic, it is a handful of state designs that recur. Here are the eight worth memorising by shape, with the question each one answers.

LHDr. Lena Hoff10 min read
GRAPHS

Why Dijkstra needs a heap and BFS does not

BFS works because every edge costs the same, so the queue is already sorted by distance. The moment weights differ, insertion order stops matching distance order — and everything follows from that.

LHDr. Lena Hoff8 min read
PATTERNS

Prefix sums: the one-line trick that kills a nested loop

Range-sum queries, subarray counting, and difference arrays — all the same idea. Plus the hash-map variant that turns a quadratic scan into a linear one.

NVNina Verma6 min read
PATTERNS

Monotonic stacks, explained by the problem they solve

Next greater element, daily temperatures, largest rectangle in a histogram — one structure, one invariant, and a clear rule for when to reach for it.

KTKenji Tanaka7 min read
PATTERNSFEATURED

Binary search on the answer, not on the array

The most useful form of binary search never touches a sorted array. If you can cheaply test whether a candidate answer works, you can search the answer space itself.

KTKenji Tanaka7 min read
TREES

Most tree problems are post-order with a return value

Once you see the skeleton, tree problems stop being individually hard. Six problems, one shape, and the only thing that ever changes.

LHDr. Lena Hoff6 min read
GRAPHS

Union-Find: the two optimisations and why both matter

Path compression and union by rank are usually presented as a pair without explanation. Here is what each one alone gets you, and why the combination is close to constant time.

KTKenji Tanaka7 min read
GRAPHS

Topological sort: three ways, and when each breaks

Kahn's algorithm, DFS with colours, and the naive attempt everyone writes first. What each detects, what each misses, and why cycle detection is the same problem.

NVNina Verma7 min read
COMPLEXITY

Memory is a complexity too, and you are probably not counting it

Recursion depth, string slicing, and the traversal you materialised for no reason. Four sources of hidden space, and how to find them before the judge does.

LHDr. Lena Hoff6 min read
LEARNINGFEATURED

How to actually practise: spaced repetition for algorithms

Solving 300 problems once teaches less than solving 120 three times at the right intervals. What to review, when, and what to write down.

PSPriya Sharma8 min read
INTERVIEWSFEATURED

The interview is not the algorithm — what senior interviewers score

The data structure is table stakes. What separates a hire from a no-hire on the same correct solution, from someone who has run several hundred of these.

PSPriya Sharma9 min read
PATTERNS

Backtracking: prune before you generate

The difference between a backtracking solution that finishes and one that does not is almost never the language. It is whether you cut branches before walking them.

KTKenji Tanaka7 min read
LEARNING

From zero to interview-ready: a realistic five-month plan

Six hours a week, twelve tracks, and no skipping. What each month contains, what to expect to feel, and the two points where most people quit.

PSPriya Sharma9 min read
20 of 20 articles