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.

Algorithms step by step

Set vs map vs array: which one to use

Pick the container from the question you ask most often. Four questions, the cost table, and the cases where an array still wins.

2026-10-20

How to prepare

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

How to prepare

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

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

Algorithms step by step

Time complexity from the constraints

The line with the input size usually decides which algorithm you are allowed. A table you can memorise in five minutes, and what to do when nobody gives you one.

2026-10-13

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

Algorithms step by step

Big O notation explained simply

Big O answers one question: if the input doubles, what happens to the work? Five shapes, and how to read them off your own loops.

2026-10-06