Skip to content

QA Engineer interview questions

100 real questions with model answers and explanations for Middle candidates.

See a QA Engineer resume example

Practice with flashcards

Spaced repetition · Hunter Pass

Questions

selenium

Implicit and explicit waits serve different scopes, so I avoid combining them.

  • An implicit wait globally polls every element lookup, while an explicit wait polls one condition at a specific point.
  • Mixing them makes total wait times unpredictable because the driver and explicit condition poll within each other.
  • I set the implicit wait to zero and use explicit conditions that document what the test needs.

Why interviewers ask this: The interviewer checks whether the candidate understands wait mechanics deeply enough to explain the interaction bug, not just recite definitions.

playwright

Playwright auto-waits for actionability, but application readiness may require a separate signal.

  • Before a click, it waits for the element to be attached, visible, stable, enabled, and unobscured.
  • This is insufficient when data is loading, a debounced action has not fired, or the assertion depends on a background request.
  • I wait for the real signal with an assertion, a specific response, or a UI state that appears only when data is ready.

Why interviewers ask this: Knowing the boundary of auto-waiting and reaching for response-level or assertion-level synchronization separates real Playwright users from feature-list readers.

locators

I prioritize stable, meaningful locators and use long XPath chains only for unchangeable legacy DOM.

  • My first choice is an agreed test attribute such as data-testid because it survives styling and copy changes.
  • Next come role and accessible name, then stable IDs or short CSS selectors.
  • Long positional XPath chains encode layout rather than meaning and break during ordinary DOM refactoring.

Why interviewers ask this: The testid-first hierarchy plus collaborating with developers on attributes shows the candidate treats locator stability as a design problem, not luck.

pom

A Page Object should model the page and user actions without owning test expectations or scenarios.

  • It contains page locators, meaningful actions, and navigation that can return the next Page Object.
  • Assertions, test-data decisions, and test-flow logic stay in the test so its intent remains visible.
  • I keep objects thin and split large pages into component objects such as headers, tables, and modals.

Why interviewers ask this: Assertions-out-of-page-objects and component decomposition are the two maintainability rules that show the candidate maintained a real POM suite.

I create complex preconditions through the fastest reliable non-UI path and reserve the UI for the behavior under test.

  • API calls or a data factory through the service layer can create the subscribed user and past orders during setup.
  • Building that state through registration and checkout makes tests slow and lets one upstream bug break many unrelated cases.
  • I use direct database inserts only when no API exists because they bypass business rules and may create impossible states.

Why interviewers ask this: Seed-via-API, test-via-UI is the core middle-level automation principle, and the caution about raw DB inserts shows understanding of why.

seleniumcypressplaywright

I choose among Selenium, Cypress, and Playwright based on architecture, ecosystem, and project constraints.

  • Selenium uses WebDriver and offers the broadest language, browser, and grid support, but synchronization is largely manual.
  • Cypress runs alongside the app in the browser with strong debugging and waiting, but historically had multi-tab, multi-origin, and browser limits.
  • Playwright offers auto-waiting, network interception, traces, and parallelism, while Selenium may fit an existing Java or grid ecosystem better.

Why interviewers ask this: Tying architecture to practical consequences, debugging, sync, browser coverage, rather than repeating marketing points, is what the interviewer wants.

uxtesting

I wait for positive evidence that the application is ready rather than merely waiting for a loader to disappear.

  • Reliable signals include visible data, the specific response feeding the view, or an exposed state such as data-loaded.
  • Spinner disappearance is fragile because chained requests can create a false ready moment between loaders.
  • Fixed sleeps are worse because they fail in slow environments and waste time in fast ones.

Why interviewers ask this: Positive-signal waiting versus spinner-absence is a subtle but battle-earned distinction that identifies engineers who fixed loader-related flakiness.

StaleElementReferenceException means a stored element points to a DOM node that has been replaced or detached.

  • State changes in frameworks such as React often replace subtrees and invalidate cached element references.
  • The proper fix is to locate the element at interaction time and re-find it if staleness occurs, rather than cache it across actions.
  • Playwright locators already re-resolve for each action, and Selenium wrappers can follow the same pattern.

Why interviewers ask this: Explaining re-render as the root cause and locator re-resolution as the design fix shows understanding beyond catching the exception and retrying blindly.

testing

Independent tests give clear failures, support parallel execution, and remain runnable in isolation.

  • Dependencies cause cascade failures and turn one regression into many misleading red tests.
  • Each test creates uniquely identified data through its own setup and never relies on a previous test or shared account state.
  • Randomizing execution order in CI exposes hidden coupling before it becomes established practice.

Why interviewers ask this: Naming parallelism and debuggability as the stakes, plus random order as enforcement, shows systematic thinking about suite architecture.

