HireHireInterview Quizzes › QA / Test Engineer

QA / Test Engineer Interview Questions

Think you're ready? These are the questions that actually decide QA / Test Engineer interviews. Warm up on Easy — then face the Hard round, where 95% of candidates crumble. 80 questions across 3 levels, instant score, completely free.

80Questions
3Difficulty levels
95%Fail the hard round
FreeInstant score
Easy
Warm-up · 20 Qs
Medium
Practical · 30 Qs
Hard
Brutal · 30 Qs
⚡ Take the QA / Test Engineer quiz — get your score →

The QA / Test Engineer interview questions

Below are the real questions, grouped by difficulty. Expand any one to reveal the correct answer and why — or take the timed quiz for a score you can share. Can you clear the Hard round?

Easy round 20 questions

A text field accepts values from 1 to 100. Using boundary value analysis, which set best exercises the boundaries?
  • A. 1, 50, 100
  • B. 2, 99
  • C. 0, 1, 100, 101 ✓
  • D. 50, 60, 70
Correct answer: C. Boundary value analysis targets values just below, at, and just above the min and max limits.
The company's logo is misspelled on the home page banner. How should a tester classify this defect?
  • A. High severity, high priority
  • B. High severity, low priority
  • C. Low severity, low priority
  • D. Low severity, high priority ✓
Correct answer: D. It doesn't break functionality (low severity) but is highly visible and hurts branding, so it must be fixed fast (high priority).
A developer marks a reported bug as fixed on a new build. What should the tester do first before closing it?
  • A. Close it based on the developer's word
  • B. Retest the specific bug on the fixed build ✓
  • C. Run the full regression suite only
  • D. Write a new test plan
Correct answer: B. Retesting the exact defect on the new build confirms the fix actually works before closure.
After several bug fixes in the payment module, what is the main reason to run regression tests?
  • A. To verify only the fixed bugs
  • B. To measure server load
  • C. To confirm the fixes didn't break existing working features ✓
  • D. To create new test cases
Correct answer: C. Regression testing ensures changes have not introduced defects in previously working functionality.
A new build is delivered and the login page fails to load at all. What is the correct next step?
  • A. Continue full regression testing
  • B. Reject the build and stop detailed testing ✓
  • C. Log it as low priority and proceed
  • D. Mark all remaining test cases as passed
Correct answer: B. A failed smoke/build-verification check means the build is unstable and should be rejected before deeper testing.
A field validates PIN codes as exactly 6 digits. Using equivalence partitioning, which pair falls into two DIFFERENT classes?
  • A. 560001 and 400001
  • B. 123456 and 654321
  • C. 111111 and 222222
  • D. 560001 and 5600 ✓
Correct answer: D. 560001 is a valid 6-digit input while 5600 is an invalid short input, so they belong to different equivalence classes.
During retesting, a defect that was marked 'Fixed' is reproduced again by the tester. Which status should it move to?
  • A. Closed
  • B. Deferred
  • C. Reopened ✓
  • D. New
Correct answer: C. A previously fixed defect that reappears is set back to Reopened so the developer investigates again.
An API call to fetch a specific user returns HTTP 404. What does this most likely indicate?
  • A. The requested user resource was not found ✓
  • B. The server crashed internally
  • C. The request succeeded with data
  • D. The request timed out
Correct answer: A. A 404 status means the requested resource does not exist at that endpoint.
While testing a REST API, a GET request to /orders changes data in the database. Why is this a bug?
  • A. GET is faster than POST
  • B. A GET should be safe and must not modify server data ✓
  • C. GET cannot return JSON
  • D. GET always requires a request body
Correct answer: B. GET is defined as a safe, read-only method, so it should never alter server-side state.
A Selenium script fails with NoSuchElementException. What is the most likely cause?
  • A. The browser is running too fast
  • B. The assertion library is missing
  • C. The test data file is empty
  • D. The locator did not match any element on the page ✓
Correct answer: D. NoSuchElementException is thrown when the given locator finds no matching element in the DOM.
Which of these is the clearest, most testable expected result in a test case?
  • A. Login should work properly
  • B. User is happy after logging in
  • C. System displays 'Invalid credentials' and stays on the login page ✓
  • D. Page behaves as expected
