How to prepare
The AlgoPath blog has 28 articles in “How to prepare”, newest first, written for developers without a CS degree.
Binary search tree in Python: the rule, O(h) operations and two interview problems
Left smaller, right larger, for every node. The operation table, Python code, Validate BST with bounds, k-th smallest, lowest common ancestor in a BST and the mistakes.
2026-11-04
Memoization in Python: lru_cache, when it helps and how it differs from a table
A dictionary in front of a recursive function turns 2ⁿ into n. When it works, Python code with lru_cache and by hand, Unique Paths, Word Break, bottom-up comparison and the mistakes.
2026-11-01
Inorder, preorder, postorder and level order: which traversal for which problem
The four orders on one tree, the table that says which to pick, recursive and iterative Python code, height and diameter, Right Side View and the mistakes.
2026-10-30
Merge intervals: sort by start, one pass, and the four problems around it
Sort by start, then extend the last interval or open a new one. Trigger words, Python code for Merge and Insert Interval, Meeting Rooms II, Non-overlapping Intervals and the mistakes.
2026-10-28
Search in a rotated sorted array: why one half is always sorted
How binary search survives a rotation. The one comparison that finds the sorted half, Python code for the target and the minimum, a traced run, duplicates and the mistakes.
2026-10-25
BFS vs DFS: how to choose, Python code for graphs and grids, Number of Islands
One question decides it: do you need the shortest path? The choice table, trigger words, Python code for adjacency lists and grids, Number of Islands and the mistakes.
2026-10-23
Dynamic programming explained: state, transition, base and three worked problems
How to spot a DP problem, the three sentences to say before coding, bottom-up vs top-down, Python code for Climbing Stairs, Coin Change and House Robber, and the mistakes.
2026-10-21
Backtracking algorithm: the three-line template, Python code and N Queens
Search with undo for all permutations, all subsets and N queens. The template, Python code, a traced run, how it differs from DP and the mistakes that break it.
2026-10-18
Prefix sum array: range sums in O(1) and counting subarrays with a hash map
One pass, then any range sum costs O(1). How it is built, Python code, the hash map trick for Subarray Sum Equals K, the 2D version and the mistakes that break it.
2026-10-16