Skip to content

Agile, SQL and API Testing Interview Questions for Software Testing

54 Agile, SQL and API Testing questions with answers for software testing roles — 11 easy, 37 medium, 6 hard.

About Agile, SQL and API Testing

Covers Scrum ceremonies, user stories and acceptance criteria, SQL queries for validating data, and REST API testing with Postman, status codes and methods. These are now expected even for manual testers, and many interview rounds include a live SQL query or API question.

Sheet progressStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
3 questions free Unlock the rest in seconds
01

What is SQL and why do testers use it?

Save to ▾
Show answer
A language to query databases. Testers use it to verify data saved by the application, prepare test data and check backend results.
02

What is Agile testing?

Save to ▾
Show answer
Testing that is continuous and collaborative within each sprint, with testers working alongside developers and product owners from the start.
03

What is a user story and what are acceptance criteria?

Save to ▾
Show answer
A user story describes a feature from the user's view, usually as: As a role, I want a goal, so that a benefit. Acceptance criteria are the specific conditions the story must meet to be accepted, often written as Given, When, Then. For example, given a registered user, when they enter a wrong password three times, then the account is locked for 15 minutes. Testers use acceptance criteria as the base for test cases.
04

Tell me about a time you had to learn SQL or API testing quickly for a project.

Save to ▾
Show answer
Model answer: Situation: in my first project, testers had to verify orders in the database, and I knew only basic SELECT. Task: become useful within a week. Action: I practised joins on a copy of the test database every evening and asked a senior to review my queries. Result: by the second sprint I was validating order data on my own and caught a missing tax column bug.
05

What is the difference between Scrum and Kanban for a tester?

Save to ▾
Show answer
Scrum works in fixed sprints with planned scope, roles and ceremonies, so the tester plans testing for the sprint and aims to finish all stories by the sprint end. Kanban is a continuous flow with work-in-progress limits and no fixed sprints, so testing happens as each item reaches the test column. In Kanban, a tester watches that the testing column does not become a bottleneck and raises it when limits are hit.
06

SQL: find the second highest salary from an employees table.

Save to ▾
Show answer
SELECT MAX(salary) AS second_highest FROM employees WHERE salary < (SELECT MAX(salary) FROM employees); -- alternative using DENSE_RANK SELECT DISTINCT salary FROM ( SELECT salary, DENSE_RANK() OVER (ORDER BY salary DESC) AS rnk FROM employees ) t WHERE rnk = 2;
07

SQL: count today's orders by status.

Save to ▾
Show answer
SELECT status, COUNT(*) AS total FROM orders WHERE created_at >= CURRENT_DATE AND created_at < CURRENT_DATE + INTERVAL '1 day' GROUP BY status ORDER BY total DESC;
08

What is the difference between PUT and PATCH?

Save to ▾
Show answer
PUT replaces the whole resource with the data sent, so fields you leave out may be cleared or reset. PATCH applies a partial update and changes only the fields sent. For example, to change only a user's phone number, PATCH with just the phone field is enough, while PUT expects the complete user object. Testers check that PUT and PATCH behave as documented and that missing fields are handled correctly.
09

What is the difference between HTTP 401 and 403?

Save to ▾
Show answer
401 Unauthorized means the request has no valid authentication, such as a missing, expired or wrong token, so the client should log in again. 403 Forbidden means the user is authenticated but does not have permission for that resource, such as a normal user calling an admin API. Testers verify both: call without a token to expect 401, and call with a low-privilege token to expect 403.
10

What is the difference between path parameters, query parameters and the request body?

Save to ▾
Show answer
Path parameters identify a specific resource and are part of the URL, as in /users/42. Query parameters filter, sort or paginate and come after a question mark, as in /users?city=Pune&page=2. The request body carries data for creating or updating, usually JSON, in POST, PUT or PATCH. Testers check invalid values in each: a wrong ID in the path, unknown query parameters and missing body fields.
11

What are Postman environments and the Collection Runner?

