Skip to content

About

Build computer science from scratch — 421 lessons across 20 phases. Bootloader, B-tree, TCP stack, type-checker, Raft, and more, in C/C++/Rust/Go/Python/Haskell/SQL/RISC-V/TLA+. Free, open source, MIT.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Course: Computer Science — banner

MIT License 421 lessons 20 phases

by Ritesh Rana  ·  contact@riteshrana.engineer

░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒

Most CS curricula teach concepts. Few make you build the artifacts. This one does.

421 lessons. 20 phases. ~706 hours. C, C++, Rust, Go, Python, Haskell, SQL, RISC-V assembly, TLA+. Every lesson builds the thing from scratch first — bootloader, B-tree, TCP state machine, type-checker, Raft — then opens the production source for the same thing. Free, open source, MIT.

You don't just learn CS. You build it. From transistors to a distributed database. By hand.

How this works

Most CS material teaches concepts in isolation. A data-structures class here, an OS class there, a databases class somewhere else. The pieces rarely line up. You hear "B-tree" in data structures and then never see one until you accidentally EXPLAIN ANALYZE in production five years later.

This curriculum is the spine. 20 phases, 421 lessons. Discrete math at one end, distributed systems at the other. Every algorithm gets built from raw memory first. Allocator. Parser. Scheduler. CPU pipeline. By the time you socket(), you already wrote the TCP state machine yourself.

Each lesson runs the same loop: read the problem, understand the model, write the code, compare against the production version, ship the artifact. No five-minute videos, no copy-paste deploys, no hand-holding. Free, open source, and built to run on your own laptop.

░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒

The shape of the curriculum

Twenty phases stack on top of each other. Foundations (math, programming, DS, algorithms, theory) are the floor. Verticals (architecture, OS, compilers, networks, DB, distributed, crypto, concurrency, graphics, perf) are the walls. Meta (software engineering, testing, type theory, capstones) is the roof.

%%{init: {'theme':'base','themeVariables':{'primaryColor':'#FFF7EC','primaryTextColor':'#2A1A2E','primaryBorderColor':'#E2557A','lineColor':'#E2557A','fontFamily':'Inter, ui-sans-serif, system-ui, sans-serif','fontSize':'12px'}}}%%
flowchart TB
  P0["Phase 00 — Setup & Tooling"] --> P1["Phase 01 — Discrete Math & Logic"]
  P1 --> P2["Phase 02 — Programming Foundations"]
  P2 --> P3["Phase 03 — Data Structures"]
  P3 --> P4["Phase 04 — Algorithms & Complexity"]
  P4 --> P5["Phase 05 — Theory of Computation"]
  P4 --> P6["Phase 06 — Digital Logic & Architecture"]
  P6 --> P7["Phase 07 — Operating Systems"]
  P5 --> P8["Phase 08 — Compilers & PL Design"]
  P7 --> P8
  P4 --> P9["Phase 09 — Computer Networks"]
  P9 --> P10["Phase 10 — Databases & Storage"]
  P10 --> P11["Phase 11 — Distributed Systems"]
  P4 --> P12["Phase 12 — Cryptography & Security"]
  P3 --> P13["Phase 13 — Concurrent & Parallel"]
  P7 --> P13
  P6 --> P14["Phase 14 — Computer Graphics"]
  P7 --> P15["Phase 15 — Systems Performance"]
  P13 --> P15
  P2 --> P16["Phase 16 — SWE & Architecture"]
  P5 --> P17["Phase 17 — Testing & Verification"]
  P8 --> P17
  P5 --> P18["Phase 18 — Type Theory & Paradigms"]
  P8 --> P18
  P11 --> P19["Phase 19 — Capstones"]
  P15 --> P19
  P12 --> P19
  P14 --> P19
  P17 --> P19
  P18 --> P19
Loading
░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒

The shape of a lesson

Each lesson lives in its own folder, with the same structure across the entire curriculum:

phases/<NN>-<phase-name>/<NN>-<lesson-name>/
├── code/      runnable implementations (C, Rust, C++, Python, Go, Haskell, asm, SQL, TLA+)
├── docs/
│   └── en.md  lesson narrative
├── quiz.json  pre/post MCQs with explanations
└── outputs/   the runnable artifact this lesson ships (tool, library, parser, etc.)

Every lesson follows six beats. The Build It / Use It split is the spine — you implement the thing from scratch first, then read the production source. You understand what the production code is doing because you wrote the smaller version yourself.

%%{init: {'theme':'base','themeVariables':{'primaryColor':'#FFF7EC','primaryTextColor':'#2A1A2E','primaryBorderColor':'#E2557A','lineColor':'#E2557A','fontFamily':'Inter, ui-sans-serif, system-ui, sans-serif','fontSize':'13px'}}}%%
flowchart LR
  A["The Problem"] --> B["The Concept"]
  B --> C["Build It"]
  C --> D["Use It"]
  D --> E["Ship It"]
  E --> F["Exercises"]
Loading

See LESSON_TEMPLATE.md for the full lesson shape.

Contributing

Goal Read
Contribute a lesson or fix CONTRIBUTING.md
Fork for your team or school FORKING.md
Lesson template LESSON_TEMPLATE.md
Track progress ROADMAP.md
Glossary glossary/terms.md
Code of conduct CODE_OF_CONDUCT.md
░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒

Contents