Correct answer: C. A good expected result is specific and verifiable, stating the exact message and observable behaviour.
A rarely used admin report crashes the entire application when opened. How is this best classified?
  • A. Low severity, high priority
  • B. High severity, low priority ✓
  • C. Low severity, low priority
  • D. High severity, high priority
Correct answer: B. Crashing the app is high severity, but because the feature is rarely used it can be scheduled later, giving low priority.
Which of the following is a NEGATIVE test case for a login form?
  • A. Entering a wrong password and checking for an error message ✓
  • B. Entering valid credentials and logging in successfully
  • C. Checking that the page title is correct
  • D. Verifying the logo alignment on the page
Correct answer: A. A negative test feeds invalid input to confirm the system rejects it gracefully.
A tester reviews the design document against the requirements, without running any code, to check it was built as specified. This activity is:
  • A. Validation
  • B. System testing
  • C. Regression
  • D. Verification ✓
Correct answer: D. Verification checks that work products match specifications through reviews, before execution.
A minor cosmetic bug is found late in the release cycle and the team decides to fix it in the next release. Which status fits?
  • A. Reopened
  • B. Duplicate
  • C. Deferred ✓
  • D. Rejected
Correct answer: C. A valid but postponed defect is marked Deferred for a later release.
80 of 100 written test cases have been executed for a release. What does this primarily tell you?
  • A. The product is 80% bug-free
  • B. Test execution coverage is 80% ✓
  • C. 80% of the source code is covered
  • D. 80% of users are satisfied
Correct answer: B. Executed cases divided by total planned cases gives test execution coverage, not code coverage or quality.
How is the difference between a smoke test and a sanity test best described?
  • A. Smoke checks overall build stability broadly; sanity narrowly verifies a specific new fix or function ✓
  • B. Both always test the entire application in full depth
  • C. Sanity is always performed before smoke
  • D. Smoke tests only the database layer
Correct answer: A. Smoke is a broad build-stability check; sanity is a focused check on specific changed functionality.
The app claims a new user was registered. Which SQL query best verifies this in the database without altering data?
  • A. DELETE FROM users WHERE email = 'test@x.com'
  • B. UPDATE users SET email = 'test@x.com'
  • C. SELECT * FROM users WHERE email = 'test@x.com' ✓
  • D. DROP TABLE users
Correct answer: C. A SELECT reads and confirms the record exists without modifying the data.
An API returns HTTP 500 even though the request body was valid. Where does the problem most likely lie?
  • A. In the client's request format
  • B. On the server side ✓
  • C. In the tester's browser cache
  • D. In the DNS configuration
Correct answer: B. 5xx codes indicate a server-side failure, distinct from 4xx client-side errors.
In a session a tester explores the app with no pre-written scripts, learning and designing tests on the fly. This is:
  • A. Regression testing
  • B. Load testing
  • C. Unit testing
  • D. Exploratory testing ✓
Correct answer: D. Exploratory testing combines simultaneous learning, test design, and execution without predefined scripts.

Medium round 30 questions

A login form has a password field that must accept 8 to 16 characters. Using boundary value analysis, which set of input lengths is the MOST efficient to test the field's length validation?
  • A. 8, 12, and 16 characters
  • B. 7, 8, 16, and 17 characters ✓
  • C. 1, 8, and 100 characters
  • D. 8, 9, 10, 11, 12, 13, 14, 15, and 16 characters
Correct answer: B. Boundary value analysis targets the values just below, at, and just above each boundary (7/8 and 16/17), which is where off-by-one defects typically occur.
You find that a 'Submit Order' button occasionally does nothing on the first click but works on the second. What is the BEST first step before logging this as a bug?
  • A. Log it immediately as intermittent and move on
  • B. Determine reproducible steps and note frequency/conditions under which it fails ✓
  • C. Assume it is a network issue and close it as not-a-bug
  • D. Ask a developer to fix it without documenting anything
