Computer Science Base course
From the first line of code to the limits of computation
Python from scratch, data structures and algorithms, the machine from logic gates to the processor, operating systems, networks, databases, languages and compilers, the theory of computation, cryptography. The syllabus follows courses at MIT, Stanford, Berkeley, CMU, Cambridge and Oxford.
66 of 66 chapters written
The course board
Each part is a chip, each chapter one of its pins. The trace runs through every chapter in order; the pins you have read light up.
Introduction
Five surprises and how the course works
Language
Python from scratch: from print to classes, tests and functions as values
Data structures
Complexity, arrays, stacks, hash tables, trees, heaps, graphs
Algorithms
Search and sort, divide and conquer, dynamic programming, greed, graphs, randomness
The machine
From bits and gates to the Iskra-8 processor, caches and pipelines
Operating system
Processes, scheduling, virtual memory, races, storage
Networks
Packets, TCP/IP, the web and distributed systems
Storing and finding
Databases, indexes, compression and a search engine
Languages
Grammars, an interpreter, a compiler for your own machine, types
Limits of computation
Automata, the Turing machine, the undecidable, P and NP
Secrets and attacks
Ciphers, public keys, how systems get broken
Horizons
Games, machine learning, qubits and the blank spots
Eleven big questions
One for every part of the course: each part ends by answering its question. The first answer comes in chapter 7, then roughly every six chapters.
-
1
Part I · Language
Can a program print itself?
To print its own text a program must hold that text inside — so it must be longer than itself. And yet such programs exist. You will take one apart as early as Chapter 7.
Answered in chapter 7 → ✓ You have the answer -
2
Part II · Data structures
Why does one program solve a problem in a second while another wouldn’t finish before the end of the universe?
Same computer, same problem, different ideas — and a gap of thousands of times, sometimes infinite. Can you predict a program’s speed without running it?
Answered in chapter 13 → ✓ You have the answer -
3
Part III · Algorithms
How does a navigation app find the shortest route among millions of roads in a second?
There are more routes through a city than anyone could ever try. Yet your phone lays out the way before you lift your finger off the screen.
Answered in chapter 24 → ✓ You have the answer -
4
Part IV · The machine
How do you get a computer out of switches?
Inside a processor there is nothing but billions of tiny switches. How does “on — off” grow into a machine that runs your program?
Answered in chapter 32 → ✓ You have the answer -
5
Part V · Operating system
How do a hundred programs run on two cores without wrecking each other’s data?
A browser, music, a messenger and hundreds of background processes, and the processor has two or eight cores. Who decides who runs now, and why can’t one program spoil another’s memory?
Answered in chapter 39 → ✓ You have the answer -
6
Part VI · Networks
How do billions of computers work together when none of them is in charge?
The internet has no center, machines fail, messages get lost. And yet the email arrives and the bank does not lose money.
Answered in chapter 44 → ✓ You have the answer -
7
Part VII · Storing and finding
How does a search engine find what you need among billions of pages in a fraction of a second?
Nobody can read the whole web in the blink of an eye. So the answer is ready in advance — but how, if the question has not been asked yet?
Answered in chapter 48 → ✓ You have the answer -
8
Part VIII · Languages
How does one program understand another?
Python is a program too. It reads your text, understands it and runs it. By the end of this part you will write one yourself — for your own computer.
Answered in chapter 52 → ✓ You have the answer -
9
Part IX · Limits of computation
Are there problems no computer can solve?
Not “not yet solved”: never solvable, however much time and memory you give it. The proof fits on a page.
Answered in chapter 56 → ✓ You have the answer -
10
Part X · Secrets and attacks
How do you agree on a secret when every word is overheard?
You and your bank’s server meet for the first time, the whole conversation runs over strangers’ wires — and a second later you share a secret key.
Answered in chapter 60 → ✓ You have the answer -
11
Part XI · Horizons
Can a machine learn what nobody taught it?
Nobody wrote the rules of Go or handwriting into the program. So where does the machine get them from?
Answered in chapter 63 → ✓ You have the answer
Which syllabi
MIT 6‑3, Stanford CS, Berkeley EECS, CMU SCS, Harvard CS50, the Cambridge Computer Science Tripos, Oxford, ETH Zürich, HSE and the ACM/IEEE CS2023 curriculum.