INTERVIEW QUESTIONS

Testing Interview Questions

Practice Testing prompts by theme and build clearer interview answers.

Practice by topicRole and skill lensesClear answer prompts

Showing 52 practice prompts

✦

TESTING

What is the Testing Pyramid and what is the ideal distribution of tests across its layers?

The Testing Pyramid (popularized by Mike Cohn and Martin Fowler) models a balanced testing strategy with three main layers: Unit Tests at the broad base, Integration Tests in the middle, and End-to-End (E2E) UI Tests at the narrow top. Unit tests are fast, cheap, and isolated; integration tests verify component boundaries and communication; and E2E tests validate critical end-user journeys. Maintaining this distribution prevents the slow, fragile, expensive 'testing ice cream cone' anti-pattern.
CompanyGoogle◦ Fundamentals
✦

TESTING

What is the difference between Unit Testing and Integration Testing?

A Unit Test isolates a single function, class, or module in complete isolation from external collaborators, replacing databases, networks, and file systems with test doubles to execute in milliseconds. An Integration Test verifies that multiple modules, subsystems, or external dependencies (like an actual database query or HTTP API endpoint) interact correctly according to contracts.
CompanyMicrosoft◦ Test Types
✦

TESTING

What is End-to-End (E2E) testing and when should it be prioritized?

End-to-End testing exercises the complete software stack from the user interface down through APIs, database persistence, and background jobs in an environment mirroring production. It should be prioritized for core business-critical workflows—such as user registration, payment checkout, and data export—where silent integration failures directly impact revenue.
CompanyAmazon◦ Test Types
✦

TESTING

What are the differences between Mocks, Stubs, Spies, and Fakes?

A Dummy is passed around but never actually used. A Stub provides pre-programmed canned answers to calls made during the test. A Spy wraps an actual implementation and records execution metadata (arguments called, invocation count). A Mock has pre-configured expectations of calls it must receive and fails the test if expectations are violated. A Fake has a working implementation but takes shortcuts not suitable for production (such as an in-memory database).
CompanyMeta◦ Test Doubles
✦

TESTING

What is Test-Driven Development (TDD) and what is the Red-Green-Refactor cycle?

TDD is a software development practice where unit tests are written before implementation code. The cycle consists of: 1. RED: write a failing test specifying the desired behavior, 2. GREEN: write the minimal necessary code to make the test pass, and 3. REFACTOR: clean up code structure, eliminate duplication, and improve maintainability while ensuring all tests stay green.
CompanyApple◦ Methodology
…

Your next interview is closer than you think.

Practice smarter and land better opportunities.

✓ Start with the free plan✓ No credit card✓ Cancel anytime
Start preparing free