SoftwareTestPilot
32 Q&A

API Testing Interview Questions and Answers PDF: 30 Questions to Revise

API testing interview questions and answers in a print-ready format: 30 questions on HTTP methods, status codes, auth, Postman, REST Assured, schema checks and scenarios, plus a 7-day PDF revision plan.

  • 7 min read
  • Difficulty: Mixed (Easy → Hard)
  • Freshers → Experienced
  • Updated November 2, 2026
  • SoftwareTestPilot
SoftwareTestPilot
QA Editorial Team
Published:
0 / 32 reviewed
0%

1. How to Get This as a PDF (and Which PDF to Choose)

Easy Very Common 1 minQ1 / 32

Q1.Option A: Save this page as a PDF (free)

Asked byPostmanPayPalZohoTwilio
Why interviewers ask this

This API Testing question checks whether you can go beyond textbook knowledge on Option A: Save this page as a PDF (free) and reason about it the way a working QA engineer does — with a definition, an example, and the edge case that usually comes up next.

Detailed explanation
  1. Open this article on a laptop or desktop.
  2. Press Ctrl+P (Windows/Linux) or Cmd+P (Mac).
  3. Choose Save as PDF as the destination and click Save.

On a phone, use the browser's Share or menu button and pick Print, then Save as PDF.

Tips to remember
  • Anchor the answer in a real API Testing project — panels reward specificity on Option A: Save this page as a PDF (free) over textbook wording.
  • Group the Option A: Save this page as a PDF (free) points into 2–3 buckets so you can recall them under pressure without missing one.
  • Close with status code + schema + auth as the three things you'd assert on every response.
RelatedQ3
Medium Very Common 1 minQ2 / 32

Q2.Option B: The longer PDFs in the QA Notes Vault (paid)

Asked byStripePostmanPayPalZoho
Why interviewers ask this

This API Testing question checks whether you can go beyond textbook knowledge on Option B: The longer PDFs in the QA Notes Vault (paid) and reason about it the way a working QA engineer does — with a definition, an example, and the edge case that usually comes up next.

Detailed explanation

If you want more questions in a designed document, these PDFs are in our library. The first pages of each can be previewed free before you decide:

Option A is enough for a quick revision. Choose a Vault PDF only if you want more volume or depth.

Tips to remember
  • Anchor the answer in a real API Testing project — panels reward specificity on Option B: The longer PDFs in the QA Notes Vault (paid) over textbook wording.
  • Group the Option B: The longer PDFs in the QA Notes Vault (paid) points into 2–3 buckets so you can recall them under pressure without missing one.
  • Assert status, schema and business payload — naming all three signals you test contracts, not just happy paths.
Confidence check

If you can confidently answer the How to Get This as a PDF (and Which PDF to Choose) questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

2. API and HTTP Basics (Questions 1 to 6)

Easy Very Common 1 minQ3 / 32

Q3.What is API testing?

Asked byZohoTwilioAmazonFreshworks
Why interviewers ask this

Interviewers open with "API testing" to confirm you can define the concept in one crisp line before going deeper. In API Testing rounds this filters out candidates who only remember syntax and can't articulate the underlying idea to a non-expert teammate.

Detailed explanation

Answer: API testing checks an application's business logic directly through its interface, by sending requests and checking the responses, without using the UI. You check status codes, response body, headers, response time, error handling and security. It finds bugs earlier and runs much faster than UI tests.

Tips to remember
  • Open with a one-sentence definition of API testing, then a concrete API Testing example — never start with history or theory.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise API testing cleanly.
  • Assert status, schema and business payload — naming all three signals you test contracts, not just happy paths.
Easy Very Common 1 minQ4 / 32

Q4.What is REST?

Asked byPayPalZohoTwilioAmazon
Why interviewers ask this

Interviewers open with "REST" to confirm you can define the concept in one crisp line before going deeper. In API Testing rounds this filters out candidates who only remember syntax and can't articulate the underlying idea to a non-expert teammate.

