Grokking Algorithms: The Book That Made Big-O Click for Me
The views I express here are mine alone and do not necessarily reflect the opinions or official position of my employer.
I didn't take the traditional path into this field. No CS degree, no algorithms course, no professor drawing a binary tree on a whiteboard while I took notes. I learned SQL and data pipelines by doing the work, which covers a lot of ground, but it leaves gaps, and data structures and algorithms was mine. I could write a working query or script, but the moment a code review comment mentioned Big-O, I'd nod along and quietly go look it up later.
I put "Grokking Algorithms" on my company's training budget mostly out of guilt about that gap, expecting a dense CS-textbook slog. It's the opposite. Every concept gets a cartoon-style illustration before it gets a formal explanation, and that ordering matters more than it sounds like it should.
What actually made it click
Binary search is the example that sold me on the whole approach. I'd read the definition before: split the search space in half each step instead of scanning linearly. I could recite it. I didn't feel it until the book walked through searching a phone book by repeatedly tearing it in half, drawn out step by step, the remaining pages shrinking each time. Watching the search space visibly collapse from thousands of pages to one in about ten steps is what made O(log n) stop being a formula I'd memorized and start being something I understood.
BFS was the second one. The book walks through it as a literal queue, first-in-first-out, expanding outward one layer at a time from a starting node, which is exactly why it's guaranteed to find the shortest path in an unweighted graph, it explores everything one step away before it ever considers anything two steps away. Seeing that queue drawn frame by frame made the "why" of BFS obvious in a way that reading pseudocode never had for me.
I'd recommend this book before I'd recommend a leetcode grind. Grinding practice problems teaches you to recognize a pattern and produce a solution. It doesn't automatically teach you why that solution is O(1) instead of O(n), or why a different-looking problem is secretly the same shape underneath. Understanding the "why" first meant that when I did eventually start working through practice problems, I was reasoning about the actual tradeoff, not pattern-matching against a memorized answer.
Who this is actually for
If you came into software or data engineering the way I did, self-taught, on the job, through bootcamps, career-changed, this is the book I'd hand you first. It's also solid for anyone who took a CS algorithms course years ago and has let the intuition go rusty; the visual approach rebuilds it fast.
It's not for everyone. If you already have a strong CS background, most of this will feel introductory, and it's not built as a reference you'll come back to for something advanced like dynamic programming on graphs or amortized analysis of complex data structures. It's a primer that builds intuition, and it doesn't pretend to be that reference.
Big-O Stopped Being Vocabulary and Became a Question
The real lesson had nothing to do with any single algorithm. I'd been treating Big-O as vocabulary to memorize, not a question to actually answer for myself: what happens to the work as the input grows. Once that clicked for search and traversal, it started showing up in places I hadn't expected, in how I think about query plans, in how I estimate whether a script will hold up against a bigger dataset next quarter.
I've got the follow-up in this series, "Grokking Relational Database Design," sitting on my shelf next. Different but related domain for me, same bet that a good illustration beats a formal definition on the first pass. More on that one soon.