Correct answer: B. A good bug report needs consistent, documented reproduction steps and observed frequency so developers can diagnose intermittent issues effectively.
In a REST API test, you send a POST to create a resource and it succeeds. Which HTTP status code should you typically assert in the response?
  • A. 200 OK
  • B. 201 Created ✓
  • C. 204 No Content
  • D. 302 Found
Correct answer: B. A successful resource creation via POST conventionally returns 201 Created, often with the new resource or its location in the response.
Your Selenium test intermittently fails with 'element not found' even though the element eventually appears. What is the correct fix?
  • A. Add a fixed Thread.sleep(5000) before every interaction
  • B. Use an explicit wait (WebDriverWait) for the element's expected condition ✓
  • C. Increase the browser window size
  • D. Re-run the test until it passes
Correct answer: B. Explicit waits poll for a specific condition and proceed as soon as it is met, making tests reliable without the wasted time or fragility of fixed sleeps.
A tester writes: 'Given the user is logged in, When they click Logout, Then they are redirected to the login page.' This format is most associated with which practice?
  • A. Boundary value analysis
  • B. Behavior-Driven Development (BDD) / Gherkin ✓
  • C. Exploratory testing charters
  • D. Equivalence partitioning
Correct answer: B. The Given-When-Then structure is the Gherkin syntax used in BDD to describe scenarios in a readable, executable format.
You are asked to test a 'transfer money' feature. Which of these is a NEGATIVE test case?
  • A. Transfer 100 from an account with a 500 balance
  • B. Transfer an amount greater than the available balance ✓
  • C. Transfer 1 to a valid recipient
  • D. Transfer the full available balance to a valid recipient
Correct answer: B. A negative test deliberately supplies invalid input (insufficient funds) to verify the system rejects it gracefully rather than testing a valid, expected flow.
During regression testing after a small bug fix in the checkout module, what is the primary goal?
  • A. To verify only the exact line of code that was changed
  • B. To confirm the fix works and that existing related functionality still works ✓
  • C. To test brand-new features added in the release
  • D. To measure the application's performance under load
Correct answer: B. Regression testing verifies that a change fixed the issue without breaking previously working functionality in related areas.
In a CI pipeline, your automated test suite passes locally but a test fails only on the CI server. What is the MOST likely cause to investigate first?
  • A. The CI server has a faster CPU
  • B. Environment differences such as test data, timezone, config, or missing dependencies ✓
  • C. The test code is syntactically invalid
  • D. The programming language version is identical on both
Correct answer: B. Tests that pass locally but fail in CI most commonly stem from environment discrepancies like data state, configuration, locale, or dependency versions.
You need to verify that a user's order total is correctly stored after checkout. Which testing approach directly validates this?
  • A. Checking only the UI confirmation message
  • B. Querying the database to confirm the persisted total matches the expected value ✓
  • C. Reviewing the CSS of the confirmation page
  • D. Measuring the page load time
Correct answer: B. Database validation confirms data is actually persisted correctly, which the UI alone may not guarantee due to caching or display-only formatting.
You want to ensure a critical API endpoint returns results within acceptable time under 200 concurrent users. Which test type is appropriate?
  • A. Unit testing
  • B. Load testing ✓
  • C. Usability testing
  • D. Smoke testing
Correct answer: B. Load testing evaluates system behavior and response times under an expected concurrent user load to confirm performance requirements are met.
A field accepts ages 18 to 60. Using equivalence partitioning, the three classes to test are:
  • A. 18, 19, 20 only
  • B. Only valid values inside 18-60
  • C. 0, 18, 60, 100
  • D. Below 18, 18-60, above 60 ✓
Correct answer: D. Equivalence partitioning groups inputs into one valid and two invalid classes: below 18, within 18-60, and above 60.
Which defect is typically HIGH severity but LOW priority?
  • A. A typo in the company name on the home page
  • B. A broken 'Buy Now' button on the checkout page
  • C. A crash in a rarely used legacy report that few customers open ✓
  • D. Wrong alignment of a footer link
Correct answer: C. A crash is high severity, but if it lives in a seldom-used feature it can wait, making it low priority.
The primary benefit of the Page Object Model in test automation is:
  • A. It centralizes UI locators so tests need fewer changes when the UI changes ✓
  • B. It eliminates the need for any assertions
  • C. It runs tests faster by skipping page loads
  • D. It automatically generates test data
