JuniorTroubleshooting

A developer says the build passes locally but fails in CI. How do you debug that?

What they are really testing: Whether you have a systematic approach to environment differences instead of guessing. They also want to see whether you treat the CI environment as knowable rather than magical.

A real interview question

A developer says the build passes locally but fails in CI. How do you debug that?

What most people say

drag me

I would rerun the pipeline and see if it passes.

It treats the failure as random. Sometimes a rerun does pass, which is worse: it hides a flaky test or a race and trains the team to click retry instead of fixing the cause.

The follow-ups they ask next

  • It passes on retry roughly half the time. What is your response?

    That is a flaky test and it is a defect, not noise. Quarantine it so it stops blocking, then fix the underlying race or ordering dependency. Silent retries destroy trust in the suite.

  • How do you prevent this class of problem generally?

    Run the build inside the same container image everywhere, commit lockfiles and install from them exactly, and keep dev environment setup in code rather than a README.

What the interviewer is listening for

  • Reads the error before theorising
  • Enumerates differences systematically
  • Fixes the class, not the instance

What sinks the answer

  • Reaches for retry first
  • Treats flaky tests as normal
  • No way to reproduce the CI environment

If you genuinely do not know

Say this instead of freezing. Reasoning out loud from what you do know beats silence every single time, and a good interviewer is listening for exactly that.

First [read the real error, since it may be a genuine bug]. Then check [dependency versions, env vars, case sensitivity, timezone, memory, network]. Reproduce by [running the CI image locally]. Then [pin or containerise so it cannot recur].

Keep going with troubleshooting

All 87 devops engineer questions

Knowing the answer is not the same as recalling it under pressure

Sign in to send the questions you fumble to spaced recall, so they come back right before you would forget them, and learn the concepts behind them with hands-on labs.

Start free