Skip to content
Tutorials Center
My learning

Topics

Lesson 58 of 60 ยท Practice and Interview Prep

Software Testing Interview Questions

Prepare for a manual testing interview: fundamentals, test design, process and scenario questions with model answers, plus a flashcard checker and a how-would-you-test planner.

A testing interview usually has three parts: questions about vocabulary and ideas ("what is regression testing?"), a technique exercise ("design tests for this form"), and a scenario ("you find a critical bug an hour before release"). Interviewers are not looking for memorized definitions. They want to hear that you can think clearly, give an example, and be honest about trade-offs.

This lesson collects the questions that come up most often, grouped by topic, with model answers written to be spoken in under a minute. Treat the answers as a pattern to adapt, not a script to recite; use your own examples from the projects in this track. The code editors at the end are stand-ins that help you practice: a flashcard checker and a planner for the dreaded "how would you test a pen?" question.

A good answer has three parts

Define One clear sentence.
Example A concrete case, ideally from your own work.
Trade-off When it does not apply or what it costs.
1 / 2

Fundamentals

1. What is software testing, and why is it needed? Testing is the activity of checking software against what it should do and what users need, in order to find defects and give information about quality and risk. It is needed because people make mistakes and software is complex, so some defects are guaranteed, and finding them before customers do is far cheaper. Testing cannot prove there are no defects; it reduces risk. See What Is Software Testing?.

2. What is the difference between an error, a defect and a failure? A person makes an error (a mistake), which puts a defect (a bug, a fault) into the code or a document, and when that defect is executed under the right conditions the system shows a failure, a visible deviation from expected behaviour. Not every defect causes a failure, because some sit in code that is never run.

3. What is the difference between verification and validation? Verification asks "are we building the product right?": does it match the specification, checked by reviews and inspections, often without running anything. Validation asks "are we building the right product?": does it meet real user needs, checked by running the software and often with users. A product can pass verification and fail validation if the specification itself was wrong.

4. How do QA, QC and testing differ? Quality assurance is about the process: preventing defects through standards, reviews and good practices. Quality control is about the product: finding defects in what has been built. Testing is the main QC activity. In small teams one person does all three, but the questions are different. See QA, QC and Testing.

5. Name some of the seven testing principles and give an example. Testing shows the presence of defects, not their absence. Exhaustive testing is impossible, so you prioritize by risk. Test early, because late defects cost more. Defects cluster in a few modules. The pesticide paradox says repeated tests stop finding new bugs, so tests must be refreshed. Testing depends on context (a pacemaker is tested differently from a game). And "absence of errors" is a fallacy: a bug-free product that does not meet the user's needs is still a failure. See The Seven Testing Principles.

6. What are the test levels and test types? Levels say where in the build-up you test: unit, integration, system and acceptance. Types say what you test: functional behaviour, non-functional qualities such as performance and security, structure (coverage), and change-related testing (confirmation and regression). A single test can be described by both, for example "a functional test at system level". See Test Levels and Test Types.

Test design techniques

7. Explain equivalence partitioning and boundary value analysis with an example. Partitioning divides inputs into groups that the system should treat the same way, so one value represents each group. For an age field accepting 18 to 65, the partitions are below 18, 18 to 65 and above 65. Boundary analysis adds values at the edges, where off-by-one mistakes live: 17, 18, 65 and 66. Together they give broad coverage with few tests. See Equivalence Partitioning and Boundary Value Analysis.

8. When do you use a decision table? When the outcome depends on a combination of several conditions, such as discount rules based on membership, order size and coupon. List every combination of conditions as columns, state the expected action for each, and collapse rules where a condition does not matter. It makes sure no combination is forgotten. See Decision Table Testing.

9. What is state transition testing? It models behaviour that depends on history as states, events and transitions, for example an order that is New, Paid, Shipped or Cancelled. You test every valid transition and also the invalid ones, which must be rejected without changing the state. It finds bugs such as shipping a cancelled order. See State Transition Testing.