Phase 0: Setup & Tooling 12 lessons   Stand up a reproducible C/C++/Rust/Go/Haskell environment so every later phase just works.
# Lesson Type Lang
01 The CS Toolchain — What You'll Install and Why Learn Shell
02 Terminal, Shell, Pipes, Job Control Learn Shell
03 Git Deep — Internals, Refs, Rebase, Bisect Learn Shell
04 C/C++ Toolchain — gcc, clang, ld, ar, make Learn C, Makefile
05 Rust Toolchain — cargo, rustup, build profiles Learn Rust
06 Build Systems — Make, CMake, Bazel, Cargo Learn Makefile, Shell
07 Debuggers — gdb, lldb, rust-gdb, core dumps Learn C, Rust
08 Profilers — perf, valgrind, instruments, flamegraphs Learn Shell, C
09 Editor Setup — Neovim/VS Code with LSP, DAP Learn Shell
10 Linux for Builders — proc, sys, cgroups, namespaces Learn Shell, C
11 Docker & Devcontainers for CS Work Learn Dockerfile, Shell
12 Documentation & Diagrams — Markdown, Mermaid, plantuml Learn Markdown

Phase capstone artifact: A reproducible polyglot toolchain.  ·  ~13 h 15 min total.

Phase 1: Discrete Math & Logic Foundations 24 lessons   Build the proof, counting, and graph machinery every later phase quietly depends on.
# Lesson Type Lang
01 Propositional Logic & Truth Tables Learn Python
02 Predicate Logic & Quantifiers Learn Python
03 Proof Techniques — Direct, Contradiction, Induction Learn Python
04 Sets, Relations, Functions Learn Python
05 Equivalence Relations & Partitions Learn Python
06 Partial Orders, Lattices, Hasse Diagrams Learn Python
07 Cardinality, Countability, Diagonalization Learn Python
08 Combinatorics — Counting, Permutations, Combinations Learn Python, Rust
09 Pigeonhole, Inclusion-Exclusion, Catalan Learn Python
10 Generating Functions Learn Python
11 Recurrence Relations & the Master Theorem Learn Python
12 Asymptotic Notation — Big-O, Θ, Ω, o, ω Learn Python
13 Number Theory — Divisibility, GCD, Bezout Learn Python, Rust
14 Modular Arithmetic & Fermat / Euler Learn Python
15 Primes, Sieves, Primality Tests Learn Python, Rust
16 Boolean Algebra & Karnaugh Maps Learn Python
17 Graph Theory I — Basics, Traversals, Trees Learn Python
18 Graph Theory II — Coloring, Matching, Planarity Learn Python
19 Discrete Probability & Expectation Learn Python
20 Markov Chains & Random Walks (Discrete) Learn Python
21 Information & Coding Theory (Discrete) Learn Python
22 Phase Capstone — A Proof Companion CLI Build Python, Rust
23 Linear Algebra Foundations Learn Python
24 Calculus and Continuous Math Learn Python

Phase capstone artifact: A proof companion CLI + combinatorics library.  ·  ~23 h 45 min total.

Phase 2: Programming Foundations & Memory Model 18 lessons   Internalize the machine model: what a pointer really is, what the stack does, how Rust ownership works.
# Lesson Type Lang
01 What Is a Program, Really (Compilation, Linking, Loading) Learn C, Shell
02 Values, Types, Variables, Scope Learn C, Rust
03 Control Flow — Branches, Loops, Recursion Learn C, Rust
04 Functions, the Stack, and Calling Conventions Learn C, RISC-V Assembly
05 Pointers, Addresses, and Indirection (in C) Learn C
06 The Heap — malloc, free, fragmentation Learn C
07 Arrays, Strings, and Bounds Learn C, Rust
08 Structs, Unions, Bitfields, Alignment Learn C
09 Errors — Returns, errno, exceptions, Result types Learn C, Rust
10 Ownership and Borrowing — the Rust model Learn Rust
11 Lifetimes, References, RAII Learn Rust, C++
12 Generics, Traits, Polymorphism Learn Rust
13 Modules, Packages, Linkage Learn C, Rust
14 The Preprocessor and Macros (C, Rust) Learn C, Rust
15 Build a Pool Allocator (from scratch in C) Build C
16 Build a Bump and Arena Allocator (in Rust) Build Rust
17 Defensive Programming — Asserts, Invariants, ASAN/UBSAN Learn C, Rust
18 Phase Capstone — A Tiny Manual-Memory Library Build C, Rust

Phase capstone artifact: A tiny manual-memory library plus ownership demos.  ·  ~20 h 0 min total.

Phase 3: Data Structures 25 lessons   Build every workhorse data structure from scratch and prove its invariants.
# Lesson Type Lang
01 Arrays & Dynamic Arrays (amortized analysis) Learn Rust, Python
02 Singly and Doubly Linked Lists Learn C, Rust
03 Stacks & Queues (array and list backings) Learn Rust, Python
04 Deques, Ring Buffers, Circular Queues Learn Rust, C
05 Hash Tables — Open Addressing vs Chaining Learn Rust, Python
06 Hash Function Design — Universal, Tabulation, SipHash Learn Rust, Python
07 Binary Trees — Traversal and Recursion Patterns Learn Rust, Python
08 Binary Search Trees & Rotations Learn Rust, Python
09 AVL Trees Learn Rust, Python
10 Red-Black Trees Learn Rust, Python
11 Splay Trees & Treaps Learn Rust, Python
12 B-Trees and B+-Trees Learn Rust, Python
13 Heaps & Priority Queues (binary, Fibonacci, pairing) Learn Rust, Python
14 Tries and Radix Trees Learn Rust, Python
15 Suffix Trees and Suffix Arrays Learn Rust, Python
16 Disjoint Set Union (Union-Find) Learn Rust, Python
17 Segment Trees & Fenwick (BIT) Learn Rust, Python
18 Sparse Tables & RMQ Learn Rust, Python
19 Skip Lists Learn Rust
20 Bloom Filters, Cuckoo Filters, Count-Min Sketch Learn Rust, Python
21 LSM Trees and Write-Optimized Structures Learn Rust
22 Persistent / Immutable Data Structures Learn Rust, Haskell
23 Graphs — Representations and APIs Learn Rust, Python
24 Concurrent Data Structures Preview (Treiber stack, MS queue) Learn Rust
25 Phase Capstone — A Generic DS Library in Rust with Invariants Build Rust

