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
50 practiced

Implement a deterministic test harness for asynchronous code that processes a queue of tasks in the background. Show how you would structure the tests to avoid flakiness by injecting or controlling the scheduler, and assert on the processing order of multiple queued tasks.

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