Guide · Learn

Courses, labs and interview practice

Lessons, checks, hints, Debug in a project, 22 labs and timed tasks.

The path

The Learn tab starts with a card to Start lesson or Continue lesson, then Your path: 17 courses and 236 lessons in order, each with a ring that fills as you finish lessons. Below them, Practice holds the interview tasks.

A course screen shows how many lessons it has, the time they take, how many you have done, and a timeline of lessons with their length, parts and number of checks. The next one is marked Up next.

A lesson

A lesson is split into short parts. Chips at the top jump between them: the first is Idea, the last is Your task. Code in the text has Run example, which runs it on the device and shows the output in place.

The code view has your solution.py, with long lines wrapped, and three buttons: the lightbulb for hints, ▶ to run your code, and Check.

A lesson about guard clauses with a runnable code exampleThe check sheet listing five failed checks, each saying what came back and what was expected
A lesson, and the check sheet after a first try.

Checks

Check runs your code on the device against the lesson's checks and shows a sheet: N of M checks passed, each with ✓ or ✗. A failed check says what came back and what was expected, for example describe(3) returned None, expected 'int: 3'. Is a return missing?, and the sheet shows what your code printed. When everything passes you get Why this works, a short explanation, and Next to the following lesson.

Hints and the solution

The lightbulb shows the lesson's hints one at a time (Hint 1 of 3…). After the last hint it offers Show the solution.

Debug in a project

From the check sheet, Debug in a project (or Keep as a project once it passes) turns the lesson into a normal project with solution.py, a test_solution.py holding each check as a test, and a README. It opens in the workspace, where you can set breakpoints, step through, and run pytest.

Progress

A lesson is done when every check passes. Progress and your code for each lesson are kept on the device, so you can leave a lesson and come back to it. Nothing is sent anywhere.

Interview practice

20 tasks, marked Easy, Medium or Hard. A task opens straight in the code view with a countdown timer in the toolbar, set to the task's time. Hints work as in lessons, and Test runs real tests against your solution.

Labs

The Labs tab in the next build has 32 labs in four sections. Write the Python yourself and choose Trace to run it and record what changes. The step player lets you play, pause, go back, or jump to a step while the editor highlights the line that ran.

Ten labs also run here on the website, with an editor, checks and step-by-step replay. Open the browser labs.

Basics

LabWhat you explore
Binary SearchWatch lo, hi and mid close in on the target.
Two Pointers & Sliding WindowGrow and shrink a window instead of starting over.
Stacks & QueuesMatch brackets with a stack and pass a potato with a queue.
Recursion TreeFollow every call, the call stack and each returned value.
Prefix SumsBuild cumulative totals, then answer ranges with two lookups

Data structures

LabWhat you explore
Linked ListsReverse the arrows or find the middle with two pointers.
Search & HashingBuild a hash table and see buckets fill and keys collide.
Binary Search TreesInsert and delete nodes, smaller left and larger right.
Heaps & Priority QueuesSift up and down, as a tree and as a list.
TriesStore words letter by letter, then autocomplete a prefix.
Union-FindMerge sets and watch path compression flatten them.
LRU CacheKeep recent keys and evict the one unused longest.
Monotonic StackResolve waiting days as a warmer temperature arrives

Algorithms

LabWhat you explore
Sorting BenchTrace your sort read by read, then see how it scales.
Graph ExplorerFollow BFS, DFS or Dijkstra across grids, trees and random graphs.
Dynamic ProgrammingCount repeated calls, add a cache and fill a table cell by cell.
BacktrackingPlace N queens, reach a dead end, undo and try again.
String MatchingSlide a pattern through text with naive matching and KMP.
Flood FillSpread through a grid with a stack or queue and count islands.
Topological SortRelease tasks as their final prerequisite is removed
0/1 KnapsackFill a capacity table without taking an item twice
Bellman–FordRelax weighted edges and detect reachable negative cycles
Edit Distance RowsCompare prefixes with insertion, deletion and substitution

Machine learning

LabWhat you explore
Gradient DescentRoll downhill on a loss surface, with and without momentum.
NeuronsTrain a perceptron, then a small network that learns XOR.
Genetic AlgorithmEvolve a phrase or a short tour through fitness, selection and mutation.
k-means ClusteringAssign points, move centres and repeat until still.
Q-learningTeach an agent to navigate a maze from rewards.
Linear RegressionMove a fitted line by following the mean squared-error gradient
Logistic RegressionTurn a score into a probability and learn a binary boundary
Nearest NeighboursRank points by distance, then vote with explicit tie rules
Decision StumpsTry thresholds and choose the lowest weighted Gini impurity

How it scales

For labs with growing inputs, How it scales checks correctness and then times the code without the tracer. The chart compares input size with runtime and explains the observed growth. Results come from this device; they suggest a growth rate and do not prove Big O. Labs that follow a fixed training run instead show its learning steps.

Sorting Bench compares random, sorted, reversed and duplicate-heavy input. Graph Explorer accepts any valid DFS order. Search & Hashing counts comparisons made by the keys themselves, and Dynamic Programming shows repeated recursive calls and what a cache saves.

Graph Explorer tracing a breadth-first search on a gridThe Dynamic Programming lab showing 177 calls, 11 distinct, for ways(10)
Graph Explorer tracing a BFS, and Dynamic Programming counting repeated calls.

On the website

The same lessons run in your browser at Learn, on Pyodide, with the same checker. Lessons that need PyTorch, Flask, threads or packages the browser lacks say they need the app. Progress on the website is kept in your browser and is separate from the app's.