Detailed explanation

Answer: REST is an architectural style for APIs. Resources are identified by URLs, you act on them with standard HTTP methods, requests are stateless (each one carries everything the server needs), and data is usually sent as JSON.

Tips to remember
  • Open with a one-sentence definition of REST, then a concrete API Testing example — never start with history or theory.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise REST cleanly.
  • Assert status, schema and business payload — naming all three signals you test contracts, not just happy paths.
Easy Very Common 1 minQ5 / 32

Q5.REST vs SOAP?

Asked byAmazonFreshworksRazorpayStripe
Why interviewers ask this

Comparison questions like this test whether you understand REST vs SOAP at a design level — not just that both exist, but when to pick one over the other. Panels use it to see if you can defend a trade-off with a real project example.

Detailed explanation

Answer: SOAP is a protocol that uses XML messages with a strict contract (WSDL) and built-in standards such as WS-Security. REST is a style, lighter, usually JSON, and works directly over HTTP methods. Most modern web and mobile APIs are REST; SOAP is still common in banking and older enterprise systems.

Tips to remember
  • Structure the answer as a small table in your head: dimension, option A, option B — and close with "I'd pick X when Y".
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise REST vs SOAP cleanly.
  • Assert status, schema and business payload — naming all three signals you test contracts, not just happy paths.
Easy Very Common 1 minQ6 / 32

Q6.Explain the main HTTP methods.

Asked byTwilioAmazonFreshworksRazorpay
Why interviewers ask this

Open-ended "explain main HTTP methods" prompts test how you structure a technical answer under pressure. Panels look for a clear opening definition, one worked example, and a closing sentence on the pitfall they were about to ask about next.

Detailed explanation

Answer:

MethodUseIdempotent?
GETRead a resourceYes
POSTCreate a resource or trigger an actionNo
PUTReplace a resource completelyYes
PATCHUpdate part of a resourceNot guaranteed
DELETERemove a resourceYes
Tips to remember
  • Use a 3-part frame for main HTTP methods: what it is → how it works → one gotcha you've hit in a real API Testing project.
  • Rebuild the main HTTP methods comparison table from memory before the interview — panels probe the least-used row.
  • Close with status code + schema + auth as the three things you'd assert on every response.
Easy Very Common 1 minQ7 / 32

Q7.What does idempotent mean?

Asked byRazorpayStripePostmanPayPal
Why interviewers ask this

This API Testing question checks whether you can go beyond textbook knowledge on What does idempotent mean and reason about it the way a working QA engineer does — with a definition, an example, and the edge case that usually comes up next.

Detailed explanation

Answer: Sending the same request once or many times leaves the server in the same state. Deleting order 55 twice still means order 55 is gone (the second call may return 404, but the state is the same). POST is not idempotent: sending it twice usually creates two records, which is why payment APIs often use an idempotency key.

Tips to remember
  • Anchor the answer in a real API Testing project — panels reward specificity on What does idempotent mean over textbook wording.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise What does idempotent mean cleanly.
  • Close with status code + schema + auth as the three things you'd assert on every response.
Medium Very Common 1 minQ8 / 32

Q8.Path parameter vs query parameter?

Asked byFreshworksRazorpayStripePostman
Why interviewers ask this

Comparison questions like this test whether you understand Path parameter vs query parameter at a design level — not just that both exist, but when to pick one over the other. Panels use it to see if you can defend a trade-off with a real project example.

Detailed explanation

Answer: A path parameter identifies one resource: /users/42. A query parameter filters, sorts or pages a list: /users?role=admin&page=2. Our guide on headers, query and path params covers this in detail.

Tips to remember
  • Structure the answer as a small table in your head: dimension, option A, option B — and close with "I'd pick X when Y".
  • Be ready to whiteboard the Path parameter vs query parameter snippet live — panels often ask you to type it, not describe it.
  • Say how you clean up or roll back the data you touch — DB questions are really data-hygiene questions.
