QA Fundamentals Middle cheat sheet: interview answers
Every question of this level with its correct answer and explanation, on one page for a quick review before the interview.
1. When is decision table testing most useful?
Correct answer: When the result depends on combinations of several conditions
A discount that depends on 'is member', 'order over 100' and 'has coupon' has 8 combinations. A decision table lists them all, so none is missed, and shows which can be merged.
2. A rule has 3 independent yes/no conditions. How many columns does a full decision table have?
Correct answer: 8
Each condition doubles the combinations: 2 × 2 × 2 = 8. Impossible or equivalent combinations can then be collapsed to reduce the number of tests.
3. When is state transition testing a good choice?
Correct answer: When behaviour depends on the current state, like an order's status
An order goes New → Paid → Shipped → Delivered, and some transitions must be impossible (Shipped → New). A state diagram shows valid and invalid transitions to test.
4. In state transition testing, why test invalid transitions?
Correct answer: The system must reject them, e.g. refunding an unpaid order
Bugs often allow actions in the wrong state: cancelling a delivered order, paying twice. Tests should check that such transitions are refused with a clear message.
5. What problem does pairwise (all-pairs) testing solve?
Correct answer: Too many parameter combinations to test them all
With 5 parameters of 4 values there are 1024 combinations. Pairwise picks a small set where every pair of values appears at least once, since most defects involve one or two parameters.
6. What is the main limitation of pairwise testing?
Correct answer: Bugs that need 3+ specific values together can be missed
Pairwise is a risk trade-off. For critical areas, teams may use 3-wise combinations or add targeted tests for known risky interactions.
7. What is use case testing?
Correct answer: Deriving tests from user interactions, including alternate flows
A use case describes a goal like 'buy a ticket' with a main flow and alternatives (card declined, seat taken). Each flow becomes a test scenario.
8. What is error guessing?
Correct answer: Designing tests from experience of where defects usually are
Experienced testers try typical failure points: empty input, double submit, special characters, slow network, timezone changes. It complements formal techniques.
9. What does statement coverage measure?
Correct answer: The share of code statements executed by tests
100% statement coverage means every line ran at least once. It doesn't mean every decision outcome was tested or that results were checked.
10. Why is branch coverage stronger than statement coverage?
if (isVip) price = price * 0.9; return price;Correct answer: It requires both the true and the false outcome to run
One test with
isVip = trueruns every line here (100% statements) but never tests the path where the discount is skipped. Branch coverage needs both.11. Why is high code coverage alone not proof of good tests?
Correct answer: Code can run in tests without its results being checked
A test that calls a function but asserts nothing still increases coverage. Mutation testing or reviewing assertions shows whether tests would actually catch bugs.
12. What is risk-based testing?
Correct answer: Prioritizing testing by likelihood and impact of failures
Risk = likelihood × impact. Payment and data loss risks get deep testing early; a rarely used settings page gets lighter checks.
13. Which two factors usually define the level of a product risk?
Correct answer: Likelihood of the problem and its impact
A likely failure with small impact and a rare failure with severe impact can both deserve attention. Scoring both helps rank what to test first.
14. What is the difference between a test plan and a test strategy?
Correct answer: A strategy sets the general approach; a plan applies it to a project
A strategy (often organization-wide) says which levels, types and tools to use and why. A test plan sets scope, schedule, people and environments for a specific release.
15. How can a tester estimate testing effort?
Correct answer: Break work into tasks and use past data, with a buffer for risk
Techniques include work breakdown, past metrics, three-point estimates and team-based estimation like Planning Poker. Estimates should state their assumptions.
16. What is the main idea of the agile testing quadrants?
Correct answer: Tests differ by purpose: support the team or critique the product
The quadrants combine business-facing vs technology-facing and supporting the team vs critiquing the product. They help ensure unit, functional, exploratory and non-functional testing all get attention.
17. What does BDD add to testing?
Correct answer: Shared examples in plain language that become executable tests
Behaviour-driven development brings product, development and testing together around concrete examples written as Given/When/Then, which tools like Cucumber can automate.
18. What does this Gherkin scenario describe?
Given a cart with 2 items When the user applies coupon "SAVE10" Then the total is reduced by 10%Correct answer: Context, action and expected outcome of one behaviour
Given sets up the state, When is the action, Then is the observable result. Good scenarios describe behaviour, not UI clicks, so they survive redesigns.
19. What is a common mistake when writing Gherkin scenarios?
Correct answer: Describing UI clicks instead of business behaviour
'When I click the blue button at the top' breaks with every redesign. 'When the user submits the order' expresses intent and keeps scenarios readable.
20. What is TDD?
Correct answer: Write a failing test first, make it pass, then refactor
Red, green, refactor: test-driven development produces small, testable units and a test for every behaviour. Testers benefit from the resulting fast safety net.
21. How does a test double such as a mock or stub help?
Correct answer: It replaces a real dependency so a test is fast and controlled
Replacing a payment gateway or email service with a double lets you test error paths (timeouts, declines) that are hard to trigger for real.
22. What is a risk of mocking too much?
Correct answer: Tests pass while the real integration is broken
A mock encodes assumptions about the other side. If the real API changes, the mocked tests stay green. Integration or contract tests catch that gap.
23. What does contract testing check?
Correct answer: That a consumer and a provider agree on their API's format
With consumer-driven contracts (for example Pact), the consumer records what it expects and the provider verifies it in its own pipeline, without a full end-to-end environment.
24. What is a common cause of flaky UI tests?
Correct answer: Fixed waits and timing assumptions about async behaviour
sleep(2000)may be enough locally and too short in CI. Waiting for a specific condition (an element, a response) makes tests stable and faster.25. How should a team handle a flaky test that can't be fixed today?
Correct answer: Quarantine it with an owner and track it until fixed
Quarantine keeps the main pipeline trustworthy while the flake stays visible. Deleting or endlessly retrying hides real problems, including real race conditions.
26. Why should tests not depend on each other's data?
Correct answer: Order changes or parallel runs make them fail randomly
If test B needs the user created by test A, B fails when run alone or before A. Each test should create or reset the data it needs.
27. How can a regression suite stay manageable as the product grows?
Correct answer: Prioritize by risk, remove obsolete tests and automate stable ones
Regression selection uses risk, recent changes and usage data. Reviewing the suite regularly removes duplicates and tests for removed features.
28. What is test impact analysis?
Correct answer: Choosing tests to run based on which code changed
Mapping tests to code lets CI run only affected tests for a small change, giving faster feedback, with the full suite run regularly as a safety net.
29. What does 'defect leakage' measure?
Correct answer: Defects that escaped testing and were found later, e.g. in production
Leakage shows how effective earlier stages were. Analysing escaped defects reveals gaps in test coverage or test levels.
30. What is defect removal efficiency (DRE)?
Correct answer: Defects found before release divided by all defects found
If 90 bugs were found before release and 10 after, DRE is 90 / 100 = 90%. Trends matter more than a single number.
31. Why is 'number of test cases executed' a weak quality metric?
Correct answer: It measures activity, not how well the product was tested
Running 500 shallow tests says less than 50 well-chosen ones. Useful metrics relate to risk, coverage of requirements and escaped defects.
32. What is root cause analysis for a defect?
Correct answer: Finding why the defect happened so similar ones are prevented
Techniques like the five whys go past 'a null check was missing' to 'requirements didn't mention empty carts and no review checklist covers it'.
33. What is session-based test management?
Correct answer: Time-boxed exploratory sessions with a charter and a debrief
A charter states the mission ('explore checkout with saved cards'), the tester explores for 60 to 90 minutes, notes findings and debriefs. It makes exploration measurable.
34. What is a test charter?
Correct answer: A short mission for an exploratory session
'Explore the password reset flow with expired and reused links to find security issues' gives focus without scripting each step.
35. What are test heuristics such as SFDPOT?
Correct answer: Memory aids that suggest what to explore in a product
SFDPOT (Structure, Function, Data, Platform, Operations, Time) prompts testers to look at the product from different angles so they don't miss whole areas.
36. What is mutation testing?
Correct answer: Changing code slightly to check that tests detect the change
If tests still pass after
>is changed to>=, they don't check that boundary. Tools like Stryker report the share of mutants killed.37. Why test the API directly instead of only through the UI?
Correct answer: It's faster, more stable and reaches cases the UI can't
Direct API tests can send invalid data the UI would block, check status codes and error bodies, and run in seconds. The UI can add its own validation and hide server bugs.
38. An API
PUTrequest is sent twice with the same body. What should a tester expect?Correct answer: The same final state, since PUT should be idempotent
PUT replaces a resource, so repeating it changes nothing further. POST is not idempotent and can create duplicates, which is why retries need care.
39. What should be checked in an API error response besides the status code?
Correct answer: A clear, consistent error body without internal details
Clients need a stable error format (code, message, fields). Stack traces, SQL or file paths leak internals and are a security finding.
40. Why should a tester check data in the database after a UI action?
Correct answer: The UI may show success while wrong data was saved
A form may display 'Saved' while storing a wrong date format, losing a field or creating duplicates. A quick SQL query verifies the real outcome.
41. How do logs help when testing?
Correct answer: They show errors and the flow of a request behind the UI
Server and browser console logs reveal hidden errors, retries and warnings. A correlation or request ID lets you find the exact request in the logs.
42. What is a feature flag, and what does it mean for testing?
Correct answer: A switch for a feature; both on and off states need testing
Flags let teams ship code hidden and enable it gradually. Testers check both states, transitions between them, and that old flags are cleaned up.
43. What is the difference between load, stress, spike and soak tests?
Correct answer: Expected load, beyond limits, sudden jumps, long duration
Each answers a different question: does it handle normal peak, where does it break, does it survive bursts, does it degrade over hours (memory leaks).
44. Why are percentiles like p95 preferred over the average response time?
Correct answer: Averages hide slow requests that many users still feel
An average of 200 ms can hide 5% of requests taking 4 seconds. p95 says 95% of requests were at least that fast, which reflects real experience better.
45. What should be agreed before running a performance test?
Correct answer: Goals, a realistic workload and a production-like setup
Without goals ('p95 under 500 ms at 200 RPS') and realistic traffic patterns, results can't be interpreted. Testing on a tiny environment gives misleading numbers.
46. What is a typical check for broken access control?
Correct answer: Calling an admin API with a regular user's token
Hiding a button in the UI isn't protection. The server must reject requests from users without the right role or ownership.
47. Which input can reveal an XSS problem?
Correct answer:
<script>alert(1)</script>in a field that is shown laterIf the text is rendered as HTML instead of plain text, the script runs. Testers check that such input is displayed literally or safely escaped.
48. What is special about testing mobile apps compared to web?
Correct answer: Interruptions, permissions, network changes and device diversity
Calls, low battery, switching from Wi-Fi to 4G, rotating the screen, denying permissions and many OS versions all create cases web testing rarely meets.
49. How should a tester choose browsers and devices to test on?
Correct answer: Use real usage analytics and risk to build a support matrix
Analytics show which browsers and screen sizes users actually have. Cloud device farms help cover the matrix without owning every device.
50. What are common accessibility checks a tester can do without special tools?
Correct answer: Use only the keyboard, zoom to 200% and check focus and labels
Many serious barriers show up quickly: unreachable buttons, invisible focus, missing labels, text that breaks when zoomed. Screen reader checks go further.
51. What is usability heuristic evaluation?
Correct answer: Experts check a UI against established usability principles
Nielsen's 10 heuristics (visibility of status, error prevention, consistency...) let a tester spot usability problems early, before formal user testing.
52. What is the role of a test summary report?
Correct answer: Summarize results, risks and quality for stakeholders' decisions
Stakeholders need a clear picture: what was tested, what wasn't, open risks and defects, and a recommendation. Raw execution logs don't help them decide.
53. What is a defect triage meeting for?
Correct answer: Agreeing priority, severity and owners for new defects
Triage gives each bug a decision: fix now, later, won't fix or needs more information. It keeps the backlog meaningful.
54. A developer marks your bug 'works as designed'. What is a good next step?
Correct answer: Check the requirement and discuss it with the product owner
Sometimes the design itself is the problem. The product owner decides whether behaviour should change, and the decision is recorded in the ticket.
55. Why do testers and developers pair on testing?
Correct answer: Combining skills finds issues faster and spreads knowledge
A developer knows the code; a tester knows risks and edge cases. Pairing on test design or exploration shortens feedback loops.
56. What is shift-right testing?
Correct answer: Testing and monitoring in production, e.g. canaries and A/B tests
Some risks only show up with real traffic and data. Monitoring, synthetic checks, feature flags and canary releases make production a source of quality feedback.
57. What is a canary release?
Correct answer: Releasing to a small share of users first and watching metrics
If errors or latency rise for the canary group, the rollout stops before most users are affected. It limits the blast radius of bugs testing missed.
58. Why should test environments be reproducible?
Correct answer: So results don't depend on manual setup that drifts
Infrastructure as code, containers and seeded data make environments the same each time, reducing 'only fails on staging' surprises.
59. What is service virtualization used for?
Correct answer: Simulating dependencies that are unavailable or costly to use
If a partner API is down, rate-limited or charges per call, a virtual service returns realistic responses, including errors, so testing can continue.
60. Why shouldn't production personal data be copied into test environments as is?
Correct answer: It risks leaks and breaks privacy laws like GDPR
Test environments usually have weaker security. Use synthetic data or anonymized and masked copies instead.
61. What does 'testability' mean for a feature?
Correct answer: How easy it is to control, observe and check its behaviour
Test IDs, logs, APIs to set up state and deterministic time make a feature easier to test. Testers can ask for these early.
62. How do the terms 'test condition' and 'test case' differ?
Correct answer: A condition is what to test; a case is how, with data and steps
'Discount applies to members' is a condition. A test case adds the concrete member, cart, steps and expected total.
63. What is the purpose of a requirements review checklist?
Correct answer: To catch ambiguity, gaps and untestable statements early
Questions like 'is it measurable?', 'what about errors?', 'who is the user?' turn vague requirements into testable ones.
64. Which phrase in a requirement is a red flag for testability?
Correct answer: 'The page should load fast'
'Fast' means different things to different people and can't be verified. A testable requirement has a clear, measurable criterion.
65. What does 'equivalence class' mean for a dropdown of countries?
Correct answer: Groups like EU, non-EU and sanctioned countries that behave alike
If tax rules differ by region, one representative per group covers the logic, plus any special cases the business names.
66. Why test with special characters and different languages in text fields?
Correct answer: Encoding, escaping and length bugs often appear with them
Names like
O'Brien, emoji, Cyrillic or Arabic text and very long strings find SQL escaping bugs, broken layouts and truncated data.67. What is the main goal of a smoke suite in CI?
Correct answer: Fast feedback that a build is deployable and testable
A smoke suite runs in minutes after each deployment. If it fails, the team stops before spending time on deeper testing.
68. How do quality gates in a pipeline help?
Correct answer: They block a release if agreed checks don't pass
Gates can require passing tests, coverage on new code, no critical vulnerabilities or a green smoke suite before promoting a build.
69. Why are tests at many levels needed instead of only end-to-end tests?
Correct answer: E2E tests are slow and hard to debug when they fail
When an E2E test fails, the cause could be anywhere. Lower-level tests localize failures and run in seconds, so E2E covers only key journeys.
70. What does the 'testing trophy' emphasize compared to the pyramid?
Correct answer: More integration tests, since they give the best confidence per cost
Kent C. Dodds argues that integration tests resemble real use more than unit tests while staying faster than E2E. Static analysis forms the base.
71. What is a good practice for test case names or titles?
Correct answer: Describe the behaviour and the expected result
'Rejects coupon after expiry date' tells anyone what broke when it fails. 'Test 42' forces them to open the code.
72. When should a tester stop exploratory testing of a feature?
Correct answer: When the charter's mission is covered and new findings dry up
Time boxes and coverage notes guide the decision. If each new idea yields nothing new, it's time to report and move on.
73. Why should automated tests have clear failure messages?
Correct answer: People can diagnose failures without rerunning tests
'Expected total 90, got 100 for VIP user' saves hours compared to 'assertion failed'. Screenshots, logs and traces help too.
74. What is a 'definition of ready' for a story from a tester's point of view?
Correct answer: Acceptance criteria are clear and testable before work starts
Starting work on a vague story leads to rework. Testers help refine stories so 'done' can be checked objectively.
75. What is a bug bash?
Correct answer: A time-boxed session where the whole team tests a feature together
Developers, designers and product people bring fresh eyes and different habits, often finding issues testers missed. Findings are triaged afterwards like any other bugs.