Phase capstone artifact: A generic data-structure library in Rust with invariant checks.  ·  ~30 h 45 min total.

Phase 4: Algorithms & Complexity Analysis 31 lessons   Master the canon — sorting, DP, graphs, strings, geometry, randomization — and the analysis tools that bound them.
# Lesson Type Lang
01 Analyzing Algorithms — Recurrences, Master Theorem in Action Learn Python
02 Sorting I — Insertion, Selection, Bubble, and Why They Lose Learn Python, Rust
03 Sorting II — Merge, Quick (and Quickselect) Learn Python, Rust
04 Sorting III — Heap, Intro, Tim Learn Python, Rust
05 Sorting IV — Linear-Time: Counting, Radix, Bucket Learn Python, Rust
06 Searching — Binary, Exponential, Ternary, Interpolation Learn Python, Rust
07 Divide & Conquer Patterns Learn Python
08 Dynamic Programming I — 1D, Memoization, Tabulation Learn Python
09 Dynamic Programming II — 2D and Beyond Learn Python
10 DP III — Bitmask, Digit, Tree, DP on DAGs Learn Python, C++
11 Greedy Algorithms & Matroids Learn Python
12 Backtracking, Branch & Bound Learn Python, C++
13 Graph Algorithms I — BFS, DFS, Topo, SCC Learn Python, Rust
14 Graph Algorithms II — Dijkstra, Bellman-Ford, A* Learn Python, Rust
15 Graph Algorithms III — Floyd-Warshall, Johnson, APSP Learn Python
16 Minimum Spanning Trees — Prim, Kruskal, Borůvka Learn Python, Rust
17 Network Flow — Ford-Fulkerson, Edmonds-Karp, Dinic Learn Python, C++
18 Matching — Bipartite, Hopcroft-Karp, Hungarian Learn Python, C++
19 String Matching — KMP, Z, Boyer-Moore Learn Python, Rust
20 Suffix Structures in Action — Aho-Corasick, LCP Learn Python, Rust
21 Hashing in Algorithms — Rabin-Karp, Rolling Hashes Learn Python, Rust
22 Computational Geometry I — Convex Hull, Sweep Line Learn Python, C++
23 Computational Geometry II — kd-Tree, R-Tree, Range Query Learn Python, Rust
24 Randomized Algorithms — Las Vegas vs Monte Carlo Learn Python
25 Approximation Algorithms — Vertex Cover, TSP, Set Cover Learn Python
26 Online Algorithms & Competitive Analysis Learn Python
27 Streaming Algorithms — Frequency, Quantiles, HyperLogLog Learn Python, Rust
28 Parallel Algorithms — PRAM, Brent, Map-Reduce style Learn Python, Rust
29 Amortized Analysis Deep — Aggregate, Accounting, Potential Learn Python
30 Phase Capstone — Algorithm Cookbook + Benchmark Harness Build Rust, Python
31 Numerical Methods and Scientific Computing Learn Python

Phase capstone artifact: An algorithms cookbook plus a benchmark harness.  ·  ~35 h 45 min total.

Phase 5: Theory of Computation 18 lessons   From regular languages to undecidability — know what computers can't do and why.
# Lesson Type Lang
01 What Counts as Computation? Learn Python
02 Finite Automata — DFAs Learn Python
03 NFAs and Subset Construction Learn Python
04 Regular Expressions ↔ Automata Learn Python
05 Build a Regex Engine (Thompson construction) Build Python, Rust
06 Pumping Lemma for Regular Languages Learn Python
07 Context-Free Grammars Learn Python
08 Pushdown Automata & CFG Equivalence Learn Python
09 Chomsky and Greibach Normal Forms Learn Python
10 Parsing Theory — CYK and Earley Learn Python
11 Turing Machines & Variants Learn Python
12 Build a Turing Machine Simulator Build Python, Rust
13 Decidability and the Halting Problem Learn Python
14 Rice's Theorem & Undecidable Properties Learn Python
15 Time Complexity Classes — P, NP, EXP Learn Python
16 NP-Completeness — Cook-Levin and Reductions Learn Python
17 Space Complexity — L, NL, PSPACE, Savitch Learn Python
18 Phase Capstone — A Toy Proof Assistant for Reductions Build Python

Phase capstone artifact: A regex engine plus a Turing-machine simulator.  ·  ~20 h 30 min total.