Confidence check

If you can confidently answer the API and HTTP Basics (Questions 1 to 6) questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

3. Status Codes and Responses (Questions 7 to 12)

Easy Very Common 1 minQ9 / 32

Q9.What do the status code classes mean?

Asked byPostmanPayPalZohoTwilio
Why interviewers ask this

This API Testing question checks whether you can go beyond textbook knowledge on What do the status code classes mean and reason about it the way a working QA engineer does — with a definition, an example, and the edge case that usually comes up next.

Detailed explanation

Answer: 1xx informational, 2xx success, 3xx redirection, 4xx client error (the request is wrong), 5xx server error (the server failed on a valid request).

Tips to remember
  • Anchor the answer in a real API Testing project — panels reward specificity on What do the status code classes mean over textbook wording.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise What do the status code classes mean cleanly.
  • Assert status, schema and business payload — naming all three signals you test contracts, not just happy paths.
Easy Very Common 1 minQ10 / 32

Q10.Which status codes should every tester know?

Asked byStripePostmanPayPalZoho
Why interviewers ask this

Listing questions on Which status codes should every tester know look easy but trap candidates who rattle off names without depth. Interviewers score higher when you group the items, mention which you use most, and add one line of context per item.

Detailed explanation

Answer: 200 OK, 201 Created (after POST, often with a Location header), 204 No Content (success with no body, common after DELETE), 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 409 Conflict, 422 Unprocessable Content, 429 Too Many Requests, 500 Internal Server Error, 502 Bad Gateway and 503 Service Unavailable.

Tips to remember
  • Group the items into 2–3 categories before listing — panels remember structure, not raw counts.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise Which status codes should every tester know cleanly.
  • Assert status, schema and business payload — naming all three signals you test contracts, not just happy paths.
Easy Very Common 1 minQ11 / 32

Q11.401 vs 403?

Asked byZohoTwilioAmazonFreshworks
Why interviewers ask this

Comparison questions like this test whether you understand 401 vs 403 at a design level — not just that both exist, but when to pick one over the other. Panels use it to see if you can defend a trade-off with a real project example.

Detailed explanation

Answer: 401 means the server doesn't know who you are: the token is missing, wrong or expired. 403 means it knows who you are, but you are not allowed to do this, for example a normal user calling an admin endpoint.

Tips to remember
  • Structure the answer as a small table in your head: dimension, option A, option B — and close with "I'd pick X when Y".
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise 401 vs 403 cleanly.
  • Cover token expiry and refresh in your answer; most candidates only describe the happy-path login.
Easy Very Common 1 minQ12 / 32

Q12.400 vs 422?

Asked byPayPalZohoTwilioAmazon
Why interviewers ask this

Comparison questions like this test whether you understand 400 vs 422 at a design level — not just that both exist, but when to pick one over the other. Panels use it to see if you can defend a trade-off with a real project example.

Detailed explanation

Answer: 400 is for a request the server can't understand, such as broken JSON. 422 means the syntax is fine but the content fails validation, such as an email field with no "@". Teams differ, so check the API's own documentation.

Tips to remember
  • Structure the answer as a small table in your head: dimension, option A, option B — and close with "I'd pick X when Y".
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise 400 vs 422 cleanly.
  • Close with status code + schema + auth as the three things you'd assert on every response.
Easy Common 1 minQ13 / 32

Q13.What do you check in a response apart from the status code?

Asked byAmazonFreshworksRazorpayStripe
Why interviewers ask this

This API Testing question checks whether you can go beyond textbook knowledge on What do you check in a response apart from the status code and reason about it the way a working QA engineer does — with a definition, an example, and the edge case that usually comes up next.

Detailed explanation

Answer: The body (correct values, data types, required fields, no extra sensitive data), headers (Content-Type, caching, security headers), response time, and that the data really changed in the system, for example by calling GET after a POST.

