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.

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.

EasyTechnical
66 practiced

Explain the differences between unit tests, integration tests, and end-to-end tests. For each level, give two concrete examples (functions, modules, services, or UI flows), state when it should run (on a pull request, at merge, or nightly) and its typical execution speed, and discuss the typical maintenance cost and failure modes. Conclude with the concrete trade-offs between speed, coverage, and flakiness for a web application.

EasyTechnical
69 practiced

Given limited CI minutes and a team that wants fast developer feedback, decide which automated tests should run on every commit, which should run nightly, and which should be gated to pre-release or release pipelines. Provide your rationale and give examples at each level of the test pyramid. Then propose an approximate ratio (percentages or counts) of unit, integration, and end-to-end tests for a typical SaaS application, and state target CI run-times per layer on a pull request.

MediumTechnical
60 practiced

You must design the test-level balance for a consumer mobile banking app, where core user flows are critical and regulatory compliance is required. Propose an approximate mix (percentages or relative counts) of unit, integration, and end-to-end tests, and explain your reasoning. Discuss where manual testing is still required, which areas deserve heavier end-to-end automation, and how you would justify that investment's return to product and security stakeholders.

MediumTechnical
53 practiced

Describe the test pyramid and how you would apply it to a modern single-page-application stack (React frontend, Node API, PostgreSQL database). For each layer (unit, integration/component, and end-to-end), give concrete examples of what to test and recommended tooling, propose an approximate test-count ratio across the layers, and describe how you would validate and adjust that ratio over time as the product matures.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.