iq.lab
Python starts when a code cell comes near or you run one

Coding interviews, in Python, from the ground up

From the first loopto the hard ones.

Coding interviews from the ground up, in Python. Watch every line run, learn one way of thinking that works on every problem, then practice until mediums feel routine and hards feel possible.

15 modules · 59 lessons · 186 problems · about 95 hours · Python runs in your browser · no signup

30
81
22
93
44
notebookbest = 9
every number visited: the answer is 9

Every algorithm answers four questions

  1. 1Walk

    The order you visit the data: left to right, from both ends, ring by ring, choice by choice.

  2. 2Notebook

    The few things you write down as you go: a best so far, a dict of what you have seen, a stack, a table.

  3. 3Promise

    What stays true about the notebook after every step. It is why the code is right, and what you say out loud.

  4. 4Cost

    How long the walk is and how big the notebook gets: the Big O an interviewer will ask for.

Watch every line run

Code on one side, every name and value on the other, one step at a time. Then watch your own code the same way.

Predict, then write

Guess the output, put lines in order, then write the function from a blank editor. Tests say exactly what is off.

Practice that sticks

186 problems, each naming its LeetCode twin when one exists. Re-solves come back at 1, 3, 7, 14, then 30 days, alongside mixed sets and an error journal.

Say it like the round

Every pattern ends with what to say, the follow-up questions interviewers ask, and testing without a run button.

Foundations

Read Python the way the computer runs it, and count what it costs.

  1. 00The interview and this labWhat gets tested, and one way of thinking for all of it3 h 5 min
  2. 01Python, one step at a timeRead code the way the computer runs it7 h 50 min
  3. 02Counting steps: Big OHow long the walk is, how big the notebook gets3 h 35 min

Data structures

Lists, hash maps, stacks, queues, linked lists, trees and heaps, from the inside.

  1. 03Arrays and hash mapsFind anything in one step7 h 50 min
  2. 04Two pointers and sliding windowsTwo fingers on the data7 h 5 min
  3. 05Stacks and queuesLast in, first out, and first in, first out5 h 40 min
  4. 06Sorting and binary searchOrder makes everything faster7 h 15 min
  5. 07Linked listsData that points to the next piece4 h 20 min
  6. 08Recursion and treesSolve it by trusting a smaller version8 h 55 min
  7. 09Heaps and triesKeep the best on top; share the prefixes5 h 40 min

Patterns

Graphs, backtracking, dynamic programming and greedy choices.

  1. 10GraphsThings, and the connections between them9 h 50 min
  2. 11BacktrackingTry a choice, undo it, try the next4 h 5 min
  3. 12Dynamic programmingRemember the answers to smaller questions9 h 10 min
  4. 13Greedy and a little mathWhen the best move right now is the best move overall3 h 50 min

Interview mode

Recognize the pattern, run the round, and take on hard problems.

  1. 14Interview modeFrom knowing patterns to passing rounds6 h 55 min

The plan around it

Open the plan

A 16 to 20 week plan for coming back to coding interviews, built from research on how Google, Meta and other Bay Area companies run L3 and L4 loops: what each round scores, when to schedule what, and the readiness checks to pass before a dream-company loop.