Tips to remember
  • Anchor the answer in a real API Testing project — panels reward specificity on What do you check in a response apart from the status code over textbook wording.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise What do you check in a response apart from the status code cleanly.
  • Assert status, schema and business payload — naming all three signals you test contracts, not just happy paths.
Easy Common 1 minQ14 / 32

Q14.What is JSON schema validation?

Asked byTwilioAmazonFreshworksRazorpay
Why interviewers ask this

Interviewers open with "JSON schema validation" to confirm you can define the concept in one crisp line before going deeper. In API Testing rounds this filters out candidates who only remember syntax and can't articulate the underlying idea to a non-expert teammate.

Detailed explanation

Answer: A JSON Schema describes the expected shape of a response: fields, types, required keys and formats. Validating against it catches contract breaks (a field renamed, a number sent as a string) in one check instead of dozens of assertions.

Tips to remember
  • Open with a one-sentence definition of JSON schema validation, then a concrete API Testing example — never start with history or theory.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise JSON schema validation cleanly.
  • Tie contract checks to the consumer/provider workflow and where the contract is stored — that's the senior detail panels wait for.
Confidence check

If you can confidently answer the Status Codes and Responses (Questions 7 to 12) questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

4. Authentication and Security (Questions 13 to 16)

Easy Common 1 minQ15 / 32

Q15.Authentication vs authorisation?

Asked byRazorpayStripePostmanPayPal
Why interviewers ask this

Comparison questions like this test whether you understand Authentication vs authorisation at a design level — not just that both exist, but when to pick one over the other. Panels use it to see if you can defend a trade-off with a real project example.

Detailed explanation

Answer: Authentication proves who you are (login, token). Authorisation decides what you may do (roles, permissions). A strong test plan checks both: an invalid token returns 401, and a valid token for the wrong role returns 403.

Tips to remember
  • Structure the answer as a small table in your head: dimension, option A, option B — and close with "I'd pick X when Y".
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise Authentication vs authorisation cleanly.
  • Cover token expiry and refresh in your answer; most candidates only describe the happy-path login.
Easy Common 1 minQ16 / 32

Q16.What auth types have you tested?

Asked byFreshworksRazorpayStripePostman
Why interviewers ask this

This API Testing question checks whether you can go beyond textbook knowledge on What auth types have you tested and reason about it the way a working QA engineer does — with a definition, an example, and the edge case that usually comes up next.

Detailed explanation

Answer: Common ones are API keys (sent in a header), Basic auth (Base64 username and password, only safe over HTTPS), Bearer tokens such as JWT, and OAuth 2.0, where a client gets an access token from an authorisation server. Our API authentication notes go deeper.

Tips to remember
  • Anchor the answer in a real API Testing project — panels reward specificity on What auth types have you tested over textbook wording.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise What auth types have you tested cleanly.
  • Cover token expiry and refresh in your answer; most candidates only describe the happy-path login.
Easy Common 1 minQ17 / 32

Q17.What is a JWT and how do you test it?

Asked byPostmanPayPalZohoTwilio
Why interviewers ask this

Interviewers open with "JWT and how do you test it" to confirm you can define the concept in one crisp line before going deeper. In API Testing rounds this filters out candidates who only remember syntax and can't articulate the underlying idea to a non-expert teammate.

Detailed explanation

Answer: A JSON Web Token has three Base64URL parts: header, payload (claims such as user id and expiry) and signature. Test that an expired token is rejected, a token with a changed payload is rejected because the signature no longer matches, and that the payload contains no secrets, since anyone can decode it.

Tips to remember
  • Open with a one-sentence definition of JWT and how do you test it, then a concrete API Testing example — never start with history or theory.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise JWT and how do you test it cleanly.
  • Cover token expiry and refresh in your answer; most candidates only describe the happy-path login.
