Code Review Beyond Correctness

“It compiles and the tests pass” is the floor, not the bar. What else are you reading a diff for?

Student edition · understand, apply, verify

Review intent, correctness, maintainability, and operational/security risk with a proportionate attention budget.

What you should be able to do: Explain a blocking concern through a concrete failure and separate it from preferences.

A context-dependent practice guide, not a universal policy or verified personal history. Examples and numbers are illustrative. Use genuine, authorized evidence; personnel/privacy/legal decisions follow applicable organization policies and qualified review.

Concepts explained in this guide

Read these definitions first, or use the linked terms as you go. The examples and limitations are local to this guide; companion pages are optional.

Preconditions and postconditions

A precondition states required inputs/state before an operation. A postcondition states the result promised when those requirements hold and execution terminates normally. Together they make requirements testable.

Example. For sum_first(b,n), require integer 0≤n≤len(b) and numeric elements; promise the sum of b[0:n].

Boundary. State exceptions, mutation, numeric domains, and empty cases. A mathematical array range does not automatically validate a runtime input.

Decision records and reversible experiments

Record the problem, options, evidence, constraints, owner, chosen tradeoff, and reconsideration trigger. A reversible test reduces uncertainty before large commitment.

Example. Try one tenant with success/abort metrics and a data-safe rollback plan.

Boundary. Timeboxing does not bypass compliance/safety. Reversible means effects and data can actually recover, not merely that a flag exists.

SBI feedback and observable behavior

Situation–Behavior–Impact frames feedback around context, observed action, and its effect. Ask for perspective and agree a concrete change.

Example. 'In Tuesday's review, you interrupted two explanations; we missed rollback discussion. What was happening, and how can we finish those discussions next time?'

Boundary. Avoid diagnosing intent/personality. High-stakes performance action requires fair evidence, policy/HR guidance, privacy, and relevant accommodations.

Outputs, outcomes, and measurement

Outputs are produced things; outcomes are changes for users/business/team. Useful metrics state definition, denominator, population, period, and attribution limits.

Example. 'Shipped a tool' is output. 'Median onboarding fell ten to six days in this cohort' is an outcome with sample/context caveats.

Boundary. Before/after does not prove sole causation. Avoid gaming, selection bias, hidden costs, and unlike-team comparisons.

Ownership, accountability, and decision rights

Ownership names who drives follow-through; accountability names who answers for outcomes. Decision rights specify who chooses/approves and who is consulted.

Example. A migration has a coordinating owner, service owners, and named release authority.

Boundary. DRI/RACI/DACI are local conventions, not guarantees. Role labels do not replace authority, capacity, and follow-through.

This is the opening question of any code-review screen for a senior engineer, and it separates the people who treat review as a pass/fail gate from the people who treat it as the highest-leverage quality and mentorship tool a team has. The interviewer wants to hear that when you open a diff, “does it work” is the first thing you check and the least interesting. Everything that determines whether this code is still a good decision in two years — the design, the readability, the tests, whether anyone but the author understands it, the security and privacy exposure, whether it can be operated at 2 AM — is what an experienced reviewer actually spends attention on. Get this answer right and you set the frame for the whole loop.

Flow of what to look for in review beyond correctness: correctness, design, readability, tests, shared context, security/privacy, operability, automate style
The spine of the answer: correctness is step one, then design, readability, tests, shared context, security/privacy, and operability — while style gets automated away rather than argued line by line.

What this question is really testing

Whether you have a layered mental model of review and the judgment to spend your (and the author's) limited attention on what matters. Junior engineers review line by line for bugs and style. Senior engineers review the change against its intent, the system it lands in, and the humans who will maintain it. The tell is whether you name the axes beyond correctness and the discipline to push the mechanical ones into tooling so humans review substance.

How to answer What the interviewer is looking for
Concrete example — the diff that “worked.” An engineer sends a diff that adds a new enrichment step to an ad-event ingestion path. It's correct, it has a unit test, CI is green. A line-by-line reviewer approves it. A senior reviewer asks four different questions: Design — why a synchronous call to the enrichment service on the hot path instead of joining against the already-loaded dimension table? Tests — there's a happy-path test, but what happens when enrichment times out; is the event dropped, retried, or emitted un-enriched? Operability — there's no metric or log for the new failure mode, so an on-call would be blind. Privacy — the enrichment payload now carries a user identifier into a log line at DEBUG. Same diff; the difference is entirely in what the reviewer chose to look at.

Common follow-ups

How do you decide how deep to go on a given diff?

How to answer

Isn't a lot of this the author's job, not the reviewer's?

How to answer

What do you deliberately not comment on?

How to answer

How does AI-assisted review change this?

How to answer
Evidence to collect with your approved tools

Worked example: green CI but an untested failure boundary

This is an illustrative situation. The point is the reasoning and evidence, not copying the numbers or first-person story.

green CI but an untested failure boundaryUnderstand the change: A new enrichment call is added to a hot event path; successful unit tests do not establish timeout/replay behavior.. State the invariant: Accepted events must have a documented durable/dedup path, and fallback behavior must be explicit.. Request evidence: Ask for failure tests, dependency deadlines, authorized telemetry, and an explanation of the chosen synchronous boundary.. Prioritize comments: Label invariant/security violations as blocking under the agreed policy; label style/preferences optional. Correctness remains central, not something to move past quickly.1Understand the change2State the invariant3Request evidence4Prioritize comments
Sequence for this example. The table explains the evidence and decision at each step.
StepEvidence, decision, and expected result
Understand the changeA new enrichment call is added to a hot event path; successful unit tests do not establish timeout/replay behavior.
State the invariantAccepted events must have a documented durable/dedup path, and fallback behavior must be explicit.
Request evidenceAsk for failure tests, dependency deadlines, authorized telemetry, and an explanation of the chosen synchronous boundary.
Prioritize commentsLabel invariant/security violations as blocking under the agreed policy; label style/preferences optional. Correctness remains central, not something to move past quickly.
Check your understanding: Does green CI prove the change is correct?

No. Tests/type checks cover selected properties; review still reasons about contracts, coverage, context, and failure behavior.

Practice with your own situation

Choose one relevant real situation. Write its context, constraints, your role, considered alternatives, chosen actions, measured result, uncertainty, and follow-up. Explain one tradeoff and what evidence would change your decision.

Use genuine, safe-to-share evidence. Example numbers here illustrate reasoning; they are not claims about your work or a guaranteed outcome.

Sources and further verification
⌂