Articles on data structures and algorithms
The AlgoPath blog has 37 articles on data structures, algorithms and coding interview prep, written for developers without a CS degree. Many take one pattern at a time, with code and a worked example. The rest cover how to study and how to interview.
Monotonic stack in Python: next greater element in O(n) and the loop to memorise
A stack that stays sorted answers next greater and next smaller for every index in one pass. Trigger words, the loop, Python code, the direction table and Largest Rectangle in Histogram.
2026-10-04
Merge sort vs quicksort: which one to write in an interview and why
Both split and conquer in O(n log n), but they differ on stability, memory and the worst case. Python code for both, the table that settles the choice, and the merge-sort counting trick.
2026-10-02
Fast and slow pointers: cycle detection and the middle of a list in O(1) space
Two pointers at speeds one and two find a cycle, its start, and the middle node without extra memory. The wording that calls for it, Python code, the proof, and Find the Duplicate Number.
2026-09-30
Why are algorithms so hard when you can already code
Knowing a language and solving algorithm problems are two different skills. Five specific things sit between them, and none of them is talent.
2026-09-29
Trie in Python: how a prefix tree works and when a problem needs one
A trie stores words letter by letter and answers prefix questions in O(L). The Python class, how it differs from a hash set, the wording that calls for it, and Word Search II worked through.
2026-09-28
Union-Find in Python: what it is and when a problem needs it
Union-Find tracks which elements share a group and merges groups in near O(1). The Python class with path compression and union by size, the wording that calls for it, and the four mistakes that cost the most.
2026-09-27
Kahn's algorithm in Python: topological sort, step by step
Kahn's algorithm sorts a directed graph by counting incoming edges. The code in Python, a trace you can follow by hand, the wording that tells you a problem wants it, and the three ways it breaks.
2026-09-24
Two pointers vs sliding window, and three more pairs people confuse
Two pointers and a sliding window both walk an array with two indices. What those indices mean separates them, and three more pairs work the same way.
2026-09-22
How to talk during a coding interview
The interviewer scores what you say, not what you think. Four things to say out loud, and how to rehearse them.
2026-09-15