Easy Common 1 minQ18 / 32

Q18.Which security checks can a tester do on an API?

Asked byStripePostmanPayPalZoho
Why interviewers ask this

Listing questions on Which security checks can a tester do on an API look easy but trap candidates who rattle off names without depth. Interviewers score higher when you group the items, mention which you use most, and add one line of context per item.

Detailed explanation

Answer: Call endpoints without a token; access another user's record by changing the id (broken object-level authorisation, the top risk in the OWASP API Security Top 10); send very long or malicious input; check that error messages don't leak stack traces; and check rate limiting returns 429.

Tips to remember
  • Group the items into 2–3 categories before listing — panels remember structure, not raw counts.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise Which security checks can a tester do on an API cleanly.
  • Cover token expiry and refresh in your answer; most candidates only describe the happy-path login.
Confidence check

If you can confidently answer the Authentication and Security (Questions 13 to 16) questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

5. Postman (Questions 17 to 20)

Medium Common 1 minQ19 / 32

Q19.How do you write a test in Postman?

Asked byZohoTwilioAmazonFreshworks
Why interviewers ask this

Hands-on "how would you write a test" questions reveal whether you've actually shipped API Testing code or only read about it. Interviewers listen for concrete steps, the tools you'd reach for first, and the failure mode you'd guard against.

Detailed explanation

Answer: In the request's Scripts tab (post-response) using the pm API:

pm.test('status is 200', () => {
  pm.response.to.have.status(200);
});
pm.test('returns the user', () => {
  const body = pm.response.json();
  pm.expect(body.id).to.eql(42);
  pm.expect(body.email).to.include('@');
});
Tips to remember
  • Walk through write a test as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the write a test snippet live — panels often ask you to type it, not describe it.
  • Close with status code + schema + auth as the three things you'd assert on every response.
Medium Common 1 minQ20 / 32

Q20.How do you pass a value from one request to the next?

Asked byPayPalZohoTwilioAmazon
Why interviewers ask this

Hands-on "how would you pass a value from one request to the next" questions reveal whether you've actually shipped API Testing code or only read about it. Interviewers listen for concrete steps, the tools you'd reach for first, and the failure mode you'd guard against.

Detailed explanation

Answer: Save it to a variable in the first request's script, then use {{variableName}} in the next request:

const token = pm.response.json().token;
pm.environment.set('authToken', token);
// next request header: Authorization: Bearer {{authToken}}
Tips to remember
  • Walk through pass a value from one request to the next as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the pass a value from one request to the next snippet live — panels often ask you to type it, not describe it.
  • Cover token expiry and refresh in your answer; most candidates only describe the happy-path login.
Easy Common 1 minQ21 / 32

Q21.Environment vs collection vs global variables?

Asked byAmazonFreshworksRazorpayStripe
Why interviewers ask this

Comparison questions like this test whether you understand Environment vs collection vs global variables at a design level — not just that both exist, but when to pick one over the other. Panels use it to see if you can defend a trade-off with a real project example.

Detailed explanation

Answer: Global variables apply everywhere in a workspace. Collection variables belong to one collection. Environment variables change with the environment you pick (dev, staging), so the same requests can run against different servers. Keep secrets out of shared collections.

Tips to remember
  • Structure the answer as a small table in your head: dimension, option A, option B — and close with "I'd pick X when Y".
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise Environment vs collection vs global variables cleanly.
  • Close with status code + schema + auth as the three things you'd assert on every response.
Easy Common 1 minQ22 / 32

Q22.How do you run Postman tests in CI?

Asked byTwilioAmazonFreshworksRazorpay
Why interviewers ask this

Hands-on "how would you run Postman tests in CI" questions reveal whether you've actually shipped API Testing code or only read about it. Interviewers listen for concrete steps, the tools you'd reach for first, and the failure mode you'd guard against.

Detailed explanation

