Week 0 · before week 1

Week 0: setup

Before week 1, take a week or three to make sure you are ready and set up. This path is hard. That is fine, it is supposed to be. But it should be hard because Knuth is hard, not because you are fighting Java syntax or git at the same time. Take the quiz honestly, fill any gaps with the free resources below, and do the setup checklist.

Setup checklist

Sign up to tick these off; some tick themselves.

  1. Create a GitHub account and sign in with itAutomatic2 steps

    Your work is verified from a public GitHub repo.

    1. Create a free account at github.com.

    2. Sign in here with GitHub, or link it in Settings.

  2. Pick your start date and paceAutomatic3 steps

    Every week is dated from your start.

    1. Pick a start date; a Monday works best.

    2. Pick a pace: about 8 to 12 hours a week at full pace.

    3. Plan around holidays; a realistic start beats a heroic one.

  3. Install a JDK and a C compiler5 steps

    jlox is Java, clox is C. Both toolchains are free.

    1. Install a JDK: Eclipse Temurin 21 (LTS) from adoptium.net.

    2. macOS: run xcode-select --install.

    3. Linux: sudo apt install build-essential.

    4. Windows: install WSL, then build-essential inside Ubuntu.

    5. Check: java -version shows 21+ and cc --version prints a version.

  4. Create your public lox repoAutomatic3 steps

    One repo holds both interpreters; the book's tests run on it.

    1. Use the starter template: name it lox, keep it public.

    2. Clone it, or open it in a Codespace (Java, C and Dart ready).

    3. Push a commit, then connect the repo on the Verify page.

  5. Add the cracked.guide workflow and .cracked.jsonAutomatic3 steps

    The workflow runs the book's tests on every push.

    1. From the starter? It is already there: skip to step 3. Otherwise copy it from the Verify page into .github/workflows/.

    2. Add .cracked.json from the Verify page at the repo root.

    3. Commit, push, and check the Actions tab shows a run.

  6. Set your LeetCode usernameAutomatic3 steps

    Two NeetCode problems a week, checked on your public profile.

    1. Create a free LeetCode account.

    2. Enter your LeetCode username on the Verify page.

    3. 7 problems are Premium-only: solve those free on neetcode.io.

  7. Get the books2 steps

    Crafting Interpreters is free online; TAOCP waits until week 29.

    1. Bookmark craftinginterpreters.com.

    2. Plan how you'll get TAOCP Vol 1: library, used or new.

  8. Get the first game on the Play track2 steps

    TIS-100 starts in week 1; buy the rest as you reach them.

    1. Buy TIS-100 on Steam or GOG ($6.99).

    2. Open the manual PDF that comes with it. Reading it is part of the game.

  9. Put the path in your calendarAutomatic3 steps

    A dated plan works when you see it.

    1. Subscribe to your calendar feed from the schedule page.

    2. Or import the path into Things.

    3. Block the same study slot each week.

  10. Join your cohort and say hi3 steps

    People who study together finish.

    1. Open Introductions in the discussions.

    2. Post a hello with your start date.

    3. Find your cohort's thread and agree to check in.

Tools

OptionalDoesn't count toward your weeks or streak

A side quest, not a requirement. The path assumes you can get around a terminal, an editor and git; if any of these feel shaky, an evening or two here pays for itself all the way through clox.

The Missing Semester of Your CS Education (MIT)Free lectures with notes, videos and exercises, about an hour each. Pick the ones you need; skip the rest.

  • The shell

    Every week you build, run tests and push from a terminal. Moving around, reading a man page and piping one command into another should feel automatic.

    Lecture: Course Overview + Introduction to the Shell

    Try it
    pwd && ls -la
    man ls
    grep -rn "TODO" jlox/ | wc -l
  • tmux and the command-line environment

    Editor in one pane, the test runner in another, and a session that survives closing the terminal or dropping an SSH connection.

    Lecture: Command-line Environment

    Try it
    tmux new -s lox
    Ctrl-b %   split side by side;  Ctrl-b "   split top and bottom
    Ctrl-b d   detach;  tmux attach -t lox   come back
  • Your editor (Vim, or Vim keys in yours)

    You will type two interpreters by hand. Any editor works; knowing one well, with search, multiple files and jump-to-definition, saves hours.

    Lecture: Development Environment and Tools

    Try it
    vimtutor
    VS Code, Zed and JetBrains IDEs all have a Vim mode if you want the keys without leaving them
  • Git

    Your chapters are verified from what you push, and small commits make it easy to find the change that broke a test.

    Lecture: Version Control and Git

    Try it
    git status
    git add -p
    git log --oneline --graph -n 20
    git bisect start   find the commit that broke a test
  • Debugging

    clox is C: a debugger and the sanitizers turn a mysterious crash three chapters later into a line number now. The clox weeks have Tool tips for each when you need them.

    Lecture: Debugging and Profiling

    Try it
    macOS: lldb --version  (comes with the Xcode Command Line Tools: xcode-select --install)
    Linux: gdb --version  (sudo apt install gdb valgrind on Debian and Ubuntu)

Warm-up quiz

Answer in your head, then open the answer. Nothing is recorded.

  1. What does this print? x = 0; for i in 1..4 (inclusive) { x = x + i * i }; print x

    Show answer

    30 (1 + 4 + 9 + 16).

  2. Write a recursive function that returns the n-th Fibonacci number. Why is the naive version slow for n = 50?

    Show answer

    fib(n) = n if n < 2, else fib(n - 1) + fib(n - 2). It is slow because it recomputes the same values exponentially many times; memoize or loop instead.

  3. In Java, what is the difference between an interface and an abstract class, and what does @Override mean?

    Show answer

    An interface declares methods a class promises to implement (a class can implement many); an abstract class can hold state and partial implementations (a class extends only one). @Override marks a method that replaces one from a superclass or interface, and the compiler checks it.

  4. In C, given int a[3] = {1, 2, 3}; int p = a; what is (p + 2), and what does p++ do?

    Show answer

    *(p + 2) is 3. p++ moves p to point at the next int, a[1].

  5. What is wrong with this C function? char *make() { char buf[16]; strcpy(buf, "hi"); return buf; }

    Show answer

    It returns a pointer to a local array that no longer exists once the function returns. Allocate with malloc (and have the caller free it) or have the caller pass in a buffer.

  6. Prove by induction that 1 + 2 + ... + n = n(n + 1)/2.

    Show answer

    Base case n = 1: 1 = 1. Step: assume it holds for n; then 1 + ... + n + (n + 1) = n(n + 1)/2 + (n + 1) = (n + 1)(n + 2)/2, which is the formula for n + 1.

  7. What is log2(1024)? Roughly how many times can you halve 1,000,000 before reaching 1? Is log2(n^2) the same as 2 log2(n)?

    Show answer

    10; about 20 times (2^20 is about a million); yes.

  8. What is 1 + 2 + 4 + ... + 2^k? And what is the sum 1/2 + 1/4 + 1/8 + ... forever?

    Show answer

    2^(k+1) - 1, and 1.

  9. Put these in order of growth: n log n, n^2, log n, 2^n, n. Why is binary search O(log n)?

    Show answer

    log n < n < n log n < n^2 < 2^n. Binary search halves the remaining range each step, so it takes about log2(n) steps.

  10. You changed two files. What commands put those changes on GitHub?

    Show answer

    git add (the files), git commit -m "message", git push. Bonus: git status shows what changed.

On to week 1