Free beta: 60 days of full access, no card needed.84 seats leftSign up free

We use necessary cookies to run the site (sign-in and language). If you accept, we also load Google Analytics to see which pages are used, and Google reCAPTCHA to keep spam off the contact and bug-report forms. Privacy policy

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.

How to prepare

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

How to prepare

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

How to prepare

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

Algorithms step by step

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

How to prepare

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

How to prepare

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

How to prepare

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

How to prepare

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 prepare

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