Arrays and hashing
Counting, grouping and the dictionary as your first tool.
First to openData 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.
A sample problem, the way you will meet it: topic, difficulty, a hint when you want one, your code, the tests.
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
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)Every problem ends with the idiomatic solution, its complexity, and the one thing an interviewer probes next.
Counting, grouping and the dictionary as your first tool.
First to openMeeting in the middle on sorted input, without extra memory.
PlannedSubstrings and subarrays in one pass, and knowing when the window shrinks.
PlannedMatching brackets, monotonic stacks and the problems that are secretly a queue.
PlannedPointers you can see: reversal, cycles and the runner technique.
PlannedRecursion that reads like the problem statement, then the iterative versions.
PlannedBFS and DFS as tools, topological order, and shortest paths you will actually need.
PlannedFrom a recursive definition to a table, with the memo step in between.
Planned