PassRidge Flex: new 3-4h/day tasks every week, paid hourly or per project. See open tasks →

Interview Vault · 10 questions

SDET interview questions and answers

10 SDET interview questions with concise model answers: 0 junior, 6 mid-level and 4 senior. Topics: architecture, contracts, data, environments, integration, legacy code. Answer aloud first, then reveal the model answer and compare.

0of 10 practised in this browser
US median $131k369 open roles
Level

10 of 10 questions shown

  1. midTest doublesWhat is the difference between a stub, a mock and a fake?

    Model answer. A stub returns canned answers. A mock records and verifies interactions such as calls and arguments. A fake is a working, simplified implementation, for example an in-memory repository. Over-mocking couples tests to implementation, so prefer fakes and real collaborators where they are cheap.

  2. midIntegrationHow do you test code that calls a third-party payment API?

    Model answer. Unit-test your logic against a stub or fake at the HTTP boundary. Add contract checks against the provider's schema or sandbox, and a few real sandbox smoke tests. Cover failure modes explicitly: timeouts, 5xx responses, duplicate webhooks and idempotency keys.

    Tools: Postman, REST Assured

  3. midContractsWhat problem does consumer-driven contract testing solve?

    Model answer. It catches breaking API changes between services without spinning up the whole system. The consumer states what it needs, the provider verifies those expectations in its own CI, and an incompatible change fails before deployment. It complements functional tests; it does not replace them.

  4. midReliabilityA test passes alone but fails when run with others. What are the usual causes?

    Model answer. Shared mutable state such as static fields, database rows, files or ports; order dependence; time or random-seed dependence; and resource limits. Detect it by randomising order and running in parallel, then fix by isolating state per test with fixtures.

  5. midEnvironmentsHow do you make integration tests reproducible?

    Model answer. Start dependencies in disposable containers (Testcontainers or Compose) with pinned image versions, wait on health checks rather than sleeps, seed known data, and avoid calls to external networks. The same command should work on a laptop and in CI.

    Tools: Docker

  6. midPerformanceHow do you add a performance smoke test to a pull request pipeline without making it noisy?

    Model answer. Run a short k6 script at low load against a stable environment on a dedicated runner and assert on p95 latency and error rate with a tolerance around a stored baseline. Keep heavy load and soak tests nightly. Trend results so slow drift is visible even when each run passes.

    Tools: k6

  7. seniorArchitectureYou must build a test framework used by six teams. What are your key decisions?

    Model answer. A thin, versioned core library for configuration, auth, API clients, data builders and reporting, with teams owning their tests and extending through documented hooks. Ship CI templates, keep defaults opinionated, avoid a custom DSL, and measure adoption and maintenance cost so the framework serves teams instead of constraining them.

  8. seniorLegacy codeHow do you introduce testability into a legacy service with no seams?

    Model answer. Write characterization tests at the outermost boundary to pin current behaviour, then introduce seams (dependency injection, interfaces for clock and I/O) in small steps and refactor under that safety net. Use feature flags for risky changes and add observability hooks so behaviour can be inspected in tests.

  9. seniorDataHow do you test a database migration safely?

    Model answer. Run it on a production-shaped copy with anonymised data and realistic volume, and check duration, locks, row counts and checksums before and after. Design it as expand and contract so old and new application versions can run against the schema at the same time, and rehearse the rollback.

  10. seniorQualityCoverage is 90% yet defects still ship. What do you measure instead or in addition?

    Model answer. Coverage shows code was executed, not verified. Add mutation testing (PIT, Stryker) to see whether tests fail when behaviour changes, review assertion quality on critical modules, and track escaped defects and flake rate. Use coverage only to find untested areas, not as a target.

How to use this

Practise like an interview

  • Say your answer out loud before revealing the model answer.
  • Add a real example from your work. Interviewers remember stories, not definitions.
  • Mark what you can answer cleanly and repeat the rest tomorrow.
  • Notice the trade-offs in each answer; senior questions are scored on judgement.
Tools in this role

Know the stack

Skills interviewers look for: Strong programming (Java / C# / Python / TS), Design patterns, CI/CD and containers, Distributed systems basics, Code review.

PassRidge / start here

Test the market, not your patience.

Tell us the role you want or the role you need. A QA-only recruiter replies within one working day.

Choose your location

We use your location to show local pay, jobs and the right PassRidge legal entity. It never changes the page URL.

Search PassRidge