How would you decide what to test, and at which layer, when planning the test strategy for a new payment-checkout feature?
technical-conceptual · Mid level · software-engineering
What the interviewer is really asking
Assesses whether the candidate can build a risk-driven, layered test strategy that targets coverage where defects and impact concentrate, rather than testing everything uniformly.
What to say
- Start from risk, not from features: rank flows by likelihood of failure times business impact. A checkout's charge and order-creation path is high-impact, so it earns the deepest coverage; a cosmetic settings toggle does not.
- Place each test at the cheapest layer that can catch the bug. Pin domain logic (tax, discount math) in fast unit tests, verify service-to-service contracts and the DB write in integration tests, and reserve a small set of end-to-end tests for the one or two critical user journeys like 'add to cart through successful payment'.
- Define the exit criteria up front: which acceptance scenarios must pass, the coverage and severity bar for release, and what you explicitly are NOT testing in this iteration so scope is a decision, not an accident.
What to avoid
- Say you'd aim for 100% coverage of everything, treating all flows as equally important.
- Push every check up to slow, flaky end-to-end UI tests because they feel the most 'realistic'.
- Present the strategy as a fixed test count with no reference to risk, impact, or exit criteria.
Example answers
Strong: For a checkout feature I ranked flows by risk and impact: the charge-and-create-order path was tier 1, so I covered discount and tax math in unit tests, the payment-provider call and order write in integration tests against a sandbox, and kept just two E2E journeys (successful purchase, declined card). Lower-risk flows like changing a saved address got integration coverage only. I wrote down the release bar — all tier-1 scenarios green, zero open sev-1 — before we started.
Weak: I'd write tests for every screen and field in the feature so we have full coverage, and run them all through the UI to be safe.