soft-skillsauthe2e

I reuse authenticated state by role so login does not dominate an E2E suite.

  • I authenticate through the API or one UI login, save cookies or storage state, and inject it into each test context.
  • A small dedicated set still tests the UI login flow itself instead of repeating it in every scenario.
  • I handle token expiry and give parallel workers separate users to prevent shared-account interference.

Why interviewers ask this: Session reuse with dedicated login coverage and per-worker accounts is the standard mature pattern, and missing any leg of it causes real problems.

dom

Iframes and shadow DOM require the automation to cross different element boundaries explicitly.

  • Selenium switches into and out of an iframe, while Playwright addresses it with frameLocator.
  • Open shadow roots can be queried with modern Playwright and Selenium CSS support, but closed roots need a developer-provided test hook.
  • I wrap frame and shadow-root handling in Page Objects so scenario code remains focused and readable.

Why interviewers ask this: Knowing the context-switch mechanics and the open-versus-closed shadow root distinction indicates hands-on experience with modern component-based UIs.

testing

I automate file flows through browser APIs and verify the actual artifact, not just the visible interaction.

  • For upload, I set a small repository fixture on the input with setInputFiles or sendKeys and intercept a chooser only for custom widgets.
  • For download, I save without prompts, wait for the download event, and check the file name and size.
  • I parse formats such as CSV or PDF to verify content because a file appearing does not prove it is correct.

Why interviewers ask this: Bypassing OS dialogs via the input element and verifying downloaded content, not just existence, are the practical details being probed.

debuggingartifacts

Every CI UI failure should automatically preserve enough evidence for remote diagnosis.

  • I capture a failure screenshot, run video, browser console, network logs, and a Playwright trace when available.
  • Trace or video shows the UI state, console logs expose client exceptions, and network logs separate UI failures from backend errors.
  • Automatic artifacts are a framework requirement because CI-only failures are otherwise expensive to reproduce locally.

Why interviewers ask this: The triage sequence and using artifacts to separate frontend from backend causes show the candidate actually debugs CI failures rather than rerunning them.

pyramid

For each risk, I choose the cheapest test layer that can detect it reliably.

  • Unit and integration tests cover business logic and edge cases, while contract and API tests cover validation, permissions, and service errors.
  • E2E keeps only a few journeys proving that integrated parts complete critical outcomes such as checkout and payment.
  • This avoids an inverted pyramid of slow UI tests repeating checks that lower layers can perform in milliseconds.

Why interviewers ask this: The cheapest-layer-that-catches-it question is the operational form of the pyramid, showing the candidate applies it per feature rather than reciting the triangle.

I automate scenarios whose repetition and regression risk justify their implementation and maintenance cost.

  • Core happy paths, API-level boundaries and permissions, and checks repeated every release usually earn automation.
  • One-off exploration, rapidly changing UI, and subjective visual quality are often cheaper and better to test manually.
  • I explain that automation is maintained code, while exploratory testing remains an intentional part of the plan.

Why interviewers ask this: ROI-based selection with explicit room for exploratory work distinguishes engineers from automation maximalists who drown in maintenance.

I choose hard or soft assertions according to whether later checks remain meaningful after a failure.

  • A hard assertion stops immediately, which is correct when later actions depend on the failed prerequisite.
  • Soft assertions collect independent differences, such as multiple form fields or report columns, and report them together.
  • Where a framework requires assert-all, I enforce it through fixtures so a forgotten final call cannot produce a false pass.

Why interviewers ask this: Matching assertion style to step dependency, plus knowing the forgotten-assert-all trap, reflects real framework maintenance experience.

config

One profile-based configuration mechanism lets the same suite run unchanged across environments.

  • A single switch selects base URLs, credential references, feature flags, and timeouts from environment variables or profile files.
  • CI injects secrets from a secret store, while local runs use an ignored environment file.
  • Tests use logical names such as admin user or payments sandbox, and never hardcode environment-specific values.

Why interviewers ask this: Logical-name indirection and secrets hygiene show the candidate has run one suite against many environments, not one.

visualregression

Visual regression testing compares captured UI images with approved baselines and requires deliberate scoping.

  • Tools use pixel or perceptual diffs, thresholds, and ignored regions for dynamic content before human review.
  • It pays off for stable design systems, component libraries, and important pages where unintended CSS changes matter.
  • I stabilize data and animations, avoid volatile full pages, and review baseline updates as part of the PR flow.

Why interviewers ask this: Scoping to stable surfaces and managing baseline churn shows the candidate ran visual testing long enough to see its failure mode.

responsivecoverage