Phase 6: Digital Logic & Computer Architecture 22 lessons   Walk down from instruction to transistor, then back up: ALU, pipeline, cache, MMU.
# Lesson Type Lang
01 Bits, Bytes, Two's Complement, IEEE 754 Learn C, Python
02 Transistors → Logic Gates Learn SystemVerilog (HDL)
03 Combinational Logic — Adders, Mux, Decoders Learn SystemVerilog (HDL)
04 Sequential Logic — Latches, Flip-Flops, FSMs Learn SystemVerilog (HDL)
05 Build an ALU in HDL Build SystemVerilog (HDL)
06 Registers, Register Files, Memory Banks Learn SystemVerilog (HDL)
07 The Datapath — Single-Cycle CPU Learn SystemVerilog (HDL)
08 Control Unit — Microcoded vs Hardwired Learn SystemVerilog (HDL)
09 ISA Design — RISC vs CISC, RISC-V Tour Learn Markdown, RISC-V Assembly
10 RISC-V Assembly — Hands-On Learn RISC-V Assembly
11 Pipelining — 5-Stage, Hazards, Forwarding Learn SystemVerilog (HDL)
12 Branch Prediction — Static, Dynamic, Tournament Learn SystemVerilog (HDL), C
13 Out-of-Order Execution & Tomasulo Learn Python
14 Memory Hierarchy — Cache Mapping & Coherence Learn C
15 Cache Performance — Locality, Blocking, Prefetch Learn C, C++
16 Virtual Memory — TLB, Page Tables, MMU Learn C
17 I/O — DMA, MMIO, Interrupts Learn C
18 SIMD & Vector ISAs — AVX, SVE, RVV Learn C, C++
19 GPU Architecture — SIMT, Warps, Memory Hierarchy Learn CUDA C++
20 Modern Microarchitecture Tour (Apple Silicon, AMD Zen) Learn Markdown
21 Power, Heat, Reliability — Why Cores Stopped Scaling Learn Markdown
22 Phase Capstone — A 5-Stage Pipelined RISC-V CPU in HDL Build SystemVerilog (HDL), RISC-V Assembly

Phase capstone artifact: A 5-stage pipelined RISC-V CPU in HDL with assembler.  ·  ~28 h 0 min total.