Correct answer: A. POM encapsulates locators and page actions in one place, so UI changes require edits in only the page object.
Which Selenium locator strategy is generally the most robust against UI markup changes?
  • A. An absolute XPath from the html root
  • B. A unique, stable id attribute ✓
  • C. Locating by the element's exact pixel position
  • D. A long CSS path through many nested divs
Correct answer: B. A unique, stable id is resilient because it does not depend on surrounding DOM structure that markup changes can break.
After a minor bug fix, a tester runs a quick, narrow check on just the affected functionality. This is:
  • A. Load testing
  • B. Full regression testing
  • C. Exploratory testing of the whole app
  • D. Sanity testing ✓
Correct answer: D. Sanity testing is a focused, shallow check of specific functionality after a small change.
An API POST that successfully creates a new resource should typically return:
  • A. 201 Created ✓
  • B. 200 OK, but only if the body is empty
  • C. 204 No Content
  • D. 400 Bad Request
Correct answer: A. HTTP 201 Created is the conventional status for a successful resource-creation POST.
Retesting (confirmation testing) differs from regression testing because retesting:
  • A. Runs the whole suite to find unrelated breakages
  • B. Is always fully automated
  • C. Re-executes the exact failed cases on the fixed build to confirm the fix ✓
  • D. Is done before any defect is fixed
Correct answer: C. Retesting reruns the specific previously failed cases to confirm the fix, whereas regression checks for new side-effects.
A decision table is most useful when testing logic that depends on:
  • A. A single numeric range boundary
  • B. Combinations of multiple input conditions ✓
  • C. The visual layout of a page
  • D. Network latency under load
Correct answer: B. Decision tables systematically capture combinations of conditions and their expected actions.
Defect leakage refers to defects that:
  • A. Are duplicates of already-logged defects
  • B. Were fixed before the build was released
  • C. Are marked as 'won't fix' by the team
  • D. Were missed in testing and found later in production by users ✓
Correct answer: D. Defect leakage is the escape of defects past testing into production where end users encounter them.
In risk-based testing, test effort is prioritized based on:
  • A. The likelihood of failure and the impact of that failure on the business ✓
  • B. The alphabetical order of module names
  • C. Whichever tests are quickest to automate
  • D. The number of developers on each module
Correct answer: A. Risk-based testing ranks areas by probability of failure times business impact to focus effort where risk is highest.
For an input field accepting integers from 1 to 100, boundary value analysis would test which set of values?
  • A. 50 and 51 only
  • B. 0, 1, 100, 101 ✓
  • C. 1 and 100 only
  • D. 0 and 101 only
Correct answer: B. BVA tests values just inside and just outside each boundary: 0/1 at the lower edge and 100/101 at the upper edge.
A test passes locally but intermittently fails in CI without code changes. This is best described as a:
  • A. Regression bug
  • B. Flaky test ✓
  • C. Blocker defect
  • D. False negative in requirements
Correct answer: B. A flaky test produces inconsistent results (pass/fail) on the same code, often due to timing, ordering, or environment issues.
In Selenium WebDriver, which wait strategy polls the DOM at intervals until a condition is met or a timeout expires?
  • A. Implicit wait
  • B. Explicit wait ✓
  • C. Thread.sleep
  • D. Page load timeout
Correct answer: B. Explicit wait (WebDriverWait with ExpectedConditions) polls repeatedly until the condition is satisfied or the timeout is reached.
You must test login with combinations of valid/invalid username and valid/invalid password. Which technique most efficiently structures this?
  • A. Decision table testing ✓
  • B. Load testing
  • C. Boundary value analysis
  • D. Fuzz testing
Correct answer: A. A decision table maps combinations of conditions (username/password validity) to expected outcomes, ensuring all rules are covered.
Which CSS locator selects an element with id 'submit-btn'?
  • A. .submit-btn
  • B. #submit-btn ✓
  • C. *submit-btn
  • D. @submit-btn