10. What is the difference between black-box, white-box and experience-based testing? Black-box tests come from requirements without looking at the code. White-box tests come from the code's structure, for example to cover every branch. Experience-based testing relies on the tester's knowledge, such as error guessing and exploratory sessions. A good plan mixes them. See White-Box Testing and Code Coverage and Experience-Based Testing.

11. Does 100% code coverage mean the code is bug-free? No. Coverage only tells you which code ran during the tests, not whether the results were checked or whether requirements are missing. A test with no assertions can reach 100% coverage and find nothing. Missing features, wrong requirements and bad data cannot be found by covering code that does not exist.

Process and defects

12. What is the difference between a test strategy, a test plan, a test scenario and a test case? The strategy is the high-level approach, usually organization-wide. The plan applies it to one project: scope, schedule, resources, risks, entry and exit criteria. A scenario is a situation to test ("a member buys with a coupon"), and a test case is the detailed version with preconditions, steps, data and expected result. See Test Strategy and Test Plan.

13. What is the difference between severity and priority? Give an example. Severity is the technical damage a defect does; priority is how soon the business wants it fixed. A typo in the company name on the home page is low severity but can be high priority before a launch. A crash in a rarely used export tool can be high severity but lower priority. See Writing Excellent Bug Reports.

14. Explain smoke, sanity, regression and confirmation testing. Smoke testing is a quick check that the critical functions of a new build work, to decide if deeper testing is worth starting. Sanity testing is a narrow check that a specific fix or change behaves sensibly. Confirmation testing (retesting) reruns the failed test to confirm the defect is fixed. Regression testing reruns existing tests to check that a change broke nothing else. See Test Execution and Result Tracking.

15. What is the defect life cycle? A defect is reported as New, reviewed in triage, assigned to a developer, fixed, then retested by a tester and either verified and closed, or reopened if it still fails. Some tools also have states for duplicate, rejected and deferred. See Defect Lifecycle and Quality Metrics.

16. How do you decide when to stop testing? Not when you run out of ideas, but when the exit criteria in the plan are met, for example all high-risk cases executed, no open critical defects, and an agreed pass rate. In practice, time and budget also matter, so I make the remaining risk visible and let the owner decide. See Risk-Based Testing.

17. What is defect leakage? The share of defects that escaped to production out of all defects found: defects found by users divided by defects found before and after release. A rising value tells you the testing is missing something, and the details show where.

Scenario questions

18. You find a critical bug one hour before release. What do you do? Verify that it is reproducible and gather evidence. Tell the right people immediately, with the impact in plain words: who is affected and what the consequences are. Do not decide to cancel the release alone, since the product owner owns that call. Offer options such as a fix, a workaround or a limited rollout, and retest the fix and the surrounding area if one is made.

19. A developer says your bug is "not a bug". How do you react? Stay factual. Re-read the requirement and check whether my expectation was based on it. Reproduce the problem again and show the evidence. If the requirement is unclear, ask the product owner to decide, and then update the report with the outcome. Disagreement is resolved by the requirement, not by who is more senior.

20. How would you test a login page? Start by asking about the rules: password policy, lockout, supported browsers, "remember me". Then cover valid login, wrong password and unknown user (with the same message, to avoid leaking which accounts exist), empty fields, length boundaries, spaces and special characters, case sensitivity, lockout after repeated failures, password reset, session expiry and logout, keyboard use and error message clarity, response time, and security (no password in the URL, protection from injection). See Project: Test a Login Form.

21. How would you test a pen (or an elevator)? Ask what the pen is for and who uses it, then walk through lenses: function (writes on paper, ink flows), boundaries (very light and hard pressure, upside down), invalid use (cold, wet, on glass), usability (grip, clicking), durability (drop, long writing), safety (non-toxic ink, cap hazards) and compatibility (different paper). Showing a structured approach matters more than any single test idea.

