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

How to prepare

The AlgoPath blog has 28 articles in “How to prepare”, newest first, written for developers without a CS degree.

How to prepare

Sliding window algorithm: the template, Python code and how to spot it in a problem

Two indexes that only move right turn longest-substring and smallest-subarray problems into O(n). Trigger words, the template, Python code, a traced run and Minimum Window Substring.

2026-10-14

How to prepare

Dijkstra's algorithm in Python: shortest paths with a heap in O((V + E) log V)

How Dijkstra finds shortest paths in a weighted graph, why the greedy pick is safe, Python code with heapq, a traced run, and Network Delay Time.

2026-10-11

How to prepare

Priority queue in Python: heapq, the size-k trick and when a problem needs one

heapq turns a list into a min-heap with O(log n) push and pop. The API table, the max-heap trick, tuples for priorities, Top K Frequent Elements and Merge k Sorted Lists.

2026-10-09

How to prepare

Binary search on the answer: the pattern behind minimum speed and smallest capacity

When you cannot compute the answer but can verify a guess, search the range of answers. The check function, the bounds, Python code and Koko Eating Bananas traced by hand.

2026-10-07

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

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