MilkCrunch

Preparing for Advent of Code: A Python Techniques Roadmap

· by Michael Doornbos · 776 words

Advent of Code just wrapped up, and I’ve been taking notes. This year marked a change: after ten years of 25-day marathons, Eric Wastl trimmed it to 12 days. Looks like this is the format going forward—more sustainable for everyone involved.

But I’m not here to talk about the puzzles themselves. I’ve been tracking the techniques that kept coming up. The patterns that separate “I solved it” from “I solved it in under a second.”

If you’re a beginner Python programmer thinking about tackling AoC next year, this guide maps out what you need to learn. I’ve written detailed articles on each topic—this page is your starting point.

Why Python? It’s concise, readable, and has excellent built-in data structures. The standard library covers most of what you need without hunting for packages. But any language works—people solve AoC in Rust, Go, JavaScript, TypeScript, C, C++, Java, Kotlin, Ruby, Haskell, Clojure, Elixir, Zig, Lua, Perl, even assembly. I solved Day 3 this year on a Commodore 64 in BASIC—it took 449 minutes. I’m not here to judge your choices. Most of these techniques apply universally; the syntax will just look different.

Commodore 64 solving Advent of Code Day 3 in 449 minutes
Day 3 on Commodore 64

How to Approach AoC Problems

Before diving into techniques, let’s talk strategy. Every AoC problem follows a pattern: read the story (which is often deliberately verbose), extract the actual requirements, parse the input, solve part 1, then solve part 2 (which usually adds a twist that breaks naive solutions).

Don’t start coding immediately. Read the problem twice. Work through the example by hand. Make sure you understand what’s being asked before you write a single line. I’ve wasted more time implementing the wrong solution than I’ve ever spent thinking through the problem first.

Part 2 is designed to break brute force. If your part 1 solution runs in O(n²) and part 2 increases n by a factor of a million, you need a better algorithm, not a faster computer. When you see part 2, ask yourself: “What assumption from part 1 no longer holds?”

The Learning Path

Here’s the priority order for preparing for AoC 2026:

Foundation (Master These First)

Part 1: Foundation Skills covers the essentials you’ll use in every single puzzle:

Core Skills (Learn These Next)

Part 2: Core Skills covers the techniques that solve the majority of puzzles:

Advanced Techniques (For Harder Problems)

Part 3: Advanced Techniques covers the algorithms you need when the basics aren’t enough:

The Real Lesson

Here’s what I’ve learned from years of Advent of Code: the puzzles aren’t really about clever algorithms. They’re about recognizing which technique fits the problem.

Day 1 looks like simulation but it’s really modular arithmetic. Day 7 looks like set operations but part 2 needs counting. Day 12 looks impossible until you recognize it’s backtracking.

The techniques in these guides aren’t exotic. They’re fundamental. String parsing, grid traversal, recursion, memoization, sets, dictionaries. Learn them well enough that reaching for the right tool becomes automatic.

Next December, when you’re staring at a puzzle at midnight, you won’t be thinking about algorithms. You’ll be thinking “this is a grid problem with connected components” and your fingers will already be typing the Union-Find class.

That’s the goal. That’s what practice gives you.


The complete series:

And when December rolls around, head to adventofcode.com for the puzzles.

<< Previous Post

|

Next Post >>