Correct answer: B. In CSS selectors, '#' targets an element by its id, so '#submit-btn' matches id='submit-btn'.
When testing a REST API, which HTTP method is expected to be idempotent AND typically used to fully replace a resource?
  • A. POST
  • B. PUT ✓
  • C. PATCH
  • D. CONNECT
Correct answer: B. PUT is idempotent and replaces the entire resource, so repeating the same PUT yields the same server state.
A defect has minor cosmetic impact but the CEO demo is tomorrow and it is on the landing page. The correct classification is likely:
  • A. High severity, low priority
  • B. Low severity, high priority ✓
  • C. High severity, high priority
  • D. Low severity, low priority
Correct answer: B. Cosmetic impact means low severity, but the imminent demo makes fixing it urgent, giving it high priority.
In the Page Object Model (POM) design pattern, what is the main benefit?
  • A. It eliminates the need for assertions
  • B. It separates page structure/locators from test logic for maintainability ✓
  • C. It removes the need for a test runner
  • D. It automatically generates test data
Correct answer: B. POM encapsulates page locators and actions in dedicated classes so UI changes require updates in one place, not across every test.
Which type of testing specifically verifies that a system continues to function correctly as load increases up to expected peak?
  • A. Spike testing
  • B. Load testing ✓
  • C. Volume testing
  • D. Recovery testing
Correct answer: B. Load testing evaluates system behavior under expected concurrent user or transaction volumes up to the anticipated peak.
In an API test, you get HTTP 200 but the response body has an empty data array when data was expected. This indicates:
  • A. A transport-layer failure
  • B. A functional defect despite a successful HTTP status ✓
  • C. A DNS resolution error
  • D. A TLS handshake failure
Correct answer: B. A 200 means the request succeeded at the HTTP level, but the empty payload reveals a functional/business-logic defect.

Hard round 30 questions

In a TestNG suite configured with parallel="methods" and thread-count=5, tests intermittently interact with the wrong browser window and throw NoSuchWindowException, though each test passes when run alone. The framework holds `private static WebDriver driver;` initialized in a @BeforeMethod. What is the correct root-cause fix?
  • A. Store the WebDriver in a `ThreadLocal<WebDriver>` so each thread gets its own isolated instance ✓
  • B. Add an implicit wait of 10 seconds so window handles have time to stabilize across threads
  • C. Change parallel="methods" to parallel="tests" and keep the static driver
  • D. Synchronize every @Test method on the driver object to serialize browser access
Correct answer: A. A single static WebDriver is shared across all threads, so parallel tests clobber each other's session; a ThreadLocal gives each thread its own driver, which is the standard thread-safe pattern.
A Selenium test intermittently fails with ElementNotInteractableException when clicking a 'Confirm' button inside an animated modal. The wait is `new WebDriverWait(driver, Duration.ofSeconds(10)).until(ExpectedConditions.presenceOfElementLocated(By.id("confirm")))`. Why does this fail and what is the minimal fix?
  • A. presenceOfElementLocated returns as soon as the node exists in the DOM even if it is hidden or still animating; switch to elementToBeClickable ✓
  • B. The timeout is too short; increase it to 30 seconds so the animation completes
  • C. presenceOfElementLocated polls too aggressively; add a Thread.sleep(500) before the click
  • D. The locator is stale; re-find the element with driver.findElement immediately before clicking
Correct answer: A. presenceOfElementLocated only guarantees DOM presence, not visibility or interactability, so the click can hit a not-yet-interactable element; elementToBeClickable waits for visible and enabled.
A test grabs `WebElement row = driver.findElement(By.css(".grid-row"))`, triggers a filter that causes React to re-render the grid, then calls `row.click()` and gets StaleElementReferenceException. Which statement correctly explains the cause?
  • A. The element reference points to a DOM node that was detached/replaced during re-render, so the cached handle is no longer valid ✓
  • B. The CSS selector matched multiple elements, so Selenium lost track of which one to click
  • C. An implicit wait expired between findElement and click, invalidating the reference
  • D. The browser garbage-collected the element because JavaScript held no reference to it
