Skip to main content
VirtualInterview.ai
Technical Interviews

How to prepare for a code review or debugging interview

More companies now test developers by asking them to review a pull request or fix a bug in an unfamiliar codebase. In a code review round, read for intent first, then correctness, then risk, and phrase comments as you would to a colleague.

By VirtualInterview.ai5 min read59 reads
  • technical
  • interview
  • preparation
  • developers

Not every technical interview is an algorithm puzzle. Many teams now hand you a pull request and ask what you would say about it, or open an unfamiliar codebase with a failing test and ask you to fix it. These rounds are closer to the actual job, and they reward different preparation from a list of practice problems.

This post covers those two formats. For the full range of technical rounds and an overall study plan, see the technical interview guide.

What a code review round looks like

You get a diff, usually 50 to 300 lines, sometimes with a short description of what it is supposed to do. You have 30 to 45 minutes to read it and discuss it, either by leaving written comments or by talking through them with the interviewer.

The interviewer is usually checking:

  • whether you understand what the change is trying to do
  • whether you find real problems, not only style nits
  • how you prioritise what you find
  • how you would say it to the author

The last one is easy to forget. A reviewer who is right but harsh is a problem on most teams, and the interviewer is picturing you reviewing their code next month.

Read in three passes

Reading line by line from the top is how people miss the important problems. Use three passes instead.

First, intent. Read the description, the test names and the function signatures. In one sentence, what is this change meant to do? Say it out loud: "So this adds retry logic to the payment client, with a maximum of three attempts."

Second, correctness. Now read the logic. Does it do what it says? Look at boundaries: empty input, the last item in a loop, a null that wasn't expected, an error that is caught and ignored, a resource that is opened and never closed. Check that the tests actually test the new behaviour.

Third, risk. What happens in production? Concurrency, performance on large inputs, security (user input reaching a query or a shell command), backwards compatibility, logging of personal data, a retry that could charge a customer twice.

Style and naming come last, and only if there is time.

Rank what you find and say it like a colleague

When you report back, separate blocking problems from suggestions:

"There's one thing I'd want fixed before merging: if the request times out after the payment provider has already charged the card, the retry charges it again. We'd need an idempotency key. Then two smaller things: the retry count is hard-coded, and there's no test for the timeout case. And a nit, the variable name res2 could be clearer."

Phrase comments as questions or observations, not verdicts:

"What happens here if items is empty? I think items[0] would throw."

That shows the reasoning and leaves room for the author to explain something you missed. Interviewers often plant one thing that looks wrong but isn't, to see whether you ask or accuse.

What a debugging round looks like

You get a codebase you haven't seen, a bug report or a failing test, and 45 to 60 minutes. Sometimes there are several bugs of increasing difficulty. You usually work in a real editor with the ability to run the code.

The interviewer is watching your process more than the fix. Candidates who guess and change things at random often find the bug eventually and still score poorly.

A debugging routine to narrate

  1. Reproduce it. Run the failing test or the steps in the report and confirm you see the same failure. Say what you see.
  2. Read the error properly: the message, the stack trace, the line it points to. Many bugs are named in the first line nobody reads.
  3. Narrow it down. Find the smallest input that fails, or the most recent point where the data is still correct.
  4. Form one hypothesis and test it. "I think the date is being parsed in the wrong time zone. Let me log the value before and after parsing."
  5. Fix the cause, not the symptom, and run the test again. Then say whether anything else could have the same bug.

Narrate as you go, even when it feels slow:

"The test expects 3 and gets 2, so we're dropping an item somewhere. I'll print the list before and after the filter step to see which one disappears."

If you get stuck, say what you have ruled out. "It's not the parser, the value is correct here. So it happens somewhere between this function and the response." That is useful information for the interviewer, and they will often give a hint once they see you are reasoning carefully.

How to practise

These formats are hard to practise from a problem list, but there is plenty of real material:

  • Open-source pull requests. Pick a project in a language you know, open a merged pull request of a few hundred lines, and review it before reading the comments other reviewers left. Then compare.
  • Your own old bugs. Check out the commit before a fix you made months ago, forget the answer, and debug it again while narrating out loud with a timer.
  • Swap with a friend. Each of you plants two bugs in a small project and debugs the other's.

Practise the talking as well as the reading. In both formats, half the score is how clearly you explain what you are doing. An AI mock interview set to a technical round lets you explain a review or a debugging approach out loud and get scored on how clear and complete it was.

Your next step

Pick one merged open-source pull request this week, review it in three passes in 30 minutes, and write your comments ranked as blocking, suggestion and nit.

Enjoyed this article?

Share it with your network or save it for later.

From the editorial desk

VirtualInterview.ai team

Career coaches, HR professionals, and AI specialists.

About us

Get interview tips by email

Get expert advice on interviews, career growth, and AI preparation strategies.

No spam. Unsubscribe anytime.

View all

Technical Interviews

How to Explain a Project You Built in a Technical Interview

Explain your project in about two minutes, starting with the problem it solved and who it was for, not the tools you used. Build the walkthrough around the constraint you faced, your main technical decision and its tradeoff, a setback that forced a change, and the result. Keep a 30-second summary for casual questions and a longer version for "walk me through it." When you can't answer a question, say so plainly and explain how you would find out, rather than bluffing or going silent. Rehearse ou

· 5 min read

Technical Interviews

How to explain your approach out loud in a coding interview

In a coding interview, the interviewer scores your reasoning as much as your code, and they can only score what they hear. Restate the problem, ask about inputs and edge cases, describe a simple approach before coding, say its cost, then narrate decisions while you write. Test out loud with a small example at the end. Practise talking while coding, because it is a separate skill from solving problems.

· 5 min read

Browse by topic