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

Explain the differences between smoke tests, regression tests, integration tests, system tests, and user-acceptance tests, and between functional and non-functional testing. For each, describe when it should be executed in a typical CI/CD pipeline and give one concrete example test appropriate for an e-commerce web application.

EasyTechnical
54 practiced

You are adding a small new feature to an existing web app: a per-user settings toggle that changes UI behavior. Which tests would you write first, and why? Specify the concrete unit, integration, and end-to-end tests you would create, which tests could reasonably be postponed or executed manually instead, and how you would weigh risk, regression likelihood, and return on investment in that decision.

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.

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.

EasyTechnical
57 practiced

You are testing a RESTful web application built from a React single-page application, a Node.js REST API, a PostgreSQL database, and an external payment gateway. For each test-pyramid tier (unit, integration, end-to-end), list four concrete example tests you would create, name a common tool or library for each example, and justify why each test belongs at that tier: what it verifies, and what it depends on.

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.