Correct answer: A. StaleElementReferenceException means the previously located node was removed or replaced in the DOM; the fix is to re-locate the element after the re-render rather than reuse the cached reference.
You migrate a click test from Selenium to Playwright. In the app, a cookie banner sometimes overlays the target button. With Selenium's Actions.click the test occasionally clicked the banner instead of the button; in Playwright `page.click('#submit')` now times out with an actionability error instead. Why does Playwright behave differently?
  • A. Playwright's auto-waiting runs actionability checks including that the element actually receives pointer events (is not obscured), so it waits/fails rather than clicking the overlay ✓
  • B. Playwright disables JavaScript overlays during clicks, so the banner should never appear
  • C. Playwright uses a longer default timeout, so the banner has time to auto-dismiss before the click
  • D. Playwright clicks via the accessibility tree, which ignores z-index and overlays entirely
Correct answer: A. Playwright's actionability checks require the target to be visible, stable, enabled, and hit-testable (receiving events); an obscuring overlay fails the hit-test, producing a timeout instead of a wrong-element click.
A data-validation check runs `SELECT * FROM orders WHERE customer_id NOT IN (SELECT id FROM customers);` to find orphaned orders. The customers table has at least one row where id IS NULL. What does the query return?
  • A. Zero rows, regardless of how many orphaned orders actually exist ✓
  • B. All orphaned orders correctly, because NULL ids are simply skipped in the subquery
  • C. A syntax error, because NOT IN cannot operate on a nullable column
  • D. Only orders whose customer_id is also NULL
Correct answer: A. With NOT IN, a NULL in the subquery makes every comparison evaluate to UNKNOWN rather than TRUE, so the predicate is never satisfied and no rows are returned; NOT EXISTS or filtering out NULLs avoids this trap.
An SLA states 95% of checkout requests must complete under 500ms. Your k6 run reports http_req_duration avg=210ms, med=180ms, p(95)=830ms, max=4s. What is the correct conclusion for the release gate?
  • A. Fail the gate: the p95 of 830ms exceeds the 500ms threshold, and the low average masks a slow tail ✓
  • B. Pass the gate: the average and median are well under 500ms
  • C. Pass the gate: only the max is over 500ms and maximums are always outliers to ignore
  • D. Inconclusive: k6 cannot evaluate percentile-based SLAs without a longer soak test
Correct answer: A. A 95th-percentile SLA is evaluated against p95, which at 830ms violates the 500ms limit; averages and medians hide tail latency and must not be used to certify a percentile SLA.
In WireMock, two stub mappings both match GET /accounts/123: stub A has `"priority": 5` returning 200, stub B has `"priority": 1` returning 404. Which response is served, and why?
  • A. The 404 from stub B, because a lower priority number means higher precedence and is evaluated first ✓
  • B. The 200 from stub A, because higher priority numbers win
  • C. WireMock returns a 500 because ambiguous overlapping stubs are a configuration error
  • D. Whichever stub was registered last, because priority only breaks ties by insertion order
Correct answer: A. In WireMock a lower priority value denotes higher precedence, so stub B (priority 1) is matched before stub A and its 404 is returned.
A consumer service publishes a Pact contract expecting the provider's GET /user/{id} response to include a non-null `email` string. The provider team refactors and drops `email` from the payload. Assuming CI runs Pact provider verification against the published pact, what happens and why?
  • A. Provider verification fails, because the recorded consumer expectation (email present) is no longer satisfied by the real provider response ✓
  • B. Nothing fails, because Pact only verifies request shapes, not response bodies
  • C. The consumer's own unit tests fail, but provider verification passes since it replays stubs
  • D. Verification passes because Pact treats missing fields as backward-compatible by default
Correct answer: A. Provider verification replays the consumer's recorded expectations against the real provider; removing a field the consumer relied upon breaks that expectation and fails verification, catching the contract mismatch before deploy.
A field accepts an integer age and is valid only for 18 through 65 inclusive. Applying two-value boundary value analysis (just below, at, above each boundary), which set of test inputs is correct?
  • A. 17, 18, 65, 66 ✓
  • B. 18, 19, 64, 65
  • C. 0, 18, 65, 100
  • D. 17, 19, 64, 66