Save to ▾
Show answer
An environment in Postman is a set of variables, such as base_url and token, that you switch to run the same requests against QA, staging or production-like setups without editing each request. The Collection Runner executes all requests in a collection in order, runs their test scripts and can repeat them with data from a CSV or JSON file. Together they give manual testers a first step into repeatable API automation.
12

What do you check when testing an API in Postman?

Save to ▾
Show answer
Status code, response body and schema, headers, response time, error messages for invalid input, authentication (401/403) and that data is saved in the database.
13

How do you test database integrity using SQL?

Save to ▾
Show answer
Verify inserted, updated and deleted rows match UI actions, check constraints, duplicates, NULLs and totals with COUNT and SUM queries.
14

What is a sprint retrospective?

Save to ▾
Show answer
A team meeting at the end of a sprint to discuss what went well, what did not and what to improve next.
15

What is CI/CD and how does testing fit?

Save to ▾
Show answer
Code is built and tested automatically on each change; tests are quality gates that stop faulty builds from moving forward.
16

What is API testing and why is it important?

Save to ▾
Show answer
Testing services directly without the UI, checking status codes, responses, security and performance. It finds issues early and is faster than UI tests.
17

What is the difference between DELETE and TRUNCATE?

Save to ▾
Show answer
DELETE removes selected rows and can be rolled back; TRUNCATE quickly removes all rows and resets the table.
18

How do you test pagination, sorting and filtering through an API?

Save to ▾
Show answer
Send page, size, sort and filter parameters, then verify counts, order, boundaries (first, last, empty page) and invalid parameter handling.
19

What is the use of SQL GROUP BY and HAVING in test validation?

Save to ▾
Show answer
They let testers verify totals and counts per category, such as the number of orders per customer, and compare them with the UI or reports.
20

Write SQL to verify an order was saved correctly.

Save to ▾
Show answer
SELECT status, amount FROM orders WHERE order_id = 'ORD123'; -- compare with the UI, then check the matching rows in order_items
21

SQL: find duplicate emails.

Save to ▾
Show answer
SELECT email, COUNT(*) FROM users GROUP BY email HAVING COUNT(*) > 1;
22

Explain SQL joins briefly.

Save to ▾
Show answer
INNER returns matching rows, LEFT keeps all left rows, RIGHT keeps all right rows and FULL keeps all rows from both tables.
23

Write a SQL query to find duplicate records.

Save to ▾
Show answer
SELECT email, COUNT(*) FROM users GROUP BY email HAVING COUNT(*) > 1;
24

What is a sprint planning meeting and what does QA contribute?

Save to ▾
Show answer
The team selects stories for the sprint. QA helps estimate testing effort, clarifies acceptance criteria and flags dependencies and risks.
25

What is a REST API?

Save to ▾
Show answer
An API style using HTTP methods on resources identified by URLs, usually exchanging JSON and staying stateless.
26

What is the difference between GET and POST?

Save to ▾
Show answer
GET retrieves data and has parameters in the URL; POST sends data in the body to create or process something.
27

What are SQL constraints?

Save to ▾
Show answer
Rules such as NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY and CHECK that keep data valid and consistent.
28

What are common HTTP status codes?

Save to ▾
Show answer
200 OK, 201 Created, 204 No Content, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 500 Internal Server Error.
29

Scrum ceremonies and the tester's role?

Save to ▾
Show answer
Sprint planning (estimate test effort), daily stand-up (status and blockers), sprint review (demo) and retrospective (improve). Testers clarify acceptance criteria early and test within the sprint.
30

What is the definition of done?

Save to ▾
Show answer
A shared checklist for when a story is complete, usually including code review, tests passing, no open critical bugs and documentation updated.
31

How do you test a REST API with authentication?

Save to ▾
Show answer
Check access with valid, expired and missing tokens, role-based permissions, error codes and that sensitive data is never exposed.
32

How do you test an API using Postman?

Save to ▾
Show answer
Create a request with method, URL, headers and body, send it, check status and body, add test scripts and save it in a collection.
33

What is TDD vs BDD?

