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

All topics

System Design interview questions and answers for QA

15 System Design questions that come up in QA interviews, with short answers. Open the topic in the knowledge base for a deeper explanation.

How do you structure an answer to a System Design task for QA?

I follow a scheme: requirements, layers, solution, trade-offs, metrics. First I clarify the numbers: how many tests, what the time target is, what environments and external dependencies there are. Then I break the system into layers and for each I say what I do and why. At the end I name what we pay for the solution, and how we will measure success, for example the p95 of pipeline time and the flaky rate.

Read the topic

What questions will you ask first if you are asked to design a test system?

I ask about scale: how many tests there are now and in a year, which test levels exist. Then the time target: feedback on a PR in 10 minutes or a nightly run. Then environments, the number of teams and external dependencies, for example a payment provider. If there are no numbers, I state assumptions out loud so the calculations are transparent.

Read the topic

What is the test pyramid and how does it affect the design of a test system?

The test pyramid is a model for distributing automated tests across levels: many fast unit tests at the bottom, fewer integration and API tests in the middle, and very few slow E2E tests at the top. The higher the level, the slower and costlier the test, the more brittle it is and the harder a failure is to analyse. So when designing a test system I check each rule at the lowest level where it is possible and keep E2E for a few critical scenarios. The anti-pattern is the "ice cream cone", where almost everything is covered by UI tests: the run is long and there are many flaky tests. I prepare data for UI tests through the API.

Read the topic

Tell me what layers your test framework consists of.

On top are the tests, which read like a business scenario. Under them are business steps, Page Objects and typed API clients. Fixtures manage the lifecycle: they create a user with a balance through the API and clean up after the test. Separately there is a config with env validation and a reporting layer. Each layer knows only about the one below, so a UI change is fixed in one place.

Read the topic

How would you design a framework for 2000 e2e tests that must finish in 15 minutes?

First I calculate: 2000 tests of 20 seconds each is about 667 minutes sequentially, so about 60 parallel slots are needed, for example 8 shards of 8 workers. The tests must be fully isolated by data, with fullyParallel and blob reports merged through merge-reports. I create preconditions through the API, log in with storageState, and prepare the image with the browsers in advance. In parallel I review the pyramid, because it is cheaper to move part of the e2e to the API. I measure the p95 of time, the flaky rate and the shard balance.

Read the topic

How do you test an integration with a payment provider whose sandbox is unstable?

For most tests I put in an HTTP stub with controllable responses: success, refusal, a timeout, a duplicate callback. This gives stability and lets me reproduce errors the sandbox can't. A small set of integration tests with the real sandbox goes in a separate job and doesn't block the PR. That way I verify both my own logic and the real integration.

Read the topic

Why is an ephemeral environment better than a shared staging, and what are its downsides?

An ephemeral environment is brought up for each PR and destroyed after merge, so there are no conflicts between teams and the data is clean. The downsides are cost and spin-up time, and bringing up all the microservices is hard. I usually bring up the changed service with its closest dependencies, and take the rest from staging or stubs.

Read the topic

Which tests do you run on a PR, on main and at night?

On a PR: lint, typecheck, unit, API and e2e smoke, so feedback comes in 5-10 minutes. On main: the full API and e2e suite. At night: cross-browser, long scenarios and performance. After deploy: smoke in production. Critical money scenarios, such as a transfer and a refusal on insufficient balance, I always keep in the PR suite.

Read the topic

How do workers and shards differ in Playwright?

Workers are processes on one machine, each with its own browser, and their number is limited by CPU and memory. Shards are a split of the suite between several machines with --shard=1/8. On each shard I write a blob report, and then a separate job merges them with merge-reports. For an even distribution I turn on fullyParallel, otherwise a large file drags one shard.

Read the topic

How do you build a process for fighting flaky tests?

I automatically collect the history of results and mark tests that pass only with a retry. Such a test goes into quarantine: it is taken out of the blocking gate, and gets a ticket with an owner and a deadline. I investigate the cause through the trace and the backend logs by correlation id. I return it to the gate only after many runs, for example --repeat-each=30.

Read the topic

Do retries solve the problem of flaky tests?

No, a retry is insurance and a source of diagnostics, not a solution. On CI I set 1-2 retries and trace: 'on-first-retry', so I have a trace of the rerun, and when I need the trace of the failed run itself I turn on retain-on-failure. But in fintech an unstable debit test may be catching a real race condition, and a retry will hide it. So I analyse every test that passed only on a repeat.

Read the topic

How does observability help you in testing?

I pass my own correlation id from the test and store it in the report annotation. When a test fails, I find the logs and traces in all the services by this id within a minute. After a release I look at error and latency metrics and have synthetic checks in production, for example login and viewing the balance with a test account.

Read the topic

What can go wrong with a cache and how do you test it?

The main risk is stale data: after a transfer the balance in the UI is old, because it is read from the cache. I check that a read after a change returns the new value within the promised time. Separately I test the cache keys, because a key without the user id may show someone else's data. I also check the service's behaviour when the cache is unavailable: it should work more slowly, not fail.

Read the topic

What does at-least-once mean in a queue and what follows from it for testing?

At-least-once means a message won't be lost, but may arrive twice. So the consumer must be idempotent: the event "credit 30" twice must give a single credit. I test duplicates, order violations, a consumer crashing mid-processing, and that an invalid message goes to the DLQ and doesn't block the queue.

Read the topic

How do you test an idempotency key for payments?

I send a repeat with the same key and body and check that the same payment is returned and there is one debit. Then the same key with a different body: I expect an error, not silent ignoring. Separately, two parallel requests with one key: there must be one payment. I also check the behaviour after the key's retention period expires, according to the specification.

Read the topic

Practice System Design with flashcards