A Review Routine for AI Diffs

Topics Covered

Why Review Is the Core Skill

Why assistant code needs a different kind of review

What the interviewer is watching

Review is cheaper than debugging

A small example

The routine in brief

A sample exchange

A drill to start with

What review is not

Review and the score

The cost of skipping review once

Review when the code is yours

In an AI-assisted round, the assistant writes much of the code. That changes what the round is measuring. Producing code is no longer the hard part; deciding whether code is right is. Every diff the assistant proposes is a claim that this change does what you asked and nothing else. Your job is to test that claim quickly and reliably, accept it when it holds and reject or fix it when it does not.

This module is the longest in the course, because review is where most rounds are won or lost. The next six lessons each cover one family of mistakes that assistant code makes again and again: boundaries and edge cases, calls to APIs that do not exist, silent behaviour changes, code that passes visible tests but fails hidden ones, missed performance requirements and shared state that gets mutated. This first lesson gives you the routine that ties them together.

With an assistant, writing code is cheap. Reviewing it is the job.

Why assistant code needs a different kind of review

Reviewing a colleague's pull request and reviewing an assistant's diff look similar, but they differ in important ways.

A colleague usually understands the codebase, knows the requirements and has run the code. When their change is wrong, it is usually wrong in a way that makes sense given what they were thinking. An assistant often has partial context: it may see one file, guess the data shape from names and infer requirements from common patterns. Its mistakes come from those gaps, and they can be anywhere.

Assistant code also looks more convincing than it is. It is fluent, well formatted and confidently commented. A comment that says handles the empty case is not evidence that the empty case is handled. Human code with a bug often looks a little uncertain; assistant code with a bug looks exactly like assistant code without one. That is why review cannot rely on how the code feels. It has to rely on a routine that checks specific things every time.

What the interviewer is watching

The interviewer is watching whether you accept code you have not checked. In many published descriptions of these rounds, accepting a plausible diff without reading it is described as one of the clearest negative signals. The opposite, reading a diff, probing it and catching a problem before running it, is one of the clearest positive ones.

The interviewer is also watching how long review takes. A candidate who spends ten minutes on a three line diff is not reviewing well, any more than one who spends no time at all. Good review is fast because it is targeted: it knows where to look.

Review is cheaper than debugging

Every minute spent reviewing a diff before you accept it saves several minutes later. A bug caught in review costs a quick fix or a follow up prompt. The same bug found after three more changes have been built on top of it costs a search through several diffs, and possibly reverting good work. In a timed round, that difference is often the difference between finishing and not.

A small example

Here is a diff an assistant might propose when asked to count events in the last window seconds, given a sorted list of timestamps.

diff
1 def events_in_window(times, now, window):
2-    return sum(1 for t in times if now - window <= t <= now)
3+    # Binary search for the window start; times is sorted.
4+    lo = bisect.bisect_left(times, now - window)
5+    hi = bisect.bisect_right(times, now)
6+    return hi - lo

It looks like a nice improvement: the linear scan becomes two binary searches. Most candidates would accept it. But read it against the requirement. Suppose the README says events count when now minus window is strictly less than t and t is at most now: an event exactly window seconds old has expired. The original code was already wrong on that boundary, and the new code keeps the same mistake, because bisect left at now minus window includes an event exactly at that time. The diff is faster and still wrong at the boundary, and nothing in it looks suspicious.

Catching that needs two things: knowing the exact rule, and checking the boundary on purpose. Neither depends on how good the code looks. That is the routine this lesson builds.

The routine in brief

The routine has five steps. Predict the diff before you see it. Read the diff in four passes: scope, interface, flow and details. Probe it with a few chosen inputs. Run the tests. Then accept, fix or reject, and say which. The rest of this lesson covers each step.

A sample exchange

Interview Dialogue

CandidateBefore I look at the diff, I expect it to change only events in window, replacing the scan with two binary searches.
CandidateScope matches: one function. Signature is the same. The flow is now two searches and a subtraction.
CandidateDetail: bisect left at now minus window includes an event exactly at now minus window. The README says those have expired. So the lower bound should be now minus window plus one for integer times.
InterviewerClick to reveal answer
CandidateRight, so the tests probably do not cover it. I will fix the bound and add a test for an event exactly at the edge.
Show all answers

A drill to start with

Take ten diffs an assistant has produced for you in the past, or ask an assistant for ten small changes to a codebase you know. For each, write down in one sentence what you expected it to change, then review it with the routine, timing yourself. Note how many problems you found and how long each review took. Repeat a week later. Most people find their reviews get both faster and more accurate within a few sessions, because they learn where to look.

What review is not

Review is not rereading the code until it feels right. It is not asking the assistant whether its own code is correct and accepting the answer. It is not running the tests once and moving on. Each of those feels like checking, but none of them tests the claim the diff is making. Feeling, self assessment and a single test run all share the same weakness: they tend to confirm whatever the code already does.

Real review asks targeted questions with checkable answers. Did the scope match? Did the interface change? Does this boundary behave the way the rule says? Each question either passes or fails, and a failure points straight at what to fix.

Review and the score

Most descriptions of AI-assisted rounds name verification and understanding as separate things the interviewer looks for, alongside correctness. Review is where both become visible. Verification shows in the probes and test runs. Understanding shows when you explain why a line is wrong, not just that a test fails. A candidate who finds a bug by running the tests shows verification. A candidate who finds the same bug by reading the comparison and saying which input breaks it shows both.

The cost of skipping review once

It is tempting, late in a round, to skip review on a diff that looks simple. That is usually the diff that costs the most. A small unreviewed change becomes the base for the next three changes, and when a test finally fails, you no longer know which change caused it. One skipped review can cost five minutes of debugging at the worst possible moment. The routine is quick precisely so that you never need to skip it.

Review when the code is yours

The same routine applies to code you typed. Under time pressure, people make the same kinds of mistakes assistants make: a wrong comparison, a forgotten empty case, a mutated input. The difference is that your own code feels right because you meant it to be right. Predicting, probing and running the suite catches those mistakes just as well.

Fluent code is not evidence

Assistant code is well formatted and confidently commented whether it is right or wrong. A comment that says the empty case is handled proves nothing. Review by checking specific things, not by how convincing the code reads.