DSA for Python Engineers

Data structures and algorithms the way a working Python engineer meets them: in interviews and in code review.

Coming soon8 modules

Data structures and algorithms the way a working Python engineer meets them: in interviews and in code review. Eight modules, each one a pattern you will recognise afterwards in other people's code, written in idiomatic Python 3.12 rather than pseudocode, and ending with five interview-shaped problems and their worked answers.

The announcement comes through the letter: one email when part 1 goes live, free like every first part. Unsubscribe any time from the email or your account.

381947012345ijabcNone8312pushhash(key) % 8

How practice will work

A sample problem, the way you will meet it: topic, difficulty, a hint when you want one, your code, the tests.

Preview · how practice will feel3/8Arrays and hashing
Arrays and hashingEasy~12 min

Two sum, but the array is a stream

You receive numbers one at a time and a target. After each number, say whether any two numbers seen so far add up to the target. Aim for constant time per number.

Example · target 9 · stream 2, 7, 11, 15 · answers no, yes, yes, yes

Hint 2 of 3 A set of what you have seen turns “have I seen target minus x” into one lookup.
solution.py
def two_sum_stream(nums, target):
    seen = set()
    for x in nums:
        if target - x in seen:
            yield True
        else:
            yield False
        seen.add(x)
  • Test 1 target 9, stream 2 7 11 15 passed
  • Test 2 target 4, stream 2 2 passed
  • Test 3 hidden, 10⁵ numbers runs on submit

Every problem ends with the idiomatic solution, its complexity, and the one thing an interviewer probes next.

Planned modules

8 modules · order may change
Module 01

Arrays and hashing

Counting, grouping and the dictionary as your first tool.

First to open
Module 02

Two pointers

Meeting in the middle on sorted input, without extra memory.

Planned
Module 03

Sliding window

Substrings and subarrays in one pass, and knowing when the window shrinks.

Planned
Module 04

Stack and queue

Matching brackets, monotonic stacks and the problems that are secretly a queue.

Planned
Module 05

Linked lists

Pointers you can see: reversal, cycles and the runner technique.

Planned
Module 06

Trees

Recursion that reads like the problem statement, then the iterative versions.

Planned
Module 07

Graphs

BFS and DFS as tools, topological order, and shortest paths you will actually need.

Planned
Module 08

Dynamic programming

From a recursive definition to a table, with the memo step in between.

Planned

What to expect

  • Every solution in idiomatic Python 3.12, with the complexity stated and the reason it holds.
  • Each module ends with five interview-shaped problems and worked answers you can read, not watch.
  • A one-time purchase when it opens. Every future revision included, nothing renews.
Coming soon

DSA for Python Engineers

Data structures and algorithms the way a working Python engineer meets them: in interviews and in code review. Eight modules, from arrays and hashing to dynamic programming.