QA Interview Hub · Knowledge base · Quizzes · Українська

System Design › How to answer a System Design interview

Answer structure: requirements, layers, solution, trade-offs, metrics

A System Design answer is built from five steps: requirements, layers, solution, trade-offs and metrics. Requirements fix numbers and limits, layers split the task into blocks, the solution meets the requirements, trade-offs name the price of a choice, and metrics show that it works. The scheme is scaffolding, not a script: after trade-offs you can return to requirements, and go deep into a layer if the interviewer leads there.

System design · How to answer

You have 40 minutes and a whiteboard. How not to drown in the details of the first layer?

In a System Design round the bigger danger is not ignorance but chaos: the candidate spends half an hour on the structure of a page object and never reaches data, CI and metrics. The interviewer is left with no signals on most topics. To avoid this you need a five-step reference scheme. It is the same for a test framework and for a backend task, and this lesson explains why each step exists and why the order is what it is.

How it works and why. Five steps: requirements, layers, solution, trade-offs, metrics. The order is not random: each step gives what the next one cannot do without.

Five steps and what each gives

1. Requirementsnumbers and limits for all that follows2. Layersblocks you can discuss one by one3. Solutionwhat exactly and why in each layer4. Trade-offsthe price of the choices: level shows here5. Metricshow to check that it works
Figure 1. Each step uses the output of the previous one. The fourth is highlighted: it is the one most often skipped.

Requirements give the numbers and limits: what the system must do (functional) and how much, how fast, for whom (non-functional: the number of tests, teams, environments, the time target, external dependencies). Without them the «solution» has nothing to be checked against. Layers split a big task into blocks you can discuss one by one: for a framework the tests, business steps, page objects and API clients, fixtures, configuration, reporting; for a backend the client, load balancer, services, stores, queues. Solution for each layer: what exactly you do and which problem from the requirements it closes. Trade-offs appear only here, because a compromise exists once something is chosen: speed against isolation, infrastructure cost against feedback time, realistic data against stability. Metrics close the loop: they turn «I think it works» into «here is the number that shows it».

A time guide for 40-60 minutes: requirements 5-10, layers 5, solutions and trade-offs the main part, metrics 5. It is not a rule: if the interviewer is interested in one layer, they will pull the conversation there. A useful habit: after each block, summarise in two sentences and ask whether to go deeper. That manages the time and shows how you work with a stakeholder.

Example: the task «2000 e2e in 15 minutes». The condition: nightly runs take hours, the team needs feedback on a PR within 15 minutes. Start with requirements and calculate whether the target is reachable at all and what parallelism it needs.

Assumption: 2000 tests, ~20 s each, target 15 min.

Sequentially: 2000 x 20 s = 40,000 s  (~11 h)
Target:       15 x 60 = 900 s
Minimum parallel slots: 40,000 / 900 = ~45
With a margin for browser start, uneven shards,
retries: ~60-65 slots (an estimate, to be measured)

This calculation already does the job of two steps. It gives a requirement (≥ 45 slots, and with a margin about 60) and immediately suggests questions for «solution»: shards or workers, what it costs, whether there is enough data and environments for that many parallel runs. The structure then goes:

  • Layers. Tests and API clients, data fixtures, environment configuration, running in CI, the report.
  • Solution. Tests are independent (their own data through the API), the run is split into shards by execution time rather than by file count; unstable tests go in a separate list.
  • Trade-offs. More slots cut the time but raise the cost and the load on a shared environment; isolated data is slower than shared; a fast PR set is simpler than the full one.
  • Metrics. Time to feedback on a PR (by percentile, not the mean), the share of unstable tests, setup time, escaped defects.

A decision for one layer: data

Typical

A decision without a price

«Data: we create it through the API before each test». Why this way and what it costs is not said.

Better

A decision with a price and a metric

«Each test creates its own data through the API: tests are independent and can run in parallel. The price: extra requests and setup time. I measure the share of time spent on setup».

Figure 2. The difference is not in length: the second answer is tied to the requirements and can be checked.

Limits and alternatives. The scheme is scaffolding, not a script. It is not necessarily linear: after the trade-offs the requirements may change («if this is twice as expensive, is 15 minutes critical?»), and going a step back is normal. For a backend task it is sometimes more useful to draw the request flow first and clarify requirements along the way. For a test framework other approaches are no worse: analysing «what hurts now» (a diagnosis rather than building from scratch) also fits the five steps well. But once you drop a step, nobody will return the signals you skipped.

Common mistakes.

  • Skipping requirements and drawing at once: calculations are not tied to numbers, decisions are random.
  • Staying in one layer (usually the page object or fixtures): the interviewer gets no signals about data, CI and metrics.
  • Naming a solution without its price: it sounds like a list of practices, not a choice.
  • Picking a metric that cannot be measured now: «quality» or «stability» with no definition. Better: the share of tests that fail and pass on a rerun with no code change.
  • Following the scheme mechanically: treating an interviewer who steers elsewhere as someone breaking the order.

Check yourself

For 2000 tests of 20 seconds each the target is 15 minutes. How many parallel slots are needed at minimum, and why are more needed in practice?

Answer

2000 x 20 s = 40,000 s, the target is 900 s, so at least 40,000 / 900, about 45 slots. In practice more, because the browser and environment start, shards are uneven in duration, and unstable tests are retried. So about 60-65 with a margin, but that is an estimate to be measured on a real run.

Why do trade-offs come after the solutions rather than together with the requirements?

Answer

A compromise arises once something is chosen: isolated data at the price of time, more workers at the price of money. While there are no solutions there is no price to discuss. Requirements fix what matters, and the cost of each choice is compared against them.

In an interview. Junior: I answer by a scheme: I clarify requirements, split the system into layers, propose a solution for each, say what we pay for it and finish with success metrics. Middle/Senior: Requirements come with numbers, because they can be calculated: 2000 tests of 20 seconds in 15 minutes is at least about 45 parallel slots. I name trade-offs after each solution: speed against isolation, runner cost against feedback time. I choose metrics that can be measured now: time to feedback on a PR by percentile, the share of tests that fail and pass on a rerun, setup time. I keep the scheme flexible: after the trade-offs I can go back to the requirements, and I go into a particular layer if the interviewer leads there.

More articles in this chapter