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.

HardTechnical
42 practiced

For large-scale performance and load testing, argue when using mocked components is acceptable and when you need real dependencies. Propose a hybrid plan that mixes mocked and real services to measure system capacity and find bottlenecks, while keeping test cost and time reasonable and avoiding conclusions that a fully mocked run could not support.

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