Computer Science lessons & courses
69 lessons · 16 learning paths · free, quiz-checked, no signup required
The foundations beneath the stack: how computers represent data, schedule work, and move bits. Timeless material that outlives any particular framework.
Learning paths
Browse all 16 pathsSearch Relevance: From BM25 to Hybrid
Vector search did not replace keyword search; production search runs both, because they fail in opposite places. This path builds relevance engineering from the ground up: the inverted index and the analysis decisions baked into it, BM25 and its saturation arithmetic, hybrid retrieval with reciprocal rank fusion, and the evaluation machinery, judgment sets, NDCG, position bias, that tells you whether any of it actually got better.
Formal Verification: Proving a Program Correct
Testing samples inputs; a proof covers all of them. Three traditions do this and each hits a different wall. Deductive proof turns a program into a relation between assertions, and stalls at the loop invariant no machine can supply. Type-level encoding makes wrong programs unwritable, and pays with a language that rejects some correct ones. Model checking searches every state exhaustively, and is bounded by how many there are. The path ends with two systems that were actually verified, and what they cost.
Floating Point: Why Your Numbers Are Wrong
Every floating point operation is correctly rounded to about sixteen digits, and results are still wrong in the first digit. This path explains how both are true: the guarantee is per-operation and relative, which means subtracting nearly equal numbers promotes error from insignificant to dominant without introducing any. It covers the representation, the cancellation patterns worth recognising, how to compare and test, and finally how to tell whether an inaccurate answer is your bug or the problem's nature.
Probabilistic Data Structures: Answers Without the Data
Answering set questions exactly costs memory proportional to the data, and that is a lower bound rather than an inefficiency. Sketches give up exactness in a specific, chosen direction and get constant memory in return. This path builds the three that run modern infrastructure: Bloom filters for membership, HyperLogLog for distinct counts in twelve kilobytes, and count-min for frequency. It ends on the property that actually explains their ubiquity, which is not the space saving.
Computer Graphics: Rasterisation and Ray Tracing
Every renderer answers one question first: at this pixel, which surface is visible? There are two ways to answer it, and almost everything else about a graphics system follows from which one it picked. This path builds the transform chain, then rasterisation as a distributed sort with a depth buffer, then ray tracing as a search through a spatial hierarchy. The last lesson explains why the two coexist, and lets you predict which effects will be cheap, which will be faked, and what the artefacts will look like.
The Limits of Computation: What No Program Can Do
Some things are not slow to compute, they are impossible, and the boundary is sharp enough to prove in a few lines. This path climbs the ladder of machines one memory model at a time: finite states and the counting argument that defeats them, then a stack, then an unbounded tape. At the top the limit stops being about memory and becomes the halting problem, generalised by Rice to every semantic property at once. The last lesson spends that result on why every type checker and verifier must choose which way to be wrong.
All Computer Science lessons
Which Technique Applies, and How to Tell
A procedure for deciding between greedy, dynamic programming, and neither. Write the recurrence, count the states, attempt the greedy proof, and read the failure. Includes the instance where greedy is optimal and off by a third depending on one word in the problem statement.
Greedy: Proving a Local Choice Is Globally Right
A greedy algorithm is three lines of code and a proof. This lesson covers the proof techniques that make it an algorithm rather than a heuristic: the exchange argument, greedy-stays-ahead, Huffman's merge, and the matroid theorem that says exactly when greedy is guaranteed.
Designing a Dynamic Program: State, Transition, Order
Writing a dynamic program is three decisions, not a recurrence to memorise. This lesson works through choosing the state, deriving the running time from it, fixing the evaluation order, recovering the answer rather than its value, and why an O(nW) knapsack is not polynomial.
Optimal Substructure: The Property Both Techniques Need
Dynamic programming and greedy algorithms both rest on a structural property the problem either has or does not have. This lesson establishes it precisely, shows a problem that lacks it, and separates the three properties that decide which technique applies.
Inverse Rendering in Practice
What differentiable rendering is actually used for, how it relates to NeRF and Gaussian splatting, and the four failure modes that make inverse rendering harder than the optimisation loop suggests.
Making Differentiable Rendering Affordable
Correct gradients are useless if computing them exhausts memory. Radiative backpropagation, path replay backpropagation's constant-memory trick, and why differentiable renderers needed their own compiler.
The Discontinuity Problem
Differentiating a renderer is easy until geometry moves. Why silhouettes break naive automatic differentiation, and the three families of solutions: edge sampling, reparameterization, and warped-area methods.
Rendering as an Integral
Before you can differentiate a renderer you have to see it as mathematics: the rendering equation, why it has no closed-form solution, and how Monte Carlo path tracing turns light transport into an estimation problem.
Tries and Radix Trees: Structures Keyed by Prefix
A trie stores keys in their spelling rather than hashing them, which buys the one query a hash table cannot answer: find everything starting with this. This lesson covers the trie, the memory problem that makes it impractical, and the radix compression that fixes it and routes the internet.
Heaps and Priority Queues: Keeping Only the Top
A heap is the structure for when you need the smallest item repeatedly but never need the whole set sorted. This lesson builds the binary heap as an array, derives why building one costs linear rather than n log n time, and shows the top-k pattern that makes it worth knowing.
Balanced Search Trees: Why Rotations Exist
A binary search tree is elegant until sorted input turns it into a linked list. This lesson explains how balance is enforced: the rotation as the one legal repair, what red-black and AVL trees each guarantee, and why databases use B-trees with hundreds of children instead.
Hash Tables: Collisions, Load Factor, and Swiss Tables
A hash table promises constant-time lookup, and the promise holds only because of how it handles collisions. This lesson builds one from the array up: hashing, chaining versus open addressing, why load factor is the tuning dial, and how modern tables scan sixteen slots at once.
Why Most Code Is Memory Bound: The Roofline Model
Most real code never approaches a processor's arithmetic peak because it cannot be fed fast enough. The roofline model makes that concrete: plot operational intensity against achievable performance and the binding constraint becomes visible. This lesson covers the model, bandwidth versus latency, and the layout changes that follow.
The Cache Hierarchy and Why Locality Decides Speed
DRAM is roughly two orders of magnitude further away than a register, so processors interpose several levels of cache. This lesson covers measured latencies at each level, cache lines and associativity, the three kinds of miss, and why identical algorithms differ tenfold based on access order alone.
Superscalar and Out-of-Order Execution
Modern cores issue several instructions per cycle and execute them in whatever order their inputs become ready, while still appearing to run the program strictly in order. This lesson covers register renaming, the reorder buffer, the scheduler, and why the instruction window exists at all.
CPU Pipelines: Throughput, Hazards, and Stalls
A processor does not execute one instruction at a time. It overlaps them in a pipeline, which raises throughput without making any single instruction faster. This lesson covers pipeline stages, the three classes of hazard, forwarding, the load-use stall, and why a mispredicted branch is expensive.
Lossy Compression and the Rate-Distortion Tradeoff
Lossy compression is not lossless compression done badly. It is a deliberate trade of fidelity for rate, governed by a curve Shannon derived in 1959. This lesson covers rate-distortion theory, transform coding and the DCT, where JPEG actually discards information, perceptual coding in audio, motion compensation in video, and learned codecs.
Channel Capacity and Error-Correcting Codes
Shannon proved that a noisy channel still has a rate at which errors vanish. This lesson works a Hamming code by hand, follows Reed-Solomon into CDs, QR codes and deep space, reaches the capacity-approaching codes inside 5G, and ends on erasure coding versus replication in distributed storage.
Source Coding: Huffman, Arithmetic Coding and ANS
Entropy is a hard floor on lossless compression, and this lesson shows how coders approach it. Build a Huffman tree by hand, see exactly where it wastes bits on skewed sources, then follow the fix through arithmetic coding to asymmetric numeral systems, the entropy stage inside Zstandard.
Entropy: Measuring Information in Bits
Shannon's entropy measures the average surprise of a source, in bits, and it sets a hard floor on compression. Build it up from surprisal through joint and conditional entropy, mutual information, KL divergence and cross-entropy, with every number worked out by hand.
DNS, HTTP, and the Move to QUIC
Before a byte of HTTP moves, a name has to become an address. Follow the full resolution path from stub resolver to authoritative server, see how TTLs govern change, then trace head-of-line blocking from HTTP/1.1 through HTTP/2's TCP problem to HTTP/3 running on QUIC over UDP.
TCP: Reliability, Windows, and Congestion
TCP turns a lossy packet service into an ordered byte stream, and almost every performance surprise on the internet comes from how it does that. Work through the handshake, cumulative ACKs, retransmission timers, the two windows, slow start and AIMD, CUBIC versus BBR, bufferbloat, and when to reach for UDP instead.
IP Addressing and How Routing Decides
IP is the only layer the whole internet agrees on. Work through IPv4 and IPv6 addressing, CIDR subnet math by hand, what a routing table really holds, longest-prefix match, why NAT ended end-to-end addressing, and how one BGP announcement can pull a network off the internet.
Layers, Frames, and the Wire
A packet is a stack of nested envelopes, and the bottom layer has rules of its own. Work through encapsulation, Ethernet frames, MAC learning inside a switch, ARP, and MTU, then diagnose the classic failure where small requests succeed and large ones hang forever.

