InterviewStack.io LogoInterviewStack.io

Mocking, Stubbing, and Test Isolation Questions

Isolating the unit under test from its dependencies. Covers mocks, stubs, fakes, and spies, when to use test doubles versus real dependencies, and controlling external services and time. Includes designing for isolation so tests are fast, deterministic, and focused.

HardTechnical
59 practiced

Your CI pipeline is unstable because several tests depend on flaky or slow third-party services. Propose a hybrid strategy that decides, dependency by dependency, whether to mock it, virtualize it, or keep a small number of real integration tests. Give criteria for which tests should stay live, and explain how you would know if that mix is drifting the wrong way over time.

That is every published Mocking, Stubbing, and Test Isolation question for Data Engineer so far. Browse the other topics in this category, or practice this one interactively.