For "how would you test X" questions, say your assumptions aloud and ask clarifying questions first. Interviewers often hide the real test in how you handle unclear requirements.

Automation testing questions

22. When would you automate a test, and when would you not? Automate tests that are repeated often (regression, smoke), stable, data-heavy or tedious by hand, and that give clear pass or fail answers. Do not automate tests that run once, change every week, depend on human judgement (look and feel, usability), or cost more to maintain than they save. Exploratory testing stays manual. See When to Automate.

23. What is a test automation framework, and which types do you know? A framework is the structure around automated tests: conventions, reusable functions, data handling, configuration and reporting. Types: linear (record and playback), modular, data-driven, keyword-driven, hybrid and BDD. See Automation Frameworks.

24. What is the Page Object Model and why use it? Each page or component gets a class that owns its locators and exposes actions in business language. Tests call those methods and never touch locators, so a UI change is fixed in one place and tests read like user stories. Assertions generally stay in the tests.

25. What makes UI tests flaky, and how do you fix them? Common causes: fixed sleeps instead of waiting for conditions, unstable locators, shared or leftover test data, dependence on test order, slow or unreliable environments, animations and third-party content. Fixes: wait for conditions, use test ids or accessible roles, create data per test, make tests independent, mock external services, and quarantine then repair flaky tests quickly.

26. Compare Selenium, Cypress and Playwright. Selenium uses the WebDriver standard, supports many languages and all major browsers, but you assemble waits, runner and reports yourself. Cypress runs inside the browser with automatic waiting and a great debugging runner, JavaScript and TypeScript only. Playwright drives Chromium, Firefox and WebKit through their protocols with auto-waiting, parallelism and tracing built in. See Selenium, Cypress and Playwright.

27. What is a headless browser, and when would you not use it? A browser that runs without a visible window, which is faster and suits CI. Use a headed browser when debugging, when you need to watch an interaction, or when you must check something that behaves differently in headless mode, and run samples on real browsers before release.

28. How do you decide which tests go in the CI pipeline? Fast, reliable checks (unit, API, smoke) run on every change and block the merge on failure; slower suites (broad UI regression, performance, security scans) run nightly or on a schedule or in parallel. Keep the main feedback loop short and make every red build actionable. See the automation life cycle.

29. What would you measure to judge an automation effort? Run time, pass rate and flakiness rate, defects found by automation, automation coverage of critical flows, maintenance time per release and effort saved compared with manual execution. Beware of counting test numbers alone.

30. What is the difference between a mock, a stub and a fake? A stub returns canned answers. A mock also verifies how it was used. A fake is a simplified working version such as an in-memory database. See Unit Testing Frameworks.

31. How do you handle test data in automation? Create the data each test needs (through an API or a database seed), use unique values to avoid collisions, clean up afterwards or use disposable environments, and keep data files under version control. Avoid depending on records that someone created by hand.

32. What is BDD, and what does Gherkin look like? Behavior-driven development writes examples of behavior in plain language that the whole team agrees on and automation runs. Gherkin uses Given (context), When (action), Then (outcome). See TDD vs BDD.

API testing questions

33. What do you check when testing a REST API? Status codes, response body fields and types, headers, validation errors, authentication and authorization, idempotency of PUT and DELETE, pagination, filtering and sorting, rate limits, error format, performance, and behaviour with missing, malformed or oversized input. See API and Database Checks.

34. What is the difference between 401 and 403? 401 means the caller is not authenticated (missing or invalid credentials). 403 means the caller is authenticated but not permitted to do this.

35. What is the difference between PUT, PATCH and POST? POST usually creates a resource or triggers an action and is not idempotent. PUT replaces a resource and is idempotent. PATCH changes part of a resource. A retried POST may create duplicates unless the API uses an idempotency key.