My mobile coverage matrix follows the shipped product and real usage risks rather than trying every device.

  • Responsive web gets broad browser emulation for layout and viewport logic plus a small real-device check for touch and rendering quirks.
  • Native or hybrid apps use emulators for most runs and a device farm of leading real devices for release verification.
  • Real devices target gaps such as old-hardware performance, permission dialogs, and interruptions like calls.

Why interviewers ask this: Splitting responsive-web from native strategies and sizing the real-device matrix from analytics shows pragmatic mobile experience.

I run broad functional coverage on one primary browser and target cross-browser checks where engines actually differ.

  • The full suite usually runs on Chromium because most functional defects are browser-independent.
  • Critical journeys and browser-sensitive rendering, input, or API cases also run on Firefox and WebKit.
  • Product analytics determines the matrix, while low-usage browsers receive documented smoke coverage or none.

Why interviewers ask this: Concentrating cross-browser runs where browser-specific risk actually lives, informed by usage data, is the judgment being tested.

Locked questions

  • 21

    Where is retry logic acceptable in a framework, and where does it start hiding bugs?

    resilience
  • 22

    Your suite of 400 UI tests takes 3 hours. What are your options to get feedback under 20 minutes?

    feedbacktesting
  • 23

    An API test got a 200 response. What else do you verify before calling the endpoint tested?

    endpoints
  • 24

    Explain consumer-driven contract testing with Pact and what problem it solves that E2E integration tests do not.

    integratione2econtract
  • 25

    How do you use JSON schema validation in API tests, and what does it protect against?

    schemaapivalidation
  • 26

    How do you test authorization in an API beyond checking that a valid token works?

    authtokensapi
  • 27

    How do you test idempotency of an API, and why does it matter for real clients?

    idempotency
  • 28

    What does a thorough negative testing pass for an API endpoint include?

    endpointstesting
  • 29

    Postman collections versus code-based API tests in pytest or RestAssured: when is each the right tool?

    pytestapi
  • 30

    When do you stub an external dependency with something like WireMock, and when do you test against the real thing?

    schedulingdependencies
  • 31

    How do you test list endpoints with pagination, filtering, and sorting so the combinations do not explode?

    endpointspaginationalgorithms
  • 32

    The team releases API v2 while v1 must keep working. What does your backward compatibility testing look like?

    api
  • 33

    How do you test asynchronous flows, like an API that accepts a job and later fires a webhook?

    webhooksasync
  • 34

    How would you verify that API rate limiting works as specified?

    rate-limiting
  • 35

    A test asserts data immediately after an async write and fails intermittently because the system is eventually consistent. How do you fix the test properly?

    system-designconsistencyasync
  • 36

    When and how do you verify API side effects directly in the database?

    databaseapi
  • 37

    Compare fixtures, factories, and production data copies as test data strategies. What do you use where?

    fixturestest-data
  • 38

    Multiple teams share one staging environment and tests keep colliding. How do you isolate test data without splitting the environment?

    test-data
  • 39

    Cleanup after tests: teardown deletion, pre-test cleanup, or disposable environments? Argue the trade-offs.

    testing
  • 40

    Staging behaves differently from production and bugs keep slipping through the gap. How do you attack environment parity?

  • 41

    Your product depends on a payment provider. How do you test payment flows across the sandbox and test doubles?

  • 42

    You receive a production database copy for testing. What must happen to it before your team can use it?

    databasetesting
  • 43

    The feature you are testing depends on time: trials expire after 14 days, reports close at month end. How do you test this without waiting?

    testing
  • 44

    Give examples of SQL checks you run that catch bugs the UI and API would never show you.

    sqlapi
  • 45

    A release includes a schema migration that transforms existing data. How do you test the migration itself?

    schemamigrations
  • 46

    How do you test email and notification flows in an automated way?

  • 47

    Which test suites run at which pipeline stages in your ideal setup, and what time budget does each get?

    ci-cd
  • 48

    What has to be true about your tests before parallel execution in CI actually works?

    testing
  • 49

    How do you make CI test reports actually useful for a team, beyond a pass-fail count?

  • 50

    Which checks should block a merge, and which should not? How do you argue this with the team?

  • 51

    How do you run browsers and infrastructure dependencies for tests inside CI containers?

    containersdependenciestesting
  • 52

    Full regression on every commit is too slow, but skipping tests is risky. How do you select which tests to run for a change?

    testing
  • 53

    How should test credentials and secrets be handled in CI pipelines?

    ci-cdsecrets
  • 54

    The pipeline is red roughly a third of days due to environment problems, and the team has started ignoring it. How do you fix this systemically?

    system-designci-cd
  • 55

    Which metrics tell you whether your automation effort is actually healthy?

    monitoring
  • 56

    A nightly run produced 42 failures. Walk me through your triage process the next morning.

    concurrency
  • 57

    Load, stress, soak, and spike testing: what does each answer, and which do teams skip at their peril?

    testing
  • 58

    How do you build a realistic workload model for a load test instead of just hammering one endpoint?

    load-testingendpoints
  • 59

    You write a k6 or JMeter scenario. What do you parameterize and what pass-fail criteria do you set?

    load-testing
  • 60

    Why do you report p95 and p99 latency instead of averages, and what does a growing gap between median and p99 tell you?

    latency
  • 61

    Name the classic mistakes that make performance test results worthless.

    ownershipperformanceperformance-testing
  • 62

    During a load test, latency stays flat as load rises, then explodes past a certain throughput. How do you work with this result?

    latencythroughputload-testing
  • 63

    How do you make performance testing continuous instead of a one-off exercise before big releases?

    performance-testingperformance
  • 64

    What must be true about the environment and data before you trust numbers from a performance test?

    performance-testing
  • 65

    What are the most common root causes of flaky UI tests, in your experience?

    flaky
  • 66

    Describe your end-to-end process for handling a test that flakes in CI, from detection to closure.

    closuresconcurrencye2e
  • 67

    A test fails at 2 am in CI but passes every time you run it locally. What differences do you investigate?

  • 68

    Why are fixed sleeps the worst synchronization tool, and what do you use instead in each situation?

  • 69

    How do you detect and fix order-dependent tests?

    testing
  • 70

    Your tests are stable, but the shared staging environment they run against is not. What do you do?

    testing
  • 71

    A test passes on retry and everyone moves on. Why are you not comfortable with that, and what do you do?

    resilience
  • 72

    How do you make flakiness visible and owned at the team level rather than a private QA struggle?

  • 73

    What separates a bug report that gets fixed quickly from one that bounces back with questions?

    bug-reporting
  • 74

    Severity versus priority: explain the difference with examples where they point in opposite directions.

    severity-priority
  • 75

    In a triage meeting, product wants everything now and developers want everything later. What is your role between them?

  • 76

    A developer returns your bug with cannot reproduce. What is your next move?

    debugging
  • 77

    Users report an intermittent bug in production that you cannot reproduce in any test environment. How do you investigate?

    debuggingtest-environments
  • 78

    You get two weeks to test a new feature. How do you build the test strategy, and what does risk-based mean concretely?

    test-strategy
  • 79

    The company moves from monthly releases to weekly. Your regression approach must change. What do you do?

  • 80

    How do you run exploratory testing so it produces value beyond random clicking?

    exploratory
  • 81

    The team ships everything behind feature flags. What new testing obligations does that create?

    feature-flags
  • 82

    It is release day. What exactly do you bring to the go/no-go conversation?

    governance
  • 83

    Product asks whether the feature is fully tested. Code coverage says 85 percent. Why is that not an answer, and what do you use instead?

    coverage
  • 84

    A critical production bug demands a hotfix within the hour. What does your verification look like under that constraint?

  • 85

    A dashboard number is questioned: the report says one thing, stakeholders believe another. How do you verify a report or ETL output?

    stakeholder-managementcommunicationetl
  • 86

    How do you test that a multi-step operation is properly transactional, for example order creation that writes to three tables?

    transactions
  • 87

    The product ships in six languages. What does your localization testing cover beyond translated strings being present?

    testing
  • 88

    What does a realistic accessibility testing approach look like for a team without a dedicated accessibility specialist?

    a11ytesting
  • 89

    What security-minded checks do you run as a QA engineer, without being a security specialist?

  • 90

    The application caches aggressively. What cache-related bugs do you hunt for, and how?

    caching
  • 91

    A developer insists the bug you consider critical is minor and will not fix it this sprint. How do you proceed?

    agile
  • 92

    Three hours before the release cutoff you find a serious bug in a core flow. Walk me through your actions.

  • 93

    Developers complain that QA is the bottleneck slowing releases. How do you respond?

    tracking
  • 94

    When does your testing work start for a feature, and what does shift-left look like in your actual practice?

    shift-left
  • 95

    A bug you missed reached production and caused customer complaints. How do you handle the aftermath?

    soft-skills
  • 96

    Two features land for testing on the same day, both marked urgent, and a production issue needs verification too. How do you prioritize?

    testing
  • 97

    Developers write unit tests but treat the E2E suite as QA's problem, and it is rotting. How do you change that?

    unite2e
  • 98

    You believe the team must invest two sprints in test infrastructure, but product wants features. How do you make the case?

    agile
  • 99

    The team considers migrating from Selenium to Playwright. How do you evaluate and de-risk such a migration?

    seleniumplaywrightmigrations
  • 100

    You join a team as their QA engineer on an unfamiliar product. What do your first three weeks look like?

    joins