Origial Animation in CodePen.io

Google FooBar: Looking Back

Created: Oct 28, 2026

Last modified: Oct 28, 2026

I finished Foobar twice, all five levels each time. After writing a page for every problem, I wanted to close with a look at the whole thing: what came easily, what was a real challenge, where I needed help, and what I'm taking away from it.

# Two runs

Each run draws its problems from a bigger pool, so the second time wasn't a rerun of the first, although a few did come back. The clearest case is Bringing a Gun to a Trainer Fight, which I got both times. That's why level 4 has three pages and level 5 has two, even though each run only hands out two level 4 problems and one level 5 problem.

# Every problem

Here's all of it in one place, with the key idea behind each problem and whether I solved it alone or with help:

Level Problem Key idea How I solved it
1 Braille Translation A translation table
On my own
1 Re-ID Sieve of Eratosthenes
On my own
2 Don't Get Volunteered! Knight paths on the board
On my own
2 Gearing Up for Destruction Algebra: a system solved in O(n)
On my own
2 Ion Flux Relabeling Post-order binary tree
On my own
2 Power Hungry Greedy: pair up negatives, dodge zeros
On my own
3 Doomsday Fuel Absorbing Markov chains
On my own
3 Prepare the Bunnies' Escape Two BFS and one wall
On my own
3 Queue To Do The XOR from 0 to n pattern
On my own
3 The Grandest Staircase Of Them All Dynamic programming: take it or leave it
On my own
4 Bringing a Gun to a Trainer Fight Mirrored rooms and collinear points
On my own
4 Escape Pods Maximum flow with Ford-Fulkerson
With outside help
4 Running with Bunnies Bellman-Ford and trying every order
With outside help
5 Disorderly Escape Burnside's lemma and Pólya's cycle index
With outside help
5 Expanding Nebula Dynamic programming with columns as bitmasks
With outside help
# Where it got hard

I got through the first three levels on my own. Some took more effort than others, but I found a way every time. The jump came at level 4. That's where problems stop being "think a bit, then code" and turn into "if you don't know the technique, brute force won't get you there": maximum flow, shortest paths with negative weights, group theory.

At level 4, the only one I solved on my own was Bringing a Gun to a Trainer Fight, the bouncing laser one. And it happened to be the one I got in both runs. Escape Pods and Running with Bunnies I passed with help, just like both level 5 problems, Disorderly Escape and Expanding Nebula.

# About the help

There's no point hiding it: without the internet and the people who shared their solutions and explanations, I wouldn't have finished all five levels, not once and certainly not twice. Writing these pages is a way of paying that forward: understanding each solution well enough to explain it, and leaving it explained for whoever comes next.

# What I'm taking away

Look at the shape of the problem before coding. The limits in the statement almost always tell you what to do. At most 5 bunnies: try every order. A grid with at most 9 rows: store each column as a number with a few bits. At most 12: walk through its 77 partitions.

Many problems are a classic in disguise. Behind the bunnies and space stations you'll find BFS, Markov chains, maximum flow, Bellman-Ford and dynamic programming. Recognizing the classic is half the work, which is why it pays to know them.

Change the question. Several solutions work because they answer something easier than what was asked. Mirror the room instead of following the bounce. Count what each permutation leaves alone instead of grouping grids. Think of corridors as pipes.

Check against brute force on small cases. A solution that passes the tests isn't always right. While preparing the Running with Bunnies page, comparing it with brute force uncovered a tie-break bug that the statement's examples never showed.

Getting help is fine, as long as you understand it afterwards. With a problem you didn't crack on your own, the valuable part isn't the code but the technique behind it, because that's what carries over to the next one.

# Wrapping up

Foobar was one of the most fun challenges I've taken on as a programmer. If you made it this far, I hope the page for each problem helps you understand the ideas behind it, and that the demos show you what the code can only tell.

An unhandled error has occurred. Reload ๐Ÿ—™