Answer: Export the collection and environment and run them with Newman or the Postman CLI in the pipeline, which returns a failing exit code when a test fails. The Top 30 Postman Interview Questions PDF covers more Postman questions.

Tips to remember
  • Walk through run Postman tests in CI as numbered steps and call out the tool, command, or API used at each step.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise run Postman tests in CI cleanly.
  • Describe the pipeline stage order and what makes the build fail — a vague "we run tests in CI" answer stalls here.
Confidence check

If you can confidently answer the Postman (Questions 17 to 20) questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

6. API Automation with REST Assured (Questions 21 to 25)

Medium Common 1 minQ23 / 32

Q23.What is REST Assured?

Asked byRazorpayStripePostmanPayPal
Why interviewers ask this

Interviewers open with "REST Assured" to confirm you can define the concept in one crisp line before going deeper. In API Testing rounds this filters out candidates who only remember syntax and can't articulate the underlying idea to a non-expert teammate.

Detailed explanation

Answer: A Java library for testing REST APIs with a readable given / when / then style. It handles requests, JSON and XML parsing and assertions, and works with TestNG or JUnit.

given()
    .baseUri("https://api.example.com")
    .header("Authorization", "Bearer " + token)
.when()
    .get("/users/42")
.then()
    .statusCode(200)
    .body("id", equalTo(42))
    .body("email", containsString("@"));
Tips to remember
  • Open with a one-sentence definition of REST Assured, then a concrete API Testing example — never start with history or theory.
  • Be ready to whiteboard the REST Assured snippet live — panels often ask you to type it, not describe it.
  • Assert status, schema and business payload — naming all three signals you test contracts, not just happy paths.
Medium Occasional 1 minQ24 / 32

Q24.How do you send a POST with a JSON body?

Asked byFreshworksRazorpayStripePostman
Why interviewers ask this

Hands-on "how would you send a POST with a JSON body" questions reveal whether you've actually shipped API Testing code or only read about it. Interviewers listen for concrete steps, the tools you'd reach for first, and the failure mode you'd guard against.

Detailed explanation

Answer: Set the content type and pass a body, usually a POJO or a Map that REST Assured serialises:

Map<String, Object> user = Map.of("name", "Asha", "role", "tester");
int id = given().contentType(ContentType.JSON).body(user)
    .when().post("/users")
    .then().statusCode(201)
    .extract().path("id");
Tips to remember
  • Walk through send a POST with a JSON body as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the send a POST with a JSON body snippet live — panels often ask you to type it, not describe it.
  • Assert status, schema and business payload — naming all three signals you test contracts, not just happy paths.
Medium Occasional 1 minQ25 / 32

Q25.What are request and response specifications?

Asked byPostmanPayPalZohoTwilio
Why interviewers ask this

Interviewers open with "request and response specifications" to confirm you can define the concept in one crisp line before going deeper. In API Testing rounds this filters out candidates who only remember syntax and can't articulate the underlying idea to a non-expert teammate.

Detailed explanation

Answer: Reusable settings (base URI, headers, auth, expected content type) built once with RequestSpecBuilder and ResponseSpecBuilder, so tests don't repeat them.

Tips to remember
  • Open with a one-sentence definition of request and response specifications, then a concrete API Testing example — never start with history or theory.
  • Be ready to whiteboard the request and response specifications snippet live — panels often ask you to type it, not describe it.
  • Close with status code + schema + auth as the three things you'd assert on every response.
Easy Occasional 1 minQ26 / 32

Q26.How would you structure an API automation framework?

Asked byStripePostmanPayPalZoho
Why interviewers ask this

Hands-on "how would you structure an API automation framework" questions reveal whether you've actually shipped API Testing code or only read about it. Interviewers listen for concrete steps, the tools you'd reach for first, and the failure mode you'd guard against.

Detailed explanation

Answer: Config per environment, a client layer that wraps endpoints, POJOs for request and response bodies, test data builders, specifications for shared settings, tests grouped by feature, reports, and a CI job. Our REST Assured course builds one from scratch.

