
Dynamic Programming Patterns Cheat Sheet for Interviews
The 10 dynamic programming patterns that cover 90% of interview DP. Recognition signals, recurrences, Python templates, and complexity for each.
Page 13 of 61 · Ideas for curious minds in tech.
Back to the archive
The 10 dynamic programming patterns that cover 90% of interview DP. Recognition signals, recurrences, Python templates, and complexity for each.

Graph algorithms cheat sheet for coding interviews. BFS, DFS, Dijkstra, Bellman-Ford, Floyd-Warshall, Union-Find, MST, SCC: time complexities and code.

The DSA patterns cheat sheet for coding interviews: recognition signals, templates, and complexity facts for all 19 major algorithm patterns.

The one-page sorting algorithms cheat sheet: time and space complexity table, stability guide, decision logic, language internals, and interview questions.

A one-page data structures complexity cheat sheet: every Big-O for every structure, sorting algorithms, and six tricky complexity traps for interviews.
The complete big-O cheat sheet for coding interviews: data structures, sorting, graph algorithms, DP formulas, and input-size thresholds.

Reference counting is how CPython frees memory instantly. Learn how ob_refcnt works, why circular references leak, and how Swift ARC and C++ shared_ptr compare.

Garbage collection explained: how reference counting, mark-and-sweep, and generational GC work, plus what it means for coding interview space complexity.

Pointer vs reference explained for coding interviews: what each is, how they differ in C++, Java, Python, Go, and Rust, and which bugs they cause.
Cache-friendly code cuts runtime 10x without changing Big-O. Why sequential access, row-major traversal, and SoA layouts matter for coding interviews.

Memory locality is why two O(n) algorithms can run at 5x different speeds. Learn spatial vs temporal locality, cache lines, and how it shows up in interviews.
Pruning in backtracking cuts search trees from trillions of nodes to manageable. Learn feasibility pruning, bound pruning, and the sort-break trick.

Learn how the branch and bound algorithm prunes exponential search trees to find optimal solutions. Full 0/1 knapsack worked example and Python code.

State space is the universe of possibilities your algorithm navigates. Learn how it determines complexity for BFS, DFS, and dynamic programming problems.

Traveling Salesman Problem explained: why brute force fails at 15 cities, how Held-Karp DP works, and the bitmask pattern that appears in coding interviews.

The pigeonhole principle solves hard coding interview problems before you write a line of code. How it works across LeetCode 287, 523, and more.

An off-by-one error is the fencepost bug hiding in every loop and binary search. Learn the causes, < vs <= trap, and how to catch it in interviews.

A greedy algorithm fails without the greedy choice property. Learn the coin change counterexample and how to decide greedy vs DP in interviews.

A heuristic is an informed guess that trades correctness for speed. Learn what is a heuristic, why admissibility matters, and how to use one in interviews.

Deterministic vs nondeterministic algorithm explained: NP complexity class, Las Vegas vs Monte Carlo tradeoffs, and expected time complexity for interviews.

Tail call optimization (TCO) turns recursive functions into O(1) stack loops. Learn which languages support it and how it comes up in coding interviews.

What is a race condition and why does it cause silent data loss? Covers critical sections, locks, CAS, distributed fixes, and how interviewers test it.

A stack overflow error means your recursion exceeded the call stack's fixed memory limit. Here's what causes it, language limits, and how to fix it.

The call stack is how your code tracks function calls and space complexity. Learn what lives in a stack frame and why recursion depth matters.