Invert a Binary Tree: The Max Howell Tweet That Broke Whiteboard Hiring

In June 2015, Max Howell — the creator of Homebrew, the package manager that 90% of Mac developers used to install everything from git to node — interviewed at Google. He did not get the offer. A few weeks later, he posted on Twitter:

“Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard, so f*** off.”

The tweet went massively viral. It got picked up by Hacker News, by tech publications, and by every senior engineer who had ever lost an offer because of a whiteboard misstep. Within a week it had become the most-cited single artifact in the industry-wide argument against whiteboard hiring. Google’s interview process was suddenly on trial in public, and Howell’s tweet became the prosecution’s exhibit A.

What “invert a binary tree” actually means

The problem is straightforward. Given a binary tree, swap the left and right children of every node, recursively. The tree that was a mirror image of itself stays the same; every other tree gets flipped horizontally.

class TreeNode:
    def __init__(self, val=0, left=None, right=None):
        self.val = val
        self.left = left
        self.right = right

def invert_tree(root):
    if root is None:
        return None
    root.left, root.right = invert_tree(root.right), invert_tree(root.left)
    return root

Five lines. The whole problem is a base case (None returns None) and a recursive call where you swap children. The iterative version using a stack or queue is six or seven lines. There is essentially no algorithmic insight required — if you know what a binary tree is and how recursion works, you can write this in under two minutes.

That is exactly what made the rejection sting. Howell was not failing on a hard problem. He was failing on an undergraduate-level data-structures problem, and from his perspective the rejection sent a message that the interview was not really about engineering ability — it was about whether he had memorized a specific corner of CS curriculum recently enough.

Why this question became a flashpoint

The question itself was not the issue. The issue was the gap between Howell’s measurable real-world output (a tool that 90% of Mac developers used daily) and Google’s hiring filter (whether he could perform a particular algorithm on a whiteboard under pressure). For a generation of engineers who had been quietly resentful of whiteboard interviews for years, the Howell tweet crystallized the argument: the interview is not actually measuring engineering ability; it is measuring something else, and that something else is at best loosely correlated with the work.

The counterargument from Google and other companies that ran similar processes was that whiteboard coding tests something real — fluency under pressure, ability to think about data structures cleanly, willingness to engage with abstract problems. That argument is not nothing. But it is a much weaker argument than “this is the only way to evaluate engineers”, which was the implicit position before the Howell tweet.

The industry shift after 2015

The change did not happen overnight, but the trajectory after Howell’s tweet was clear:

  • Take-home assignments became more common. Companies that wanted to test coding ability without the whiteboard performance element shifted to multi-hour or multi-day take-homes. Stripe was an early adopter; many startups followed.
  • Live debugging and pair programming sessions appeared. Some teams replaced the whiteboard round with a “fix this bug in our real codebase” round, on the theory that debugging is more job-relevant than algorithmic puzzles.
  • Collaborative editors replaced whiteboards. By 2018, most companies had moved to CoderPad, CodeSignal, or just a shared Google Doc. The candidate could run their code, autocomplete worked, and the artificial constraint of writing perfect syntax under pressure was relaxed.
  • The “performance” element was de-emphasized. Rubrics started weighting communication and problem-solving over whether the code compiled on the first try.

None of this killed algorithmic interviews. LeetCode-style mediums and hards are still the dominant filter at FAANG. But the framing shifted from “can you perform this on a whiteboard” to “can you solve this problem”, which is a meaningfully different question.

The follow-up controversy

A few years after the original tweet, Howell clarified that the story was a bit more complicated than the tweet suggested. He had received Google interview feedback indicating multiple weaknesses, not just the binary tree problem. The pithy framing of the tweet was, by his own admission, simplified for impact. That clarification did not undo the cultural effect, because by then the tweet had already become a reference point for an argument that was much bigger than any one interview.

This is a recurring pattern with famous interview stories. The story spreads because it is dramatic and clean; the reality is always more nuanced. The cultural artifact is usually the simplified version, and trying to “correct” it after the fact rarely succeeds — by then the simplified version has done its work.

What invert-a-tree actually tests

If you do get asked invert-a-binary-tree in 2026 — which is rare but not unheard of, especially as a warmup — what is the interviewer looking for? The signal is not whether you can solve it; everyone can. The signal is:

  • Do you handle the base case cleanly? The base case is root is None, and forgetting it produces a NoneType error on the first recursive call. A careful candidate writes the base case first, almost reflexively.
  • Do you swap before or after the recursive call? Both work, but the order has consequences for an in-place vs out-of-place implementation. Discussing the difference is good signal.
  • Do you offer the iterative version unprompted? If the recursive version comes out in 30 seconds, a strong candidate will follow up with “I could also do this iteratively with a queue if you want”, which signals that the candidate is thinking about the problem space, not just executing a memorized solution.
  • Do you handle the language semantics? In Python, root.left, root.right = invert(root.right), invert(root.left) works because of tuple-unpacking. In Java or C++, you need a temporary variable. Knowing why this matters is signal.

Is invert-a-binary-tree still asked in 2026?

Almost never as a primary question, occasionally as a warmup. After 2015, asking it directly became almost embarrassing — the interviewer is essentially saying “I am going to ask you the question that became the punchline of the most-cited interview-process critique in the industry”. A few interviewers do it on purpose as a low-pressure opener, but most have moved on to LeetCode mediums for the same time-budget.

The tree-manipulation pattern is alive and well, just under different problem framings. “Find the maximum depth”, “validate a BST”, “find the lowest common ancestor”, and “serialize and deserialize a tree” all use the same recursive-traversal skill that invert-a-tree tests, with enough additional structure that they cannot be one-line solved. If you can invert a binary tree, you have most of what you need for those problems too.

The lasting effect

The Max Howell tweet did not single-handedly end whiteboard hiring. The industry was already shifting; the tweet accelerated and crystallized a change that was underway. But it is the most-cited single artifact in that change, and it earned that status by being the perfect example of the gap between what the interview measured and what the job required. A guy who built the tool that everybody uses got rejected for not knowing a CS-101 algorithm. The story does not need any more nuance than that to do its work — and that is exactly why it became famous.

Frequently Asked Questions

Did Max Howell actually fail because of invert-a-binary-tree?

Howell himself later clarified that his Google interview feedback mentioned several weaknesses, not just the binary-tree problem. The tweet condensed the experience into a single dramatic line, which is what made it viral. The literal claim — that one whiteboard mistake on one problem cost him the offer — is not the most accurate framing of what happened.

What is Homebrew?

Homebrew is the de facto package manager for macOS. It is used by the majority of Mac developers to install command-line tools, language runtimes, and libraries. Howell wrote the original version while at Apple, and as of 2015 it was — and still is — the dominant tool of its kind on macOS.

Can you really write the inversion in five lines?

Yes, in Python. The recursive solution is base case + tuple-unpacking swap + return. In other languages you may need an extra line for the temporary variable, but the algorithm is the same length conceptually.

Did Google change its interview process because of this?

Google made several adjustments to its interview process in the years following 2015 — more emphasis on rubrics, more calibration, more attention to bias. Whether the Howell tweet specifically caused any of those changes is unclear. The shift was happening across the industry, and Google was part of it rather than the originator.

What should I do if I get asked invert-a-binary-tree in an interview?

Solve it cleanly in under two minutes — base case, swap, return — then offer the iterative version and discuss the trade-offs unprompted. The signal is composure plus depth of engagement, not whether you can produce the answer. If you treat it as a warmup, the interviewer will too.

Scroll to Top