Stanford CS 106B: Programming Abstractions
CS 106B follows 106A with programming abstractions in C++: recursion, ADTs and the standard collections, big-O, linked structures, trees, and hashing. It's the course where Stanford CS gets real, and like 106A its materials are public and heavily used by self-learners.
Fennie is independent and not affiliated with Stanford University. This is an unofficial study guide.
What makes it hard
Two simultaneous jumps: a stricter language (C++ after Python) and a stricter way of thinking (recursion and pointer-based structures). Recursive backtracking is the famous wall. Students who pattern-matched through 106A meet problems that can't be solved without an actual mental model of the call stack. Assignments are long, and the quarter does not pause for the recursion unit.
What you'll cover
- • C++ fundamentals after Python
- • Abstract data types and collections
- • Recursion and recursive backtracking
- • Big-O and algorithmic analysis
- • Pointers and linked structures
- • Trees, heaps, and hashing
The CS 106B study guide
How to study for Stanford CS 106B, step by step.
- 1
Close the C++ gap in the first two weeks
The early weeks are your only slack for language friction. Drill C++ syntax, references, and the collection classes until the language stops costing you attention you need for the concepts.
- 2
Give recursion the inductive mental model
Trust the recursive call to handle the smaller case while you reason about one frame. Students who try to trace every call of every backtracking example burn out; the inductive leap is the course's real checkpoint.
- 3
Start assignments the day they're released
106B assignments are long and debugging recursive or pointer code takes calendar days. The gap between day-one starters and deadline coders is most of the grade distribution.
- 4
Draw every linked-structure operation
For each insert, delete, and traversal, diagram what every pointer references before and after. Exams test these operations on paper, where the debugger can't save you.
- 5
Trace code by hand weekly
Predicting output for recursive and pointer-based code you didn't write is half of every exam. It's a trainable mechanical skill. Train it before exam week.
Today
Today's CS 106B plan
What a Fennie Daily Plan looks like for CS 106B. Yours is built from your own syllabus and adapts every day to your deadlines and progress.
First plan free, no card required. Fennie is independent and unaffiliated with your school.
FAQ
Is CS 106B harder than CS 106A?
Yes, and by design: C++ replaces Python, recursion replaces straightforward control flow, and the assignments roughly double in depth. Students call the recursive backtracking unit the moment the course separates pattern-matchers from problem-solvers.
Can I self-study CS 106B online?
The lectures, assignments, and section handouts are publicly available and widely used by self-learners after 106A or an equivalent. The content transfers fully. What self-learners lack is the deadline structure, which is worth recreating deliberately.
How much time does CS 106B take per week?
Budget 15-20 hours in assignment-heavy weeks. The five units are honest: lectures, section, readings, and assignments that grow through the quarter, with recursion and linked-structure assignments reliably taking longer than students expect.
More Stanford courses
CS 106A: Programming Methodology
CS 106A is Stanford's famous introduction to programming, taught in Python. It covers control flow, functions, decomposition, lists, dictionaries, and graphics, and assumes zero prior experience. Its lectures and assignments are public, and through Code in Place it has been taught free to hundreds of thousands of people, so it's studied worldwide by enrolled students and self-learners alike.
CS 107: Computer Organization and Systems
CS 107 takes students from C++ down to the machine: C programming, pointers and memory, bit-level representation, x86-64 assembly, and how the heap actually works, culminating in the famous heap allocator assignment. It's the systems gateway of the Stanford CS core.
CS 103: Mathematical Foundations of Computing
CS 103 is Stanford's discrete math and theory gateway: proof techniques, set theory, induction, graph basics, then finite automata, regular languages, and the first look at computability and P vs NP. For most students it's the first course where the deliverable is a proof, not a program.
CS 109: Probability for Computer Scientists
CS 109 is probability built for CS: counting, conditional probability, random variables and distributions, the central limit theorem, then maximum likelihood and the first real machine learning algorithms. It bridges the core sequence to CS 221 and CS 229 and is many students' favorite course in the major.