What is the test pyramid and how do you apply it in practice?
- test pyramid
- test strategy
- test distribution
Answer it first, then compare. Nothing here is saved or scored.
Model answer
The test pyramid suggests: many fast unit tests at the base, fewer integration tests in the middle, and few slow E2E tests at the top. In practice: developers own unit tests, QA focuses on integration and E2E tests for critical flows. The anti-pattern is the "ice cream cone", too many E2E tests that are slow and flaky. Apply it pragmatically: if your app is API-heavy, invest more in API integration tests. If it's UI-heavy, visual regression tests may be more valuable than unit tests.
What interviewers listen for
- Risk-based prioritisationYou can defend skipping coverage on a path because the risk maths supports it.
- Test design fluencyYou apply equivalence partitioning and decision tables to concrete inputs in real time.
- Metric judgmentYou distinguish between metrics that drive learning and metrics that drive theatre.
- Strategy under constraintYou can produce a defensible plan when the team has half the time and twice the scope.