InterviewStack.io LogoInterviewStack.io

Test Levels and the Test Pyramid Questions

How unit, integration, component, end-to-end and contract tests fit together and where each provides the most value. Covers the test pyramid and the competing shapes proposed against it (the testing trophy and the honeycomb), multi-layer test architecture, contract testing as the seam between services, choosing the right level to catch a given class of defect cheaply, and what to run per commit versus per release. Includes the cost and confidence trade-offs between fast low-level tests and slower, broader system tests. The scope is which level a test belongs at and why. Deciding how much to invest in testing and where to prioritize under time pressure is covered separately.

MediumSystem Design
67 practiced

Describe the test pyramid and design a practical testing strategy for a mid-sized microservices product made up of about 20 services. For each layer (unit, integration, contract, and end-to-end), state a target coverage or ratio, who is responsible for it, and how you would implement and enforce the strategy consistently across multiple teams.

EasyTechnical
58 practiced

Explain the test pyramid concept. Describe its tiers (unit, integration, and end-to-end), the primary goal of each tier, and why the pyramid recommends many more low-level tests than high-level tests. For a typical web application, give concrete examples of test types and common tools at each tier (for instance, unit tests for helpers, integration tests for API-to-database interactions, end-to-end tests for a checkout flow), and briefly mention limitations or scenarios where the pyramid shape may not apply.

HardTechnical
73 practiced

Discuss the trade-offs and return on investment between automating end-to-end UI tests versus API-level tests. Consider maintainability, flakiness, speed, coverage, and debugging ease, and how each should be used in release gating versus production monitoring. Conclude with a pragmatic hybrid approach and rules of thumb for deciding which user stories to automate at the UI level versus the API level.

EasyTechnical
58 practiced

Describe integration testing in depth: its purpose, and the common approaches to structuring it (big-bang, incremental, top-down, and bottom-up). Explain how you would decide whether to run integration tests against real third-party services, mocked responses, or recorded traffic, and the practical trade-offs of each choice.

HardTechnical
61 practiced

Compare and contrast the classical test pyramid with the 'testing trophy' concept and other alternative testing models. Explain the trade-offs between them, and give three concrete production scenarios where deviating from a strict pyramid (favoring more integration or end-to-end tests) makes sense. Include the risks each scenario introduces and how you would mitigate them.

Unlock Full Question Bank

Get access to all 24 Test Levels and the Test Pyramid interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.