Tips to remember
  • Walk through structure an API automation framework as numbered steps and call out the tool, command, or API used at each step.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise structure an API automation framework cleanly.
  • Assert status, schema and business payload — naming all three signals you test contracts, not just happy paths.
Medium Occasional 1 minQ27 / 32

Q27.How do you validate a JSON schema in REST Assured?

Asked byZohoTwilioAmazonFreshworks
Why interviewers ask this

Hands-on "how would you validate a JSON schema in REST Assured" questions reveal whether you've actually shipped API Testing code or only read about it. Interviewers listen for concrete steps, the tools you'd reach for first, and the failure mode you'd guard against.

Detailed explanation

Answer: Use the json-schema-validator module: .body(matchesJsonSchemaInClasspath("user-schema.json")). Keep schema files next to the tests so a contract change shows up as a clear failure.

Tips to remember
  • Walk through validate a JSON schema in REST Assured as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the validate a JSON schema in REST Assured snippet live — panels often ask you to type it, not describe it.
  • Assert status, schema and business payload — naming all three signals you test contracts, not just happy paths.
Confidence check

If you can confidently answer the API Automation with REST Assured (Questions 21 to 25) questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

7. Contracts, Mocks and Performance (Questions 26 to 28)

Easy Occasional 1 minQ28 / 32

Q28.What is contract testing?

Asked byPayPalZohoTwilioAmazon
Why interviewers ask this

Interviewers open with "contract testing" to confirm you can define the concept in one crisp line before going deeper. In API Testing rounds this filters out candidates who only remember syntax and can't articulate the underlying idea to a non-expert teammate.

Detailed explanation

Answer: It checks that a provider API and its consumers agree on requests and responses. In consumer-driven contract testing (for example with Pact), the consumer records what it expects and the provider's build verifies it, so a breaking change is caught before deployment.

Tips to remember
  • Open with a one-sentence definition of contract testing, then a concrete API Testing example — never start with history or theory.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise contract testing cleanly.
  • Tie contract checks to the consumer/provider workflow and where the contract is stored — that's the senior detail panels wait for.
Easy Occasional 1 minQ29 / 32

Q29.When would you mock an API?

Asked byAmazonFreshworksRazorpayStripe
Why interviewers ask this

Timing questions like this check whether you understand the trade-offs of mock an API. Interviewers want to hear the specific signals in a project that make you pick it over the alternative, plus one case where it's the wrong choice.

Detailed explanation

Answer: When the real dependency is unavailable, slow, costly (a payment gateway) or hard to put into an error state. Tools such as WireMock or Postman mock servers return fixed responses. Keep a smaller set of tests against the real service so mocks don't hide real problems.

Tips to remember
  • Answer in the form "Use mock an API when …, avoid it when …" so the interviewer hears both sides in one breath.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise mock an API cleanly.
  • Say when you'd mock versus hit the real dependency; unconditional mocking is a red flag for integration coverage.
Easy Occasional 1 minQ30 / 32

Q30.How do you check API performance?

Asked byTwilioAmazonFreshworksRazorpay
Why interviewers ask this

Hands-on "how would you check API performance" questions reveal whether you've actually shipped API Testing code or only read about it. Interviewers listen for concrete steps, the tools you'd reach for first, and the failure mode you'd guard against.

Detailed explanation

Answer: In functional tests, assert a reasonable response time. For load, use a tool such as JMeter or k6 to simulate many users and measure response times (p95, p99), throughput and error rate. Only load-test environments you own or have permission to test.

Tips to remember
  • Walk through check API performance as numbered steps and call out the tool, command, or API used at each step.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise check API performance cleanly.
  • Use percentiles (P90/P95) and a concrete SLA rather than averages — averages hide the failures interviewers care about.
Confidence check

