Skip to content
{}

Free · no sign-up · runs in your browser

Data structures & algorithms, from scratch.

Stop memorising solutions. Build every structure yourself, watch every algorithm move, and test your code against real cases — 31 lessons, from your first loop and swap to dynamic programming — in Python and C++.

Quick sort
interactive
1/57
42
17
88
5
63
29
71
12
94
36
58
23
›Start Quick sort on 12 values.
  • comparing / current
  • moving / removing
  • done / found / visited
  • pivot / min / root
compares 0writes 0
hands-on lessons
31
interactive visualizers
20
code blocks traced line by line
27
start to finish
~11h

One loop, repeated 31 times, until DSA clicks.

Inspired by learn-by-building courses: no slides, no video walls. Every lesson follows the same four beats.

01

Intuition first

Every concept opens with a real-world analogy — phone books, chai queues, treasure hunts — before a single line of code.

02

Watch it run

Step through the algorithm frame by frame. Pause, rewind, change the input, and see comparisons and swaps counted live.

03

Write it in Python or C++

Trace each code block line by line, recall it from memory, then write your own in a Python code lab that runs in your browser — with a C++ version alongside.

04

Prove you've got it

A short quiz and an interview-style challenge per lesson. Progress is saved automatically in your browser.

Same graph. Four algorithms. See the difference.

Switch between BFS, DFS, Dijkstra and topological sort and watch the queue, stack and distances change. This is what “understanding” an algorithm looks like.

  • Every visualizer is driven by the same code you learn.
  • Step backward as easily as forward.
  • Change the input and break things on purpose.
Dijkstra
interactive
1/21
42158263172A0B∞C∞D∞E∞F∞G∞H∞
›All distances ∞ except the source A = 0.
Priority queue (closest first):A:0
Order: —
  • discovered / in container
  • processing now
  • finished

Seven phases, zero hand-waving

Phase 0

Code Fluency

The dozen loop, swap and pointer blocks every algorithm is built from — traced line by line in Python and C++ until you can write them without thinking.

Phase 1

How Computers Think

Cost models, reading a problem, memory, and recursion — the lens every later lesson is viewed through.

Phase 2

Linear Structures

Arrays, linked lists, stacks, queues and hash tables — built by hand, pointer by pointer.

Phase 3

Searching & Sorting

Binary search and six sorting algorithms, raced side by side with live comparison counters.

Phase 4

Trees

Binary trees, BSTs, heaps and tries — hierarchy as a data structure.

Phase 5

Graphs

BFS, DFS, topological sort, Dijkstra and union-find on graphs you can step through.

Phase 6

Problem-Solving Patterns

Two pointers, sliding window, backtracking, greedy and dynamic programming — the interview toolkit.

Questions

›Do I need to know programming before starting?

Only the basics of Python or C++: variables, if/else, loops, functions and lists. The first phase, Code Fluency, then drills the loop, swap and pointer patterns every algorithm is built from, so you can write code fast before any DSA starts.

›Is DSA from Scratch really free?

Yes. Every lesson, visualizer and code lab is free with no sign-up. Your progress is saved in your own browser.

›What language are the lessons in?

Python first. Every code lab runs real Python inside your browser, and every building block and cheat sheet has a Python and a C++ version side by side. You can also switch a lab to JavaScript. The ideas transfer directly to Java or Go.

›Will this prepare me for coding interviews?

The curriculum covers the structures and patterns that dominate technical interviews — hash maps, two pointers, sliding window, BFS/DFS, heaps, backtracking and dynamic programming — and each lesson ends with a classic interview-style problem.

›Where does my code run? Is it uploaded anywhere?

Your code runs inside a sandboxed Web Worker in your own browser (Python via WebAssembly) with a time limit that stops infinite loops. Nothing is sent to a server.

›How long does the full course take?

About 7 hours of focused reading and experimenting, plus however long you spend on the code labs. Most learners do one phase per week.

Stop guessing loop conditions.

Lesson 01 turns for/while bounds into one rule you can apply every time — traced line by line, then written by you in Python, right in your browser.