MidCI/CD

A test fails about 1 in 5 runs. The team wants to add an automatic retry. What is your view?

What they are really testing: A values question dressed as a technical one. Retries are the easy answer and they corrode the suite, so they want to hear you name the cost and offer a workable alternative.

A real interview question

A test fails about 1 in 5 runs. The team wants to add an automatic retry. What is your view?

What most people say

drag me

Retries are fine, everyone does it, and it keeps the pipeline green.

Green becomes meaningless. A test failing 1 in 5 times may be catching a real race that will appear in production, and a retry converts that signal into silence while the team learns that red does not mean broken.

The follow-ups they ask next

  • Is a retry ever legitimate?

    For genuinely external flakiness you do not control, like a third-party sandbox or network fetch, retry at that boundary specifically. Never a blanket retry across the whole suite.

  • How would you find which tests are flaky at all?

    Record every test result with its run id and compute pass rate per test across runs. Anything below 100% on unchanged code is flaky by definition, ranked by frequency.

What the interviewer is listening for

  • Calls flakiness a defect
  • Offers quarantine as the pragmatic middle
  • Wants flake rate measured

What sinks the answer

  • Accepts blanket retries
  • No plan to find the cause
  • Cannot articulate the cultural cost

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.

A test failing 1 in 5 is [a defect: a bad test or a real race], and a retry [cannot tell them apart, so it may hide a production bug]. I would [quarantine it with an owner and a deadline] instead, fix [shared state, real clocks, fixed sleeps], and [track flake rate per test].

Keep going with ci/cd

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