Correct answer: A. Two-value BVA tests each boundary and its immediate outside neighbor: min-1=17, min=18, max=65, max+1=66.
A configuration form has 3 independent boolean flags (each on/off). Exhaustive testing needs 2^3 = 8 cases, but you decide pairwise (all-pairs) coverage is sufficient. What is the minimum number of test cases that covers every pair of flag values?
  • A. 4 ✓
  • B. 3
  • C. 6
  • D. 8
Correct answer: A. For three two-valued parameters, an orthogonal all-pairs set of 4 cases covers every pairwise value combination, halving the exhaustive 8.
A test passes locally but intermittently fails in CI. The MOST likely root cause is:
  • A. A syntax error in the test file
  • B. The assertion library being outdated
  • C. Hidden dependencies on timing, ordering, or shared state ✓
  • D. The test having too many comments
Correct answer: C. Intermittent CI-only failures are the hallmark of flakiness caused by timing, execution order, or shared/mutable state.
Mixing Selenium implicit and explicit waits in the same test is discouraged because it can:
  • A. Cause unpredictable, compounded wait times ✓
  • B. Disable JavaScript execution on the page
  • C. Prevent the browser from launching
  • D. Always double every element's locator
Correct answer: A. The two wait mechanisms can stack unpredictably, producing inconsistent and often longer waits.
An HTTP method is idempotent if:
  • A. It always returns a 200 status code
  • B. Multiple identical requests have the same effect as a single one ✓
  • C. It can only be called once per session
  • D. It never modifies server state under any condition
Correct answer: B. Idempotency means repeating the same request yields the same server state as making it once (e.g., PUT, DELETE).
According to the test automation pyramid, the largest number of tests should be:
  • A. End-to-end UI tests at the top
  • B. Manual exploratory tests
  • C. Performance tests
  • D. Unit tests at the base ✓
Correct answer: D. The pyramid advocates many fast, cheap unit tests at the base and few slow end-to-end tests at the top.
Mutation testing evaluates the quality of a test suite by:
  • A. Introducing small code changes and checking if tests catch them ✓
  • B. Measuring how many lines of code are executed
  • C. Randomly generating input data for fuzzing
  • D. Counting the number of assertions per test
Correct answer: A. Mutation testing injects small faults (mutants); a good suite should fail (kill) them, revealing weak tests.
A function has a cyclomatic complexity of 5. The minimum number of independent basis paths to cover is:
  • A. 1
  • B. 10
  • C. 5 ✓
  • D. 25
Correct answer: C. Cyclomatic complexity equals the number of independent paths, so 5 basis-path test cases are needed.
Why can a suite achieve 100% statement coverage yet still miss a decision outcome (branch)?
  • A. Statement coverage requires more tests than branch coverage
  • B. An if-statement with no else body has a branch with no statements to cover ✓
  • C. Branch coverage is always a subset of statement coverage
  • D. 100% statement coverage is impossible in practice
Correct answer: B. An if without an else has a false-branch containing no statements, so it can be skipped while all statements still execute.
Consumer-driven contract testing (e.g., Pact) primarily verifies that:
  • A. The database indexes are optimized
  • B. The UI renders correctly on mobile
  • C. The service can handle peak concurrent load
  • D. A service's API meets the expectations its consumers actually rely on ✓
Correct answer: D. Contract testing checks a provider against the exact request/response expectations its consumers depend on.
When running tests in parallel, the most common cause of intermittent failures is:
  • A. Shared mutable state such as a common database or global variables ✓
  • B. Having too few assertions
  • C. Using descriptive test names
  • D. Running on a faster CPU
Correct answer: A. Parallel tests that share mutable state (DB rows, globals, files) interfere with each other, causing nondeterministic failures.
Testing an integer field that stores a 32-bit signed value, the most important edge case to include is:
  • A. Only the value 0
  • B. Only negative single digits
  • C. 2147483647 and 2147483648 to check for overflow ✓
  • D. Only three-digit numbers
Correct answer: C. 2147483647 is the max signed 32-bit int, and 2147483648 crosses it, exposing potential integer overflow.
A test suite of 500 tests takes 40 minutes and blocks deploys. Which strategy BEST reduces feedback time without losing meaningful coverage?
  • A. Delete all integration tests
  • B. Parallelize tests and shard by execution time ✓
  • C. Run every test twice to confirm results
  • D. Convert all tests to manual
