Skip to content
Preptima
mediumScenarioCodingEntryMidSenior

The interviewer hands you working production code with a few deliberate changes that break it. You have 45 minutes. What do you do before you read line one?

In a debugging exercise with planted breaks, get a feedback loop before you read closely. Ask what correct behaviour is, whether you can run it and its tests, and what counts as done, then let failing behaviour point you to the code. Small planted changes hide from reading and show up when the code runs.

5 min readUpdated 2026-10-09

Answer

Short answer

Build a feedback loop first. In a debugging exercise with planted breaks, the questions that matter come before any code reading: what is this code supposed to do, can I run it, are there tests, and what counts as finished — finding the breaks, fixing them, or explaining them? Then run it, see what fails, and let the failure lead you to the lines. Planted changes are small and plausible, so they hide from reading and show up in behaviour.

Was this answer helpful?

Likely follow-ups

  • You found two breaks and the interviewer says there are three. Where do you look for the last one?
  • There are no tests and you cannot run the code. What do your first fifteen minutes become?
  • Which of your fixes deserves a regression test, and what exactly would that test assert?
  • In what sense is this exercise manual mutation testing, and what does that predict about the breaks?

Related questions

Related Topics