Skip to content
{}DSA/from scratch

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 — 24 lessons from Big-O to dynamic programming.

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
24
interactive visualizers
20
tested code challenges
24
start to finish
~8h

One loop, repeated 24 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

Build it from scratch

Read a clean reference implementation, then write your own in the in-browser code lab against real test cases.

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

Six phases, zero hand-waving

Phase 0

How Computers Think

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

Phase 1

Linear Structures

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

Phase 2

Searching & Sorting

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

Phase 3

Trees

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

Phase 4

Graphs

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

Phase 5

Problem-Solving Patterns

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

Questions

›Do I need to know programming before starting?

You should be comfortable with basic JavaScript or any C-style language: variables, loops, functions and arrays. Every data structure itself is built from zero, so no prior DSA knowledge is needed.

›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?

Reference implementations are written in TypeScript and the in-browser code labs run JavaScript. The ideas transfer directly to Python, Java, C++ 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 with a 3-second time limit. 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.

Your first algorithm is 15 minutes away.

Lesson 01 teaches Big-O with a live growth race — and ends with a challenge you’ll solve in your browser.