Save to ▾
Show answer
TDD writes unit tests before code to drive design; BDD describes behaviour in business language scenarios that become automated acceptance tests.
34

What does INVEST mean for user stories?

Save to ▾
Show answer
INVEST is a checklist for good user stories: Independent, Negotiable, Valuable, Estimable, Small and Testable. For testers, testable is the most important: a story must have clear acceptance criteria so you can say pass or fail. Small stories are easier to test within a sprint. If a story fails INVEST, raise it in refinement rather than discovering the gaps during testing.
35

What is a Three Amigos session?

Save to ▾
Show answer
Three Amigos is a short meeting where a business person or product owner, a developer and a tester discuss a story before development. The business explains the need, the developer considers how to build it and the tester asks what could go wrong and how it will be verified. The output is clear acceptance criteria and example scenarios. It prevents misunderstandings and reduces bugs found late.
36

Describe how you contributed in a sprint retrospective to improve quality.

Save to ▾
Show answer
Model answer: Situation: our sprints kept ending with stories stuck in testing. Task: suggest a fix in the retrospective. Action: I showed that most stories reached QA in the last two days and proposed smaller stories, early test case sharing and developers deploying to QA daily. Result: the team tried it next sprint, and the number of stories carried over dropped from five to one.
37

SQL: find orders that have no matching customer record.

Save to ▾
Show answer
-- orphan orders indicate a broken foreign key or bad data load SELECT o.order_id, o.customer_id FROM orders o LEFT JOIN customers c ON c.customer_id = o.customer_id WHERE c.customer_id IS NULL;
38

SQL: verify that soft-deleted users do not appear in the active users list.

Save to ▾
Show answer
-- the active list query used by the app should return 0 rows here SELECT u.user_id, u.email FROM users u WHERE u.is_deleted = 1 AND u.user_id IN ( SELECT user_id FROM active_users_view );
39

Search works fine in QA but is very slow in production. Could a missing database index be the reason, and how do you check?

Save to ▾
Show answer
Yes, very likely. An index lets the database find rows quickly, like the index of a book. With a small QA table, a full table scan is still fast, but with millions of production rows it becomes slow. Compare indexes on the searched columns in both environments and ask a developer to check the query plan. Test key queries on production-size data in staging, and include data volume in future performance checks.
40

What is JSON schema validation in API testing?

Save to ▾
Show answer
JSON schema validation checks that a response has the expected structure: required fields are present, data types are correct, formats like email or date are valid and no unexpected fields appear. Instead of checking only one value, it protects against contract changes that break the app. In Postman you can validate a response against a schema in the test script, and run it on every request in a collection.
41

Write a Postman test script that checks the status is 201 and the response contains an id.

Save to ▾
Show answer
pm.test('Status is 201', function () { pm.response.to.have.status(201); }); pm.test('Response has id', function () { const body = pm.response.json(); pm.expect(body).to.have.property('id'); pm.expect(body.id).to.be.a('number'); });
42

How do you chain requests in Postman by passing a token from login to the next call?

Save to ▾
Show answer
// Tests tab of the Login request const body = pm.response.json(); pm.environment.set('authToken', body.token); // Next request header: // Authorization: Bearer {{authToken}} // Postman replaces {{authToken}} with the saved value
43

The UI shows the correct order total, but the database has a different value. What do you check?

Save to ▾
Show answer
Note the order ID and compare the UI value, the API response and the database value to find where they differ. Check if the UI calculates the total on the screen instead of using the saved value, whether taxes, discounts or rounding are applied at different layers and whether a later update job changed the record. Log the bug with all three values, because invoices and reports will use the database figure.
44

The sprint ends tomorrow and two stories are still in testing. What do you do?

Save to ▾
Show answer
Tell the Scrum Master and product owner today, not at the review. Focus testing on the acceptance criteria and the riskiest paths of the story with the most value, and ask a developer to help with test data or simple checks. If a story cannot be finished with quality, it should be carried over, not marked done with untested parts. Raise the cause in the retrospective, such as late handover.
45

An API returns 200 OK but the body contains an error message. Is that a bug?