Correct answer: B. Parallelizing and sharding by historical runtime distributes work evenly across workers, cutting wall-clock time while keeping coverage.
Two independent conditions A and B each affect an outcome. To satisfy MC/DC (Modified Condition/Decision Coverage), you must show that:
  • A. Every combination of A and B is tested
  • B. Each condition independently affects the decision's outcome ✓
  • C. Only the true branch is exercised
  • D. The decision is evaluated at least once
Correct answer: B. MC/DC requires demonstrating that each condition independently toggles the overall decision outcome, avoiding full combinatorial explosion.
An automated UI test flakes because it clicks a button before an async XHR-triggered re-render completes. The MOST robust fix is to:
  • A. Add a fixed Thread.sleep(3000)
  • B. Wait explicitly for the post-render element/state to be present and stable ✓
  • C. Retry the whole test on failure
  • D. Disable JavaScript during the test
Correct answer: B. Explicitly waiting for the specific post-render condition synchronizes on actual application state rather than guessing with fixed delays.
You have 20 parameters each with 3 possible values. Exhaustive testing is impossible. Which technique gives strong defect detection with far fewer cases?
  • A. Random testing
  • B. Pairwise (all-pairs) combinatorial testing ✓
  • C. Boundary value analysis
  • D. Exploratory testing
Correct answer: B. Pairwise testing covers all two-way parameter interactions, catching most interaction defects with a fraction of exhaustive combinations.
In a flaky-test triage, a test fails only when run after a specific other test. The likely root cause is:
  • A. Insufficient assertions
  • B. Shared mutable state / test ordering dependency ✓
  • C. Too many parallel threads
  • D. A compiler optimization bug
Correct answer: B. Order-dependent failures typically stem from tests sharing mutable state (DB rows, globals) without proper isolation or cleanup.
A mutation testing run reports a mutation score of 40% while line coverage is 95%. What does this reveal?
  • A. The tests run too slowly
  • B. Tests execute the code but do not assert enough to catch behavioral changes ✓
  • C. The coverage tool is misconfigured
  • D. The code has no branches
Correct answer: B. High line coverage with low mutation score means code is exercised but assertions are weak, so injected faults survive undetected.
When testing a distributed system for eventual consistency, a test reads immediately after a write and sees stale data. The correct test design is to:
  • A. Assert the value once with no delay
  • B. Poll/retry with a bounded timeout until the expected value or timeout ✓
  • C. Mark the feature as defective
  • D. Disable replication during the test
Correct answer: B. Eventual consistency requires polling within a bounded window, since the correct value may appear only after replication propagates.
You are asked to reduce a regression suite that grew redundant. Which metric best guides which tests to keep for defect-finding value?
  • A. Alphabetical test name order
  • B. Historical fault detection and unique code/requirement coverage contribution ✓
  • C. Execution time only
  • D. Number of assertions per test
Correct answer: B. Test suite minimization keeps tests that add unique coverage and have historically caught defects, removing purely redundant ones.
A load test shows p50 latency is fine but p99 spikes badly under load. This pattern most commonly points to:
  • A. A steady CPU-bound bottleneck affecting all requests equally
  • B. Tail latency from contention like GC pauses, lock waits, or queueing ✓
  • C. A DNS caching problem
  • D. An incorrect test assertion
Correct answer: B. A healthy median with a bad p99 indicates tail-latency effects (GC pauses, lock contention, queueing) hitting a small fraction of requests.
In contract testing (e.g., consumer-driven contracts), what does the contract primarily protect against?
  • A. Slow database queries in the provider
  • B. Breaking API changes between a consumer and provider service ✓
  • C. Memory leaks in the consumer
  • D. UI rendering regressions
Correct answer: B. Consumer-driven contracts verify the provider still honors the request/response shape the consumer relies on, catching breaking API changes early.

Prep for another role

Questions are original, written and independently verified for HireHire's role interview quizzes. They reflect the kind of knowledge QA / Test Engineer interviews test, not any specific company's questions. HireHire maps live tech & IT jobs across India, updated regularly. Last updated: August 2026.