QA Engineer Interview Questions with Answers
An open guide for QA interviews: from test design and bug reports to APIs, SQL, automation and accepting changes. Explain your decisions through risk and observable behavior, not just through definitions.
Python 3.12 for the runnable examples; HTTP and SQL are checked on isolated test data. Defect scales are defined by each team.
Questions and answers
Junior: fundamentals
FundamentalsWhy is testing needed?
Testing provides information about a product's quality and risks against specific requirements and user expectations. It helps find defects, verify changes and make release decisions. A finite set of checks does not prove that there are no errors at all. So it is important to explain what exactly was checked, in which environment and which risks remain. The quality of the result depends not on the number of test cases but on how well the checks tell important variants of behavior apart.
- Example
- Before releasing payments, you check a successful payment, a decline, a repeated callback and an uncertain result.
- Common mistake
- Reporting “everything works” without naming the area that was checked and its limitations.
- Interviewer follow-up
- How do you choose what to check when little time is left before the release?
FundamentalsHow is verification different from validation?
Verification checks conformance to the stated requirements or specification. Validation assesses whether the product fits its intended use. The two questions are related but not the same: a formally correct implementation can solve the wrong user problem. In practice, it helps to combine contract checks with observing the real scenario. If a requirement is ambiguous, clarify it first instead of turning your own assumption into the only expected result.
- Example
- A form can match the mockup and still be impossible to complete with a keyboard for the target user.
- Common mistake
- Treating an approved document as proof that any implemented behavior is useful.
- Interviewer follow-up
- How do you record a contradiction you found in the requirements?
Types of checksHow is a test level different from a test type?
A level describes the scale and boundary of the system under test: a component, an interaction between components, the system or an acceptance scenario. A type describes an aspect of quality, such as functionality, performance or security. So an API check can belong to different levels depending on what is actually connected. A tool name is not enough: state the dependencies, the environment and the observable contract.
- Example
- An HTTP test with a stubbed service does not confirm an actual write to a production-like database.
- Common mistake
- Calling any browser test a full check of the whole system.
- Interviewer follow-up
- How does a contract test complement an integration test?
Test designHow do you apply boundary value analysis?
First define the ordered domain and the exact rules for including the boundaries. Then pick values on the boundary and immediately on both sides of it, where they exist. Integers call for one kind of examples, time and money amounts for another. The data representation needs checking too: an empty string, spaces or a fraction may belong to separate classes. You cannot mechanically pick min−1 without understanding the allowed type.
- Example
- For an age from 18 to 65 inclusive, you check 17, 18, 19, 64, 65 and 66.
- Common mistake
- Checking only 18 and 65 without confirming that the adjacent invalid values are rejected.
- Interviewer follow-up
- How does the set change for a subscription end date?
Test designWhat does equivalence partitioning give you?
The technique groups inputs that should be handled the same way under a chosen rule. You take a representative from each class to cut down on repetitive checks. The classes are a model, though: a mistake in building them can hide an important case. Valid and invalid data are considered separately, and then the technique is combined with boundaries and parameter interactions. All invalid values rarely form one useful class.
- Example
- For an item quantity, the classes may include a valid integer, zero, a negative number, a fraction and a string.
- Common mistake
- Picking one invalid string instead of analyzing the different reasons for rejection.
- Interviewer follow-up
- When are two valid values worth checking separately?
DefectsWhat should a reproducible bug report contain?
Give a short symptom, the environment and version, the required preconditions, the sequence of steps, and the actual and expected results. Attach the minimal data that reproduces the bug and safe logs or a recording. Tie the expected behavior to a requirement or a clearly stated agreement. If the bug is intermittent, its frequency, timing and the signs of successful and failed runs help. Unnecessary secrets and personal data stay out of the report.
- Example
- After “Pay” is pressed a second time, two orders are created instead of one — with the IDs of the test transactions.
- Common mistake
- Writing “doesn't work” without the version, the input data and the result.
- Interviewer follow-up
- How do you describe a defect if you have not found a way to reproduce it yet?
DefectsHow is severity different from priority?
Severity describes a defect's impact on the system or the user. Priority reflects the order of fixing it, taking into account the business, deadlines and how widespread the problem is. They do not have to match: a rare severe defect may be worked on in a different order than a visible issue in a current campaign. Scales depend on the team, so it is better to explain the consequences and the conditions under which the defect occurs than to argue only about the word critical. The final prioritization is agreed with the product owners.
- Example
- A wrong brand name on the home page can have a high priority without any critical impact on data.
- Common mistake
- Using severity as a way to make the team pick up a task faster.
- Interviewer follow-up
- What data helps you revisit the priority after the release?
HTTPHow do you tell 400, 401, 403 and 404 apart?
400 usually means a malformed request, 401 that proper authentication is required, 403 that access was denied while processing the request, and 404 that there is no accessible resource at the address. A particular API may deliberately hide the existence of a protected object behind 404. So you check the agreed contract, not just the popular interpretation of the code. The body, the headers and the absence of unwanted side effects also matter.
- Example
- A request for someone else's document must not return its contents, even if the response code looks like an error.
- Common mistake
- Checking only the status and missing a data leak in the body.
- Interviewer follow-up
- How do you test access for an anonymous user, the owner and another user?
Middle: putting them into practice
APIWhat should you check besides the HTTP code?
Check the schema and field types, which fields are required, the values, the headers, the system state and the access restrictions. For a mutation, make sure the result is saved and a retry did not create an unexpected duplicate. A negative response must leave the data in a consistent state. Lists need order, pagination and filters. Do not pin every optional field in the test if the contract allows the response to be extended.
- Example
- After creating an order, check that it can be read, who owns it and that there are no extra charges.
- Common mistake
- Treating any 200 as sufficient proof of a successful business operation.
- Interviewer follow-up
- How do you test API compatibility when new fields are added?
SQLWhy can COUNT(*) and COUNT(column) differ?
COUNT(*) counts the rows of the result, while COUNT(column) skips NULL in the chosen expression. This is especially visible after a LEFT JOIN: a user without orders still produces one joined row, but the order field in it is NULL. To count actual orders, count their non-null ID. Also account for the duplicates that appear when you join several one-to-many relationships. An aggregation error can look like an interface bug even though its source is in the query.
- Example
- For a user without orders, COUNT(order.id) is zero, while COUNT(*) after a LEFT JOIN can be one.
- Common mistake
- Adding DISTINCT at random instead of figuring out the cardinality of the joins.
- Interviewer follow-up
- How do you check the aggregation for zero, one and several orders?
ArchitectureHow do you separate a client error from a server error?
Trace the path of a specific operation: the user input, the actual network request, the response and how it is displayed. Match the time and the request ID with the server logs, if they are available. A correct response that is displayed incorrectly points to the client side; a wrong payload may have appeared before it reached the server. A direct API request helps narrow down the area, but it does not replace the browser scenario with cookies, redirects and security policies.
- Example
- A loading error in the interface may occur because the BFF received an HTML login page instead of JSON.
- Common mistake
- Blaming the backend right away based on a single message in the browser.
- Interviewer follow-up
- What data do you need to check an error that affects only some users?
Test designWhen do you need a decision table?
A table is useful when the result depends on a combination of conditions. First list the conditions and actions, then define the valid combinations and the expected result for each. This helps you find missing rules and contradictions. With a large number of factors, you do not have to check every mathematical combination: you can exclude the impossible ones and apply risk-based reduction. Such a reduction must be explained, however, and not treated as automatic proof of full coverage.
- Example
- Access depends on authorization, the subscription term and the remaining quota; each combination must have a clear decision.
- Common mistake
- Checking each flag separately and missing a conflict in their combination.
- Interviewer follow-up
- When is pairwise testing not enough for a critical business rule?
Test designHow do you test order states?
Describe the allowed states, the transitions, who initiates them and the constraints. Check not only the successful chain but also forbidden transitions, repeated events and events delivered out of order. One order can have several technical representations of its state that need to agree with each other. For asynchronous processing, it is important to tell an intermediate state from a final failure. A test must wait for a meaningful result within a bounded time, not for a random delay.
- Example
- A repeated paid notification must not grant access again, and a stale pending must not cancel a payment that is already confirmed.
- Common mistake
- Checking only the created → paid path without retries and races.
- Interviewer follow-up
- How do you test a callback that arrives before the checkout response?
AutomationWhat should you automate first?
Pick repeatable checks of important contracts that give a fast and clear signal. Consider the cost of preparing data, the stability of the environment and the cost of maintenance. It often pays to check most of the logic below the browser and leave E2E for critical end-to-end scenarios. Automating an unstable requirement can lock in accidental behavior. Manual exploration is useful for new risks that have not yet been turned into checks.
- Example
- First check the price calculation and a repeated payment event, then the visual details of a rarely visited page.
- Common mistake
- Choosing tests only by what is easiest to capture with a recorder.
- Interviewer follow-up
- How do you measure the value of automation beyond the number of tests?
Test dataHow do you make tests independent?
Each test must get clear initial data and not depend on the order in which tests run. Isolation comes from separate records, transactions, temporary directories or controlled services, depending on the test level. Cleanup must not delete anyone else's data. Random values are useful only if a failure can be reproduced. A global shared account with changing state often creates hidden links between tests.
- Example
- Parallel tests create different orders and check them by their own IDs.
- Common mistake
- Hoping that test A always runs before B and prepares the state for it.
- Interviewer follow-up
- When does a transactional rollback not isolate external effects?
Test reliabilityHow do you investigate a flaky test?
Save the evidence of the failure and classify the cause: a race, an unstable network, shared data, time, order or a product bug. A rerun shows the frequency but does not fix the source. A wait must be tied to an observable state and a bounded timeout. If the test detects a real race in the application, it must not be hidden by increasing a sleep. It helps to compare a successful and a failed trace of the same scenario.
- Example
- After submitting a form, you wait for the record or the status to appear, not just for two seconds.
- Common mistake
- Endlessly adding retries without analyzing the first failure.
- Interviewer follow-up
- How do you tell a problem in the test from an intermittent product defect?
Senior: trade-offs and reliability
StrategyHow do you plan testing for a risky change?
Determine which user operations and data are affected, what a failure would cost and how easy it would be to detect. Then choose checks at the changed boundary, at the neighboring integrations and in the critical scenarios. Keep rollback criteria and post-release monitoring in place. A full run of the old suite may not cover a new risk if it lacks the necessary state. The report must separate the checks performed, the known limitations and the residual risk.
- Example
- A change to payments requires checking retries, concurrent requests and that previously granted access is kept.
- Common mistake
- Replacing impact analysis with the phrase “all the old tests are green”.
- Interviewer follow-up
- Which checks are worth running after a production deploy?
PerformanceHow is a load test different from checking a single request?
A load test defines a user profile, intensity, duration and data. It shows the latency distribution, errors and resource usage when everything works at the same time. One fast request does not prove stability under load. Take into account warm-up, the limits of the load generator, background jobs and saturation of external dependencies. The success threshold is defined in advance for a specific scenario, and results are compared under comparable conditions.
- Example
- An average of 200 ms can hide slow responses for some users; you need percentiles and the error rate.
- Common mistake
- Raising the RPS until the load generator itself becomes the bottleneck and attributing the result to the server.
- Interviewer follow-up
- How do you tell the limit of the database from the limit of the application?
SecurityHow do you test access control?
Build a matrix of subjects, resources and actions: an anonymous user, the owner, another user, support and administrator roles. For each action, check that the server denies it, not just that the button is missing. Change object IDs and check lists, exports, attachments and side effects. Use a test environment you are allowed to test and your own data. Different routes to the same resource must follow the same policy.
- Example
- Another user must not be able to read a document by a known ID through a direct API request.
- Common mistake
- Treating a hidden button as an implementation of authorization.
- Interviewer follow-up
- How do you make sure a denial does not reveal content through extra fields?
AcceptanceWhen can a task be considered verified?
Definition-of-done criteria must link the requirement, the check and the result on a specific version. Record the local run, the integration check and the post-release observation separately. If part of the scenario depends on an external dashboard or hardware, it cannot be marked as done based on indirect signs. A useful summary lets the next person repeat the check and understand the remaining limitations. A count of executed cases without context is no substitute for evidence.
- Example
- A successful upload of a conversion to the API does not yet confirm that it is linked to a visit in the analytics report.
- Common mistake
- Closing the whole task after a green build when acceptance includes an external integration.
- Interviewer follow-up
- How do you document a blocker so that it does not hide the part that has already been verified?
Practical tasks
1. Design the checks for a form
A form accepts a name 1–50 characters long after trim and an integer age from 18 to 65 inclusive. List the classes, the boundaries and the negative cases.
Expected result. Covered: an empty name, spaces, lengths 1/50/51, valid and adjacent ages, a fraction and a string.
Solution and explanation
First pin down the normalization rules and the types. Then check each independent reason for rejection; separately, several errors at once and that the valid fields are kept.
def valid_profile(name, age):
return (
isinstance(name, str)
and 1 <= len(name.strip()) <= 50
and type(age) is int
and 18 <= age <= 65
)
assert valid_profile('Anna', 18)
assert valid_profile('x' * 50, 65)
assert not valid_profile(' ', 30)
assert not valid_profile('x' * 51, 30)
assert not valid_profile('Anna', 17)
assert not valid_profile('Anna', 66)
assert not valid_profile('Anna', 18.5)
assert not valid_profile('Anna', True)2. Check the contract of a create API
The API creates a task with a title 1–100 characters long and returns 201 with id and title. An invalid title gives 422 and creates no record. Write automated checks against a test service.
Expected result. Checked: the status, Content-Type, the shape of the response, reading the created object, the rejection and the absence of side effects.
Solution and explanation
Use a separate object for each test. In the negative scenario, compare the state before and after. A retry of the operation is tested separately, and only if the contract defines idempotency. The example is a skeleton of checks for your test service's client.
def check_created(response, read_by_id):
assert response.status_code == 201
assert response.headers['content-type'].startswith('application/json')
data = response.json()
assert isinstance(data['id'], str) and data['id']
assert data['title'] == 'Check the contract'
assert read_by_id(data['id'])['title'] == data['title']3. Find users without orders
There are tables users(id, name) and orders(id, user_id). Get all users with their order counts, including zero.
Expected result. For three users with 0, 1 and 2 orders, the result contains exactly three rows with the matching numbers.
Solution and explanation
LEFT JOIN keeps a user without orders. COUNT(o.id) does not count the NULLs from the right side. We group by ID and name so that the query is explicit and portable.
SELECT u.id, u.name, COUNT(o.id) AS order_count
FROM users AS u
LEFT JOIN orders AS o ON o.user_id = u.id
GROUP BY u.id, u.name
ORDER BY u.id;Seven-day preparation plan
- Write down the job requirements and mark the topics you know and the ones you don't.
- Answer the Junior questions out loud, then check yourself against the explanations.
- Work through the Middle questions. For every mistake, write a small example of your own.
- Solve the practical tasks without hints and check the edge cases.
- Work through the Senior questions and explain the trade-offs as they apply to your project.
- Run a mock interview: clarify the conditions, reason out loud and check your conclusions.
- Go over your mistakes, prepare real stories from your experience and check your equipment.