All jobs / Backend developer / Testing
Backend developer interview question · 5+ years
The service’s CI suite fails about one run in five for reasons unrelated to the change, and the team’s habit is to press rerun.
What do you put in place?
The strongest answer
Treat a flake as a defect with an owner and a deadline: quarantine it out of the blocking suite so the signal comes back, track the flake rate, and fix or delete the quarantined tests on a clock
Why it works
Exactly — the failure mode is a quarantine list nobody empties, so the owner and the date are the policy, not the quarantine itself.
What a good answer covers
- A flake is a defect.
- Quarantine to restore the signal.
- Give each one an owner and a date.
- Track the rate, not the excuses.
Answers that fall short
- Close, but not the strongest: Quarantine the flaky tests so the pipeline goes green and the team trusts it again
That restores the signal; without an owner and a date the quarantine becomes where tests go to be forgotten. - Weak: Retry failed tests automatically, so a transient failure does not block anybody
Retries hide the flake and any real intermittent bug it was pointing at, while the rate climbs quietly. - Red flag: Make the test stage non-blocking, so a red suite never stops a release
A non-blocking suite is a suite you have decided not to believe — you now ship with no gate at all.
Who gets asked this
More Testing questions
- A teammate calls their test a unit test, but it starts a database container and an HTTP server. Does the…
- In a test, what is the difference between a stub, a mock and a fake?
- Your repository tests run against an in-memory database and pass, but the same query fails in production…
- How do you test that POST /orders returns 201 with the right body, without deploying anything?
- A refactor that changed no behaviour broke forty tests. Each one asserts that a particular method was called…
- What would consumer-driven contract tests give you here?