SDET interview questions and how to answer them
SDET (software development engineer in test) interview questions treat you as a developer first: expect a real coding round, then questions on designing a test framework, choosing what to test at each layer, running suites fast and reliably in CI, and finding the cause of flaky tests. The strongest candidates write clean code, test their own solution out loud, and talk about test infrastructure the way a backend engineer talks about services.
By Evin JohnPublished 8 min read
What an SDET does compared with a QA engineer
An SDET writes software whose job is to prove other software works. That means test frameworks, test harnesses, mocks and fakes, data generators, CI jobs and dashboards that show which tests fail and why. A QA engineer role often centers on test design and exploratory testing, with automation as one tool among several. An SDET role centers on code. On many teams the SDET reviews developers' pull requests for testability, builds tools that let developers write their own tests faster, and owns the health of the pipeline that gates every merge.
- Coding skill: the same bar for readable, correct code that a developer would meet, in the team's main language.
- Test architecture: where unit, contract, integration and end-to-end tests belong, and what each should not try to do.
- Infrastructure sense: containers, ephemeral environments, parallel execution and reporting.
- Influence: getting developers to own quality instead of throwing code over a wall.
How SDET interview loops are usually built
- Recruiter screenLanguages, frameworks, the kind of systems you tested (web, mobile, APIs, data, devices), and how much of your week was code.
- Coding screenOne or two problems in a shared editor, often easy to medium difficulty: strings, arrays, hash maps, sometimes a small class design. You are expected to test your own code.
- Testing a component"Here is a function or an API. Write the tests." Interviewers watch which cases you pick first and how you structure them.
- Framework or test system designDesign automation for a product, or design a system for running thousands of tests a day across browsers and devices.
- Behavioral and hiring managerPushing back on a release, improving a team's practices, and dealing with developers who skip tests.
The coding round
Do not treat this round as easier than a developer's. Some companies use the same question bank for both roles. What changes is the follow-up: after you solve it, you will be asked how you would test it, and the interviewer listens for edge cases you missed in your own code. Write the solution, then list cases out loud: empty input, one element, duplicates, very large input, invalid types, Unicode, and the boundary that your loop condition handles.
| Question | What it tests | What a strong answer shows |
|---|---|---|
| Reverse the words in a sentence, keeping punctuation in place. | String handling | Clean parsing, then a list of inputs that would break a naive split, such as multiple spaces |
| Find the first non-repeating character in a string. | Hash maps | A two-pass count, linear time, and a test for the case where every character repeats |
| Validate whether a string is a well-formed bracket sequence. | Stacks | Correct handling of an unmatched closer at the start and leftover openers at the end |
| Write the tests for a function that parses a URL into parts. | Test design | Grouped cases: valid forms, missing parts, encoding, ports, IPv6 hosts, very long input, and what the function should do on bad input |
| Implement a small rate limiter and show how you would test it. | Testable design | Injecting a clock instead of sleeping in tests, so time-based behavior is fast and deterministic |
| Merge two sorted lists of log entries by timestamp. | Two pointers | Stable ordering for equal timestamps and a test that proves it |
| Find the API endpoints whose error rate rose between two runs. | Data handling | Joining two result sets by key, handling endpoints present in only one run |
import pytest
from app.text import slugify
@pytest.mark.parametrize("raw, expected", [
("Hello World", "hello-world"),
(" trim me ", "trim-me"),
("Many spaces", "many-spaces"),
("", ""),
("---", ""),
])
def test_slugify(raw, expected):
assert slugify(raw) == expectedTest architecture and framework design questions
- Design an automation framework for a web app with a REST backend. Layers: API clients and data builders, page or screen objects that hide selectors, test code that reads like the scenario, and shared fixtures. Explain config per environment, reporting, and how a new developer adds a test in ten minutes.
- How do you decide what to test at the end-to-end layer? Only the few journeys that earn money or would embarrass the company if broken, such as sign-up, checkout and login. Push the rest down to unit, component and contract tests that run in seconds.
- What is contract testing and when is it worth it? Consumer and provider agree on a recorded contract, tested on both sides, so services can deploy independently. Worth it once several teams own services that call each other.
- Mocks, stubs, fakes and spies: when do you use each? Stubs return canned answers, mocks verify calls, fakes are working lightweight versions such as an in-memory store, spies record calls on a real object. Over-mocking tests your mocks, not the code.
- How do you manage test data? Create what each test needs through APIs or factories, give it unique ids, and clean up or use disposable environments. Shared accounts that many tests change are a top source of failures.
- How would you test a system that depends on a third-party payment provider? Use the provider's sandbox for a small set of integration tests, a local fake for most tests, and contract checks on the request and response shapes.
- Design a system that runs 20,000 browser tests on every release candidate. Containerized browsers or a device grid, sharding by historical duration, retries recorded separately from passes, results stored for trend analysis, and a budget for total wall-clock time.
CI, pipelines and flaky test questions
| Question | What it tests | What a strong answer shows |
|---|---|---|
| The pull request suite takes 45 minutes. How do you get it under 10? | Feedback speed | Measure first, run tests in parallel shards, move slow end-to-end tests to a later stage, run only affected tests where tooling allows, and cache dependencies |
| A test passes locally and fails in CI one run in twenty. What do you do? | Flake diagnosis | Reproduce by looping it in CI-like conditions, collect logs, screenshots and timings, then check for timing waits, shared state, test order, time zones and network calls |
| Should failing tests be retried automatically? | Judgment | A single retry can keep the pipeline moving, but retries must be counted and reported, or flakiness hides until it is everywhere |
| What is your quarantine policy? | Process | Move a flaky test out of the blocking suite with a ticket, an owner and a deadline, and delete it if nobody fixes it |
| Why is a fixed sleep a bad wait? | Synchronization | It is too long on fast machines and too short on slow ones; wait on a condition, such as an element state or an API response |
| How do you run tests against a service that is not deployed yet? | Isolation | Service virtualization or fakes based on an agreed contract, swapped for the real service in a later stage |
| Which quality metrics do you report to engineering leaders? | Measurement | Escaped defects, flaky rate, suite duration and time to detect a regression; code coverage only as a hint, never a target |
Fictional example
- Our end-to-end suite failed about one run in four, and developers had started clicking rerun without reading the failure. I added a report that counted every retry and grouped failures by test and by error message. Three causes covered most of it: tests sharing one admin account, a fixed two-second sleep after login, and a date check that broke near midnight UTC. I replaced the shared account with a factory that created a user per test, swapped the sleep for a wait on the dashboard request, and injected the clock in the date test. I also set a rule that any test retried more than twice in a week went to quarantine with an owner. Within a month the suite was green on first run almost every time, and the team trusted a red build again.
API, mobile and performance testing questions
- What would you check when testing a new REST endpoint? Status codes, schema, authentication and authorization per role, validation errors, idempotency of retries, pagination, and behavior under concurrent writes. The API testing questions page goes deeper.
- How is mobile automation different from web automation? Real devices versus emulators, app install and permissions, flaky networks, platform gestures and slower runs; teams building in Flutter or React Native also test widgets and components below the UI layer.
- When do you run performance tests and what do you measure? Before big launches and on a schedule, with latency percentiles, throughput and error rate under a realistic load profile, not only averages.
- How do you test in production safely? Feature flags, canary releases, synthetic checks on key journeys and alerts tied to user-facing errors.
Behavioral questions for SDETs
- Tell me about a bug your automation caught that would have reached customers.
- Describe a time developers resisted writing tests. How did you change that?
- Tell me about a test tool you built that other people adopted.
- When did you recommend delaying a release, and what happened?
- Describe a test you deleted and why.
A two-week preparation plan
- Days 1 to 5: one or two coding problems a day in your main language. After each, write the test list before looking at any solution.
- Days 6 and 7: sketch a framework for an app you know: folders, layers, fixtures, config and reports. Explain it in five minutes.
- Days 8 and 9: review CI concepts: parallel shards, caching, artifacts, environments. Write a short pipeline file from memory.
- Day 10: list every cause of flaky tests you have seen, with the fix for each.
- Days 11 and 12: practice a "how would you test this" prompt for an elevator, a login page, a file upload and a search API.
- Days 13 and 14: rehearse three stories: a bug caught, a tool built, a process changed.
SDET candidates often solve the problem and then rush the test list, which is the part the interviewer cares about most. A practice round with Natively, an AI interview assistant for Mac and Windows, leaves you a transcript to check how many edge cases you actually said aloud. It can read a practice coding problem from a screenshot and suggest an approach, offer answer ideas live on framework and CI questions, and use your résumé and the job description when you add them (Pro or the free trial). Notes from each session stay on your computer to review.
Questions people ask
What questions are asked in an SDET interview?
Expect a coding round close to a software engineer's, a task to write tests for a function or API, a test framework or test system design question, CI and flaky test scenarios, and behavioral questions about influencing developers.
Is the SDET coding interview hard?
It often uses easy to medium problems on strings, arrays, hash maps and stacks, but you are judged on clean code and on how well you test your own solution, including edge cases you name out loud.
How do I answer a flaky test question in an SDET interview?
Describe how you reproduce it, the common causes (timing waits, shared test data, test order, time zones, network calls), how retries are counted and reported, and a quarantine rule with an owner and a deadline.
What is the difference between an SDET and a QA engineer?
An SDET role centers on writing code: frameworks, harnesses, tools and pipelines. A QA engineer role usually weighs test design and exploratory testing more, with automation as one part of the job.
Where to go next
Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.
Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.