If you can confidently answer the Contracts, Mocks and Performance (Questions 26 to 28) questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

8. Scenario Questions (Questions 29 and 30)

Medium Occasional 1 minQ31 / 32

Q31.How would you test a "create user" endpoint?

Asked byRazorpayStripePostmanPayPal
Why interviewers ask this

Hands-on "how would you test a "create user" endpoint" questions reveal whether you've actually shipped API Testing code or only read about it. Interviewers listen for concrete steps, the tools you'd reach for first, and the failure mode you'd guard against.

Detailed explanation

Answer: Positive: valid data returns 201, the body has an id, and GET by that id returns the same data. Negative: missing required fields, wrong types, invalid email and duplicate email (409). Boundary: minimum and maximum lengths. Security: no token (401), wrong role (403), and the password never returned in the response. Also check the response time and that the Content-Type is JSON.

Tips to remember
  • Walk through test a "create user" endpoint as numbered steps and call out the tool, command, or API used at each step.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise test a "create user" endpoint cleanly.
  • Cover token expiry and refresh in your answer; most candidates only describe the happy-path login.
Medium Occasional 1 minQ32 / 32

Q32.An API returns 200 but the UI shows wrong data. How do you investigate?

Asked byFreshworksRazorpayStripePostman
Why interviewers ask this

This API Testing question checks whether you can go beyond textbook knowledge on An API returns 200 but the UI shows wrong data. How do you investigate and reason about it the way a working QA engineer does — with a definition, an example, and the edge case that usually comes up next.

Detailed explanation

Answer: Capture the actual request and response in the browser's Network tab. Compare the response body with the expected data and the API documentation. If the API data is wrong, check the database and the server logs; if the data is right, the bug is in how the front end maps or displays it. Report it with the request, response and steps so the right team can fix it.

To practise these questions against a real endpoint, try the free API Playground; its labs grade your requests automatically.

Tips to remember
  • Anchor the answer in a real API Testing project — panels reward specificity on An API returns 200 but the UI shows wrong data. How do you investigate over textbook wording.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise An API returns 200 but the UI shows wrong data. How do you investigate cleanly.
  • Say how you clean up or roll back the data you touch — DB questions are really data-hygiene questions.
RelatedQ30
Confidence check

If you can confidently answer the Scenario Questions (Questions 29 and 30) questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

Quick revision

  1. Q1: Option A: Save this page as a PDF (free) — Open this article on a laptop or desktop.
  2. Q2: Option B: The longer PDFs in the QA Notes Vault (paid) — If you want more questions in a designed document, these PDFs are in our library.
  3. Q3: What is API testing — Answer: API testing checks an application's business logic directly through its interface, by sending requests and checking the responses, without using the UI.
  4. Q4: What is REST — Answer: REST is an architectural style for APIs.
  5. Q5: REST vs SOAP — Answer: SOAP is a protocol that uses XML messages with a strict contract (WSDL) and built-in standards such as WS-Security.

Learn it properly

API Testing course

Master API testing with Postman, status codes, auth and automation basics.

  • Postman collections
  • Auth, tokens, negative tests
  • Practice APIs included

Preparing for this interview?

API Testing Fundamentals for Beginners

8 beginner lessons in about 45 minutes: what an API is, HTTP methods and status codes, JSON, your first requests in Postman, authentication, negative testing and a mini project on a real practice API.

Start the free course

API testing jobs hiring now

Live, indexable API Testing openings — updated daily in Jobs Radar.

Browse all QA jobs on Jobs Radar

Loading current openings…

Home

References

  1. 1
    RFC 9110: HTTP Semantics— rfc-editor.org
  2. 2
    MDN: HTTP response status codes— developer.mozilla.org
  3. 3
    Postman: Writing tests— learning.postman.com
  4. 4
  5. 5
    JSON Schema— json-schema.org

Discussion

Ask a question, share your experience, or correct us. Be kind — real people are reading.