Save to ▾
Show answer
Usually yes. Status codes should reflect the result so clients and monitoring can react correctly; an error with 200 can hide failures and break retries. A validation error should return 400 or 422, a missing resource 404 and a server failure 500. Check the API contract first: some legacy APIs document this pattern. If it is not documented, log it as a defect with the request and response attached.
46

How do you handle a product owner who keeps adding scope in the middle of a sprint?

Save to ▾
Show answer
Model answer: Situation: our product owner added two small changes to a story mid-sprint, which pushed testing to the last day. Task: protect quality without being rigid. Action: I showed the extra test effort in stand-up and asked the Scrum Master to help decide what to swap out. Result: one change moved to the next sprint, and the team agreed new requests go through the backlog.
47

SQL: find customers who placed more than three orders in the last 30 days.

Save to ▾
Show answer
SELECT c.id, c.name, COUNT(o.id) AS order_count FROM customers c JOIN orders o ON o.customer_id = c.id WHERE o.order_date >= CURRENT_DATE - INTERVAL '30' DAY GROUP BY c.id, c.name HAVING COUNT(o.id) > 3 ORDER BY order_count DESC;
48

How do you test API error handling for invalid input?

Save to ▾
Show answer
Send requests with missing required fields, wrong data types, values beyond limits, invalid formats such as a bad email, unknown fields and an empty or malformed JSON body. The API should return a 4xx code such as 400 or 422, a clear error message that names the field, and no stack trace or database details. Also check that nothing was partly saved in the database after the failed request.
49

How do you test a REST API that is not ready yet?

Save to ▾
Show answer
Use mocks or stubs from the API contract such as Swagger, write test cases early and validate again when the real service is available.
50

SQL: find orders whose total does not match the sum of their order items.

Save to ▾
Show answer
SELECT o.order_id, o.total_amount, SUM(i.quantity * i.unit_price) AS items_total FROM orders o JOIN order_items i ON i.order_id = o.order_id GROUP BY o.order_id, o.total_amount HAVING o.total_amount <> SUM(i.quantity * i.unit_price);
51

What is a database transaction and how do you test rollback?

Save to ▾
Show answer
A transaction groups several database operations so they all succeed or all fail together, following ACID properties. To test rollback, force a failure in the middle of a multi-step action, for example a money transfer where the credit step fails after the debit. Then query both accounts and confirm neither balance changed and no partial records exist. Also check the user sees a clear error and can retry safely.
52

What is idempotency in APIs and how do you test it?

Save to ▾
Show answer
An operation is idempotent if repeating the same request gives the same result as doing it once. GET, PUT and DELETE should be idempotent; POST usually is not. To test, send the same request several times and check the server state does not change after the first call. For payments, check that retrying with the same idempotency key does not create a second charge, which protects users during network retries.
53

How would you test rate limiting on a public API?

Save to ▾
Show answer
Find the documented limit, for example 100 requests per minute per key. Send requests just below and above the limit and check that extra requests get 429 Too Many Requests with a Retry-After header. Verify the counter resets after the window and that limits apply per key or per IP as designed. Check that one user hitting the limit does not block others, and that normal traffic is not throttled.
54

How would you set up a testing approach for a new Agile team with no QA process?

Save to ▾
Show answer
Start small. Agree on a definition of ready and definition of done that include acceptance criteria and testing. Join refinement and run Three Amigos for every story. Set up a simple bug workflow and severity guide in the tracker, a shared test case repository and a smoke checklist for each build. Then add API checks and automated regression for stable flows. Review what works in each retrospective and adjust.

Frequently asked questions

How important is Agile, SQL and API Testing in Software Testing interviews?

Covers Scrum ceremonies, user stories and acceptance criteria, SQL queries for validating data, and REST API testing with Postman, status codes and methods. These are now expected even for manual testers, and many interview rounds include a live SQL query or API question.

How should I use the Agile, SQL and API Testing sheet?

Go top to bottom — easy to hard. Answer before opening each answer, tick what you solved and save misses to Last-Minute Revision.