Interview frequency: …
Short answer
Isolate time, randomness, and the network, wait for a clear condition using test tools instead of sleep, and clean up resources and test data after each case.
Explanation
A reliable test has a known environment and exposes failure rather than swallowing it. Use the test binding and the waiting tools when needed, and reduce dependence on test order or a shared device state.
Common mistakes
- Adding a longer delay to hide a race condition.
- Leaving a singleton or subscription from one test to affect the next.