36. What status code should a successful create return, and what else should you check? 201 Created, normally with a Location header or the new resource's ID in the body. Then read the resource back with GET, and check the stored data.

37. What is contract testing? Checking that a provider and its consumers keep their agreement on request and response shapes, using a schema (OpenAPI) or consumer-driven contracts. It catches breaking changes without running full end-to-end tests.

38. How would you test API authentication? No token, invalid token, expired token, tampered token, a token for another user (object-level access), insufficient role or scope, token revocation after logout or password change, and whether secrets leak in URLs or logs.

39. What tools do you use for API testing? Manual exploration with Postman or a similar client, scripted checks in a test framework with an HTTP library, schema validation, and load tools for performance. The tool matters less than the checks. See API testing strategy.

40. A request returns 200 but the data is wrong. What do you do? Compare against the specification and the database, narrow down which layer is wrong (request, business logic, storage, serialization), capture the exact request and response, then report with those details. A status code alone is never enough to call a response correct.

41. How do you test an API that depends on another unfinished service? Use a stub or mock server that returns agreed responses (including errors and slow replies), test against the contract, and replace it with the real service when it is ready.

42. What is the difference between API testing and UI testing? API tests call the interface directly, so they are faster, more stable and easier to diagnose, and they test business logic without the browser. UI tests check what the user sees and the whole chain, but are slower and more brittle. Prefer many API tests and a few UI tests (the test pyramid).

Practice: flashcards with a keyword checker

Reading answers is not the same as producing them. The stand-in below holds six questions, each with groups of key ideas. It scans your written answer for words from each group and tells you which ideas you covered. It is a crude check, because it cannot judge whether your answer is correct, only whether it touches the key ideas. Edit the answers, add your own words and run it again.

JS Check your answers against key ideas

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The checker gives full marks for questions 1, 2 and 6 and exposes the thin ones: question 3 mentions only the smoke half, question 4 lacks the "just below and above" idea, and question 5 is empty. Use it to find gaps, then say the answers aloud.

Practice: structuring "how would you test X?"

The best preparation for scenario questions is a checklist of lenses you apply every time, so you never freeze. The stand-in below holds a lens list and the notes for three objects, and reports which lenses an answer covers. The notes are short on purpose: in an interview, one concrete idea per lens is enough.

JS Cover every lens when testing an object

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The pen covers all eight lenses, the elevator misses only compatibility (a lens that matters little for a lift), and the login form shows how an answer that stops after four ideas leaves four lenses unspoken. Add your own lines to the login form and run it again until the gaps close.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. Which statement about verification and validation is correct?

    Verification: 'are we building the product right?' (against the specification). Validation: 'are we building the right product?' (against user needs).
  2. 2. An interviewer asks how you would test a vending machine. What is the strongest first move?

    Clarifying assumptions and organizing ideas shows structured thinking, which interviewers value more than a long unordered list.
  3. 3. You find a critical bug an hour before release. What is the right behaviour?

    Testers give accurate information and options; the owner decides about the release.
  4. 4. A team reaches 100% statement coverage. Which conclusion is justified?

    Coverage measures which code ran, not whether results were checked or whether requirements are covered. Statement coverage does not even imply full branch coverage.
  5. 5. What does defect leakage measure?

    Leakage is escaped defects divided by all defects found, and it shows how much testing before release missed.

Summary

  • A strong answer defines the term in one sentence, gives an example and mentions a trade-off.
  • Know the fundamentals cold: error, defect, failure; verification and validation; QA, QC and testing; the seven principles; levels and types.
  • Be ready to apply partitions, boundaries, decision tables and state models to a small specification in a few minutes.
  • For process questions, tie answers to risk, exit criteria and the owner's decision.
  • For "how would you test X", clarify first, then walk through lenses: function, boundaries, invalid use, usability, performance, security, compatibility and recovery.

Continue with Software Testing Cheat Sheet.