Verified Jobs Live
Testing Medium Level ~3 min read

A test fails intermittently in CI but passes locally. How would you investigate it?

Interactive Practice Mode
Formulate your thoughts or take notes before revealing the model solution.
Model Answer & Deep-Dive Explanation

Preserve failure logs, random seeds, timing, environment, and artifacts before rerunning. Look for shared state, test-order dependence, real-time assumptions, network calls, resource contention, and unawaited asynchronous work. Reproduce with controlled parallelism or repeated execution while narrowing the cause. Replace arbitrary sleeps with explicit conditions and isolate data or dependencies. Quarantine only with ownership and a repair plan when necessary. Repeating until green hides uncertainty and consumes time; the goal is a deterministic test of real behavior or a clearly documented environmental limit.