Phase 7: Operating Systems 24 lessons   Write the abstractions you've always used: process, page, file, syscall.
# Lesson Type Lang
01 What an OS Actually Does (and Doesn't) Learn Markdown
02 The Boot Process — BIOS, UEFI, GRUB Learn Shell
03 Hello World as a Bootloader (in asm + C) Build RISC-V Assembly, C
04 Privilege Modes, Traps, and System Calls Learn C, RISC-V Assembly
05 Processes — fork, exec, wait Learn C
06 Threads, TLS, Context Switching Learn C
07 Scheduling — FCFS, RR, MLFQ, CFS, EDF Learn C, Rust
08 Virtual Memory in the OS — Demand Paging Learn C
09 Page Replacement — LRU, Clock, ARC Learn C, Rust
10 The Kernel Heap — slab and slub allocators Learn C
11 File Systems I — VFS, inodes, journaling Learn C
12 File Systems II — ext4, btrfs, ZFS deep cuts Learn Markdown
13 I/O Architecture — Block, Char, syscalls, vfs Learn C
14 Synchronization in the Kernel — Spinlocks, RCU Learn C
15 Deadlock — Detection, Prevention, Avoidance Learn C, Python
16 IPC — Pipes, FIFOs, Shared Memory, sockets Learn C
17 Signals — Delivery, Handling, Pitfalls Learn C
18 Devices and Drivers — Char, Block, Net Learn C
19 Containers — namespaces, cgroups, seccomp Learn C, Shell
20 Virtualization — Type 1/2 Hypervisors, KVM Learn C
21 Microkernels and Unikernels Learn Markdown
22 Real-Time and Embedded OS Learn C
23 Linux Internals Tour — The Source Tree Learn Markdown, Shell
24 Phase Capstone — 'nanos': A Bootable Mini-Kernel Build C, RISC-V Assembly

Phase capstone artifact: “nanos”: a bootable mini-kernel.  ·  ~30 h 15 min total.

Phase 8: Compilers & Programming Language Design 22 lessons   Lex, parse, type-check, optimize, codegen — and then bootstrap.
# Lesson Type Lang
01 The Compilation Pipeline — End to End Learn Markdown
02 Lexing I — Regex → DFA → Lexer Learn Rust, Python
03 Lexing II — Hand-Written Scanners Learn Rust, C
04 Parsing I — Recursive Descent Learn Rust
05 Parsing II — LL(1), Predictive Tables Learn Python
06 Parsing III — LR, SLR, LALR, GLR Learn Python
07 PEG Parsers and Packrat Learn Rust
08 Parser Generators (yacc/bison/lalrpop/tree-sitter) Learn Rust
09 AST Design and Visitor Patterns Learn Rust
10 Semantic Analysis — Symbol Tables, Scopes Learn Rust
11 Type Checking — Mono, Sub, Inference (HM) Learn Haskell, Rust
12 Intermediate Representation — Three-Address Code Learn Rust
13 SSA Form — Construction and Dominance Learn Rust
14 Classic Optimizations — DCE, CSE, Inlining, LICM Learn Rust
15 Loop Optimization & Vectorization Learn Rust, C
16 Register Allocation — Linear Scan vs Graph Coloring Learn Rust
17 Code Generation — Instruction Selection, Scheduling Learn Rust, RISC-V Assembly
18 Linkers and Loaders Learn C, Shell
19 Garbage Collection — Mark-Sweep, Copying, Generational Learn Rust
20 JIT Compilation — V8, JVM, LuaJIT principles Learn Rust
21 LLVM in Practice — IR, Passes, Backends Learn C++, Shell
22 Phase Capstone — A Self-Hosting Compiler Build Rust

Phase capstone artifact: A self-hosting compiler for a Pascal-ish language.  ·  ~29 h 0 min total.

Phase 9: Computer Networks 22 lessons   Build the stack: Ethernet, IP, TCP, TLS, HTTP — by hand.
# Lesson Type Lang
01 The Stack — Why Layers (OSI vs TCP/IP) Learn Markdown
02 Physical & Link Layers — Ethernet, MAC, ARP Learn C, Python
03 Network Layer — IPv4, IPv6, Subnetting, CIDR Learn Python, C
04 Routing I — Static, Distance Vector Learn Python
05 Routing II — Link State (OSPF), BGP Learn Python
06 NAT, ICMP, DHCP, IPAM Learn Python
07 Transport — UDP, TCP State Machine Learn C, Rust
08 TCP Congestion Control — Reno, CUBIC, BBR Learn Python, C
09 QUIC and HTTP/3 Learn Rust
10 Sockets API — Build a TCP Echo Server Learn C, Rust
11 Build a userspace TCP/IP stack (toy) Build Rust, C
12 DNS — Resolvers, Records, DNSSEC Learn Python, C
13 HTTP/1.1, HTTP/2 — Wire Format and Multiplexing Learn Rust, Python
14 TLS in the Network Course (Handshake Overview) Learn Python
15 WebSockets, SSE, gRPC Learn Rust, TypeScript
16 Firewalls, NAT Traversal, STUN/TURN/ICE Learn Python
17 CDNs and Anycast Learn Markdown
18 Load Balancers — L4 vs L7, Algorithms Learn Rust, Python
19 P2P Networks — Kademlia, BitTorrent Learn Rust, Python
20 Software-Defined Networking & eBPF Learn C, Python
21 Network Programming in Rust (async + tokio) Learn Rust
22 Phase Capstone — An HTTP/2 Server on a Custom TCP Stack Build Rust

Phase capstone artifact: An HTTP/2 server on a custom userspace TCP/IP stack.  ·  ~27 h 15 min total.

Phase 10: Databases & Storage Systems 22 lessons   From relational algebra to MVCC: write the storage engine, write the planner.
# Lesson Type Lang
01 What a Database Actually Is Learn Markdown
02 The Relational Model & Relational Algebra Learn Python, SQL
03 SQL — DDL, DML, Joins, Subqueries Learn SQL
04 Normalization 1NF → BCNF (and 4NF) Learn SQL, Python
05 Physical Storage — Pages, Slotted Pages Learn Rust, C
06 Buffer Pool Management & Replacement Learn Rust
07 Indexing — B+ Trees in DBs Learn Rust
08 Indexing — Hash, Bitmap, GiST Learn Rust, Python
09 LSM-Tree Storage Engines (LevelDB/RocksDB style) Learn Rust
10 Query Execution — Iterator vs Vectorized Learn Rust, Python
11 Join Algorithms — Nested Loop, Hash, Sort-Merge Learn Rust, Python
12 Query Optimization — Plans, Cost, Cardinality Learn Python, SQL
13 Transactions — ACID, Anomalies Learn SQL, Python
14 Isolation Levels — Read Committed → Serializable Learn SQL, Python
15 Concurrency Control — 2PL, OCC, MVCC Learn Rust, Python
16 Recovery — WAL, ARIES Learn Rust
17 NoSQL — KV, Document, Wide-Column, Graph Learn Python
18 Distributed DBs — Sharding, Replication, Spanner Learn Markdown, Go
19 Columnar Storage & OLAP — Parquet, DuckDB Learn Python, SQL
20 Vector Databases — HNSW, IVF, PQ Learn Rust, Python
21 Time-Series and Event-Sourced Stores Learn Python, SQL
22 Phase Capstone — Build an MVCC KV Store with a SQL Frontend Build Rust, SQL

Phase capstone artifact: An MVCC KV store with a SQL frontend.  ·  ~29 h 0 min total.

Phase 11: Distributed Systems 22 lessons   Clocks, consensus, replication, CRDTs — and a Raft you can break and watch heal.
# Lesson Type Lang
01 What Distribution Costs You Learn Markdown
02 Failure Models — Crash, Omission, Byzantine Learn Markdown
03 Time — Physical, Logical, Lamport Clocks Learn Go, Python
04 Vector Clocks and Causal Order Learn Go, Python
05 The FLP Impossibility Result Learn Markdown, Python
06 CAP and PACELC — Read Honestly Learn Markdown
07 Consensus I — Paxos (Single-Decree) Learn Go, TLA+
08 Consensus II — Multi-Paxos and Variants Learn Go
09 Consensus III — Raft (with a working implementation) Build Go, Rust
10 Replication — Leader/Follower, Quorum Learn Go
11 Eventual Consistency & Read-Repair Learn Go, Python
12 CRDTs — Counters, Sets, Sequences Learn Rust, TypeScript
13 Gossip Protocols & SWIM Learn Go
14 Distributed Transactions — 2PC, 3PC, Sagas Learn Go, Python
15 Distributed File Systems — GFS, HDFS Learn Markdown, Python
16 MapReduce, Spark, Dataflow Learn Python, Scala
17 Service Discovery, Membership, Leader Election Learn Go
18 Distributed Caches — Memcached, Redis, consistent hashing Learn Go, Python
19 Message Queues & Streams — Kafka, NATS Learn Go, Python
20 Microservices vs Monolith — Real Trade-offs Learn Markdown
21 Observability — Metrics, Traces, Logs in Distributed Systems Learn Go, TypeScript
22 Phase Capstone — A Raft-Replicated KV Store with Snapshotting Build Go, Rust

Phase capstone artifact: A Raft-replicated KV store with snapshotting.  ·  ~28 h 0 min total.

Phase 12: Cryptography & Security 24 lessons   Build the primitives, then the protocols, then the attacks that bypass both.
# Lesson Type Lang
01 What Cryptography Actually Promises Learn Markdown
02 Classical Ciphers and Why They Fail Learn Python
03 Symmetric I — Stream Ciphers and One-Time Pad Learn Python, Rust
04 Symmetric II — Block Ciphers, AES Internals Learn C, Rust
05 Modes of Operation — ECB, CBC, CTR, GCM Learn Python, Rust
06 Hash Functions — SHA-2, SHA-3, BLAKE Learn C, Rust
07 MACs and HMAC Learn Python, Rust
08 Authenticated Encryption (AEAD) Learn Rust
09 Public Key I — Diffie-Hellman Learn Python, Rust
10 Public Key II — RSA Internals & Padding Learn Python, Rust
11 Public Key III — Elliptic Curves & Ed25519 Learn Rust, Python
12 Digital Signatures — ECDSA, EdDSA, BLS Learn Rust
13 KDFs, PBKDF2, scrypt, Argon2 Learn Rust, Python
14 TLS 1.3 — Handshake, Records, 0-RTT Learn Rust
15 Build a Toy TLS 1.3 Client Build Rust
16 PKI, Certs, Transparency Learn Markdown, Python
17 Zero-Knowledge Proofs — Sigma, zk-SNARK overview Learn Python, Rust
18 Post-Quantum — Kyber, Dilithium, SPHINCS+ Learn Rust
19 Side-Channels — Timing, Cache, Spectre/Meltdown Learn C
20 Memory-Safety Attacks — Stack Smash, ROP, ASLR Learn C, RISC-V Assembly
21 Web Security — XSS, CSRF, SQLi, SSRF, deserialization Learn TypeScript, Python
22 Threat Modeling — STRIDE, DREAD, attack trees Learn Markdown
23 CTF Toolkit — pwntools, GDB, Ghidra Learn Python, Shell
24 Phase Capstone — A TLS 1.3 Library + a Mini-CTF Build Rust, Python

Phase capstone artifact: A TLS 1.3 implementation plus a mini-CTF toolkit.  ·  ~30 h 45 min total.

Phase 13: Concurrent & Parallel Computing 22 lessons   Get atomic, lock-free, async, and GPU all right — with a memory model in your head.
# Lesson Type Lang
01 Concurrency vs Parallelism — Get This Right Learn Markdown
02 Race Conditions, Atomicity, Visibility Learn C, Rust
03 Memory Models — Sequential Consistency vs Relaxed Learn C++, Rust
04 Locks — Mutex, RW Lock, Spinlock, Ticket Lock Learn C, Rust
05 Condition Variables and Monitors Learn C, Rust
06 Semaphores and the Classics (Producer/Consumer, Dining) Learn C, Go
07 Atomics, CAS, ABA Problem Learn Rust, C++
08 Lock-Free Data Structures — Treiber Stack, MS Queue Learn Rust, C++
09 Wait-Free Algorithms and Their Limits Learn Rust
10 Software Transactional Memory Learn Haskell, Rust
11 Futures, Promises, async/await Learn Rust, TypeScript
12 Reactor and Proactor Patterns — epoll, kqueue, io_uring Learn C, Rust
13 Tokio and the Async Runtime in Rust Learn Rust
14 CSP and Go Channels Learn Go
15 The Actor Model — Erlang and Akka principles Learn Erlang, Rust
16 Parallel Patterns — Map, Reduce, Pipeline, Scan Learn Rust, Python
17 Work-Stealing Schedulers Learn Rust
18 SIMD Programming in Practice Learn C++, Rust
19 GPU Programming — CUDA Basics Learn CUDA C++
20 GPU Programming — WebGPU / Compute Shaders Learn WGSL, TypeScript
21 MPI and Distributed-Memory Parallelism Learn C, Python
22 Phase Capstone — A Work-Stealing Scheduler + Lock-Free Queue Build Rust

Phase capstone artifact: A work-stealing scheduler plus a lock-free queue.  ·  ~28 h 0 min total.

Phase 14: Computer Graphics & Visualization 18 lessons   Rasterize. Ray-trace. Path-trace. Make pixels meaningful.
# Lesson Type Lang
01 Pixels, Colors, Gamma Learn Python
02 The Graphics Pipeline at 30,000 ft Learn Markdown
03 Linear Algebra for Graphics — Transforms, Projections Learn Python, Rust
04 Rasterization I — Lines and Triangles Learn Rust, C++
05 Rasterization II — Z-buffer, Clipping, Culling Learn Rust, C++
06 Shading Models — Lambert, Phong, Blinn-Phong Learn GLSL, Rust
07 Physically Based Rendering — BRDF, Microfacet Learn GLSL, Rust
08 Shaders 101 — Vertex and Fragment Learn GLSL, WGSL
09 Build a Software Rasterizer (in Rust) Build Rust
10 Ray Tracing I — Whitted Style Learn Rust, C++
11 Ray Tracing II — Path Tracing, Monte Carlo Learn Rust
12 Acceleration Structures — BVH, kd-Tree Learn Rust
13 Real-Time Techniques — Deferred, Tiled, Cluster Learn GLSL, Rust
14 Modern APIs — Vulkan, Metal, WebGPU compared Learn Markdown
15 Compute Shaders for Non-Graphics Work Learn WGSL, CUDA C++
16 Animation, Skinning, IK Learn Rust
17 Visualization — D3, deck.gl, scientific plotting Learn TypeScript, Python
18 Phase Capstone — A Path Tracer + a Triangle Rasterizer Build Rust

Phase capstone artifact: A path tracer plus a triangle rasterizer.  ·  ~23 h 15 min total.

Phase 15: Systems Programming & Performance 20 lessons   Measure honestly. Tune cache, branches, IO. Win 10x by knowing the machine.
# Lesson Type Lang
01 How to Think About Performance Learn Markdown
02 Measurement Discipline — Benchmarks That Don't Lie Learn Rust, C++
03 Profiling — perf, dtrace, Instruments, eBPF Learn Shell, C
04 Flamegraphs, Hotspots, and Reading Stacks Learn Shell
05 Cache-Aware Algorithm Design Learn C++, Rust
06 False Sharing and NUMA Learn C++, Rust
07 Branch Prediction and Layout Tricks Learn C++
08 Vectorization in Practice (auto and intrinsics) Learn C++, Rust
09 Memory Allocators in Production — jemalloc, mimalloc Learn C
10 Zero-Copy and mmap Learn C
11 Asynchronous I/O — io_uring Deep Dive Learn C, Rust
12 Kernel Bypass — DPDK, SPDK, AF_XDP Learn C
13 Lock Contention Patterns and Cures Learn Rust, C++
14 Coroutines and Stackful vs Stackless Concurrency Learn C++, Rust
15 C++ Low-Latency Idioms Learn C++
16 Rust for High Performance — UnsafeCell, MaybeUninit, alignment Learn Rust
17 Power, Frequency Scaling, Thermal Throttling Learn Markdown
18 Reliability Engineering — Tail Latency, Hedging Learn Go, Rust
19 Capacity Planning and Little's Law Learn Python
20 Phase Capstone — A Profile-Guided Optimization Walk-Through Build Rust, C++

Phase capstone artifact: A profile-guided optimization walk-through.  ·  ~24 h 15 min total.

Phase 16: Software Engineering & Architecture 24 lessons   Make code other people can read, change, and ship — at scale, over years.
# Lesson Type Lang
01 What Makes Software 'Engineered' Learn Markdown
02 Naming, Cohesion, Coupling Learn TypeScript, Python
03 SOLID Principles — Demystified Learn TypeScript, Python
04 GoF Patterns That Still Matter Learn TypeScript, Python
05 Modern Patterns — Functional Core / Imperative Shell Learn TypeScript, Rust
06 Refactoring Catalogue and Mechanics Learn TypeScript, Python
07 Code Review Practice Learn Markdown
08 Domain-Driven Design — Bounded Contexts, Aggregates Learn TypeScript, Python
09 Hexagonal / Clean Architecture Learn TypeScript
10 Event-Driven Architectures Learn TypeScript, Go
11 CQRS and Event Sourcing Learn TypeScript, Rust
12 Microservices — When and When Not Learn Markdown
13 API Design — REST, GraphQL, gRPC Trade-offs Learn TypeScript, Protobuf
14 Versioning, Deprecation, Compatibility Learn Markdown
15 Monorepos vs Polyrepos Learn Markdown
16 Dependency Management & SemVer Learn Markdown, Shell
17 Build & CI/CD — Pipelines That Don't Suck Learn YAML, Shell
18 Observability as a Design Concern Learn TypeScript, Go
19 Technical Debt — Measure, Pay Down, Negotiate Learn Markdown
20 Architecture Decision Records (ADRs) Learn Markdown
21 Reading Large Codebases Learn Markdown, Shell
22 Phase Capstone — Refactor a Real OSS Repo + ADR Bundle Build TypeScript, Markdown
23 Human-Computer Interaction Design Principles Learn TypeScript, Python
24 Software Project Management and Estimation Learn Markdown

Phase capstone artifact: A refactored real-world OSS repo with ADRs.  ·  ~23 h 30 min total.

Phase 17: Testing, Verification & Formal Methods 18 lessons   Move from unit tests to fuzzers to TLA+ to Coq. Know what each one actually proves.
# Lesson Type Lang
01 Why We Test (and what tests don't prove) Learn Markdown
02 Unit, Integration, E2E — Pyramid vs Trophy Learn TypeScript, Python
03 Test Doubles — Stubs, Mocks, Fakes, Spies Learn TypeScript, Python
04 Property-Based Testing — QuickCheck, Hypothesis Learn Haskell, Python
05 Fuzz Testing — libFuzzer, AFL++, structured fuzzing Learn C, Rust
06 Mutation Testing Learn Python, TypeScript
07 Coverage — What It Tells You and What It Doesn't Learn Python
08 Contracts and Design by Contract Learn Python, Rust
09 Hoare Logic — Pre/Post/Invariant Learn Python
10 Separation Logic Primer Learn Markdown
11 Model Checking — TLA+ Hands-On Learn TLA+
12 TLA+ for Distributed Protocols Learn TLA+
13 Alloy and Lightweight Modeling Learn Alloy
14 SMT Solvers — Z3 in Practice Learn Python
15 Symbolic Execution — KLEE, angr Learn Python, C
16 Proof Assistants — Coq/Lean/Isabelle Primer Learn Coq
17 Verified Software — seL4, CompCert, etc. Learn Markdown
18 Phase Capstone — Specify, Model-Check, and Prove a Lock-Free Algorithm Build TLA+, Rust

Phase capstone artifact: TLA+ models plus a fuzzer plus a property suite.  ·  ~23 h 0 min total.

Phase 18: Programming Language Paradigms & Type Theory 15 lessons   Lambda calculus to dependent types to algebraic effects — see why your favorite language behaves the way it does.
# Lesson Type Lang
01 What 'Paradigm' Means (and Doesn't) Learn Markdown
02 Lambda Calculus — Reduction, Encodings Learn Haskell, Python
03 Simply Typed Lambda Calculus Learn Haskell
04 Polymorphism — System F, ML, Bounded Quantification Learn Haskell
05 Type Inference — Hindley-Milner Reconstruction Learn Haskell, Rust
06 Subtyping, Variance, Higher-Kinded Types Learn Haskell, TypeScript
07 Dependent Types — A Tour Learn Idris, Haskell
08 Linear and Affine Types — Rust's Lineage Learn Rust, Haskell
09 Algebraic Effects vs Monads Learn Haskell
10 Functional Programming Deep — Haskell Idioms Learn Haskell
11 OOP Deep — Inheritance, Composition, Mixins, Traits Learn TypeScript, Rust
12 Logic Programming — Prolog and Unification Learn Prolog
13 Dataflow and Reactive — RxJS, FRP Learn TypeScript
14 DSL Design — Internal and External Learn Rust, TypeScript
15 Phase Capstone — A Bidirectional Type-Checker for STLC + Extensions Build Haskell, Rust

Phase capstone artifact: A bidirectional type-checker for STLC with extensions.  ·  ~19 h 0 min total.

Phase 19: Capstone Projects 18 lessons   Multi-week builds. Each ships a real working artifact. Pick a track.
# Lesson Type Lang
01 Build a Compiler for a Pascal-like Language Build Rust
02 Build a Kernel That Boots, Schedules, Pages Build C, RISC-V Assembly
03 Build a Distributed KV Store (Raft + MVCC) Build Go, Rust
04 Build a SQL Database with B+-Tree Index Build Rust, SQL
05 Build a User-Space TCP/IP Stack Build Rust, C
06 Build a Path Tracer with BVH Build Rust
07 Build a Chess Engine with Search & Eval Build Rust, C++
08 Build a Search Engine (Crawler + Index + Ranker) Build Rust, Python
09 Build a Container Runtime Build Go, C
10 Build a Toy ML Framework (autodiff, optimizers) Build Python, Rust
11 Build a TLS 1.3 Client + Server Build Rust
12 Build a Distributed Build System (Bazel-style cache) Build Go, Rust
13 Build a Toy Browser (HTML/CSS layout + render) Build Rust, TypeScript
14 Build a Static Analyzer for C with Abstract Interpretation Build Rust, OCaml
15 Build a Verified Sorting Library in Coq/Lean Build Coq
16 Build a Quantum Circuit Simulator Build Python, Rust
17 Build a GPU Rasterizer in WebGPU Build WGSL, TypeScript
18 Open Capstone — Learner-Defined, Mentor-Reviewed Build Markdown

Phase capstone artifact: A learner-chosen ambitious build.  ·  ~219 h 0 min total.

Phase overview (quick scan)

# Phase Lessons Time Phase capstone artifact
00 Setup & Tooling 12 ~14 h Reproducible polyglot toolchain
01 Discrete Math & Logic Foundations 24 ~25 h Proof companion CLI
02 Programming Foundations & Memory Model 18 ~20 h Tiny manual-memory library
03 Data Structures 25 ~30 h Generic DS library in Rust
04 Algorithms & Complexity Analysis 31 ~37 h Algorithms cookbook + benchmark harness
05 Theory of Computation 18 ~20 h Regex engine + Turing machine simulator
06 Digital Logic & Computer Architecture 22 ~28 h 5-stage pipelined RISC-V CPU in HDL
07 Operating Systems 24 ~30 h nanos — a bootable mini-kernel
08 Compilers & Programming Language Design 22 ~29 h Self-hosting compiler
09 Computer Networks 22 ~27 h HTTP/2 server on a custom TCP/IP stack
10 Databases & Storage Systems 22 ~29 h MVCC KV store with SQL frontend
11 Distributed Systems 22 ~28 h Raft-replicated KV store
12 Cryptography & Security 24 ~30 h TLS 1.3 library + mini-CTF
13 Concurrent & Parallel Computing 22 ~28 h Work-stealing scheduler + lock-free queue
14 Computer Graphics & Visualization 18 ~23 h Path tracer + triangle rasterizer
15 Systems Programming & Performance 20 ~24 h Profile-guided optimization walk-through
16 Software Engineering & Architecture 24 ~25 h Refactored OSS repo with ADRs
17 Testing, Verification & Formal Methods 18 ~23 h TLA+ models + fuzzer + property suite
18 Programming Language Paradigms & Type Theory 15 ~19 h Bidirectional type-checker for STLC
19 Capstone Projects 18 ~219 h Learner-chosen ambitious build

Full per-lesson schedule with status glyphs is in ROADMAP.md.

░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒

Quick start

git clone <this repo>
cd course-computer-science

# Verify scaffolding is complete (re-runs are idempotent)
python3 scripts/scaffold_course.py

# Build the static site (catalog + lesson pages)
node site/build.js

Then open phases/00-setup-and-tooling/01-the-cs-toolchain-what-you-ll-install-and-why/docs/en.md and follow the spine.

License

MIT. See LICENSE.

░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒

About

Build computer science from scratch — 421 lessons across 20 phases. Bootloader, B-tree, TCP stack, type-checker, Raft, and more, in C/C++/Rust/Go/Python/Haskell/SQL/RISC-V/TLA+. Free, open source, MIT.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages