API Testing Interview Questions for Playwright Testing
46 API Testing questions with answers for playwright testing roles — 8 easy, 27 medium, 11 hard.
About API Testing
Covers testing REST and GraphQL APIs with Playwright's request fixture and APIRequestContext: methods, status codes, headers, authentication, payload and schema validation, negative cases and test data setup. Interviewers check whether you can test the backend directly and combine API calls with UI flows to make suites faster and more reliable.
How do you make an API request in Playwright?
Show answer
What is the difference between the request fixture and request.newContext()?
Show answer
What does response.ok() check?
Show answer
How do you send query parameters in an API request?
Show answer
What are idempotent HTTP methods and why do they matter in testing?
Show answer
What is the difference between path parameters and query parameters?
Show answer
Describe a time an API changed without notice and broke your tests.
Show answer
How do you share cookies between API login and UI?
Show answer
How do you mock an API response?
Show answer
How do you test pagination or chained API calls?
Show answer
How do you test file upload via API?
Show answer
How do you handle token refresh in long API test runs?
Show answer
How do you validate an API response in Playwright?
Show answer
What is APIRequestContext?
Show answer
How do you measure API response time?
Show answer
How do you combine API and UI tests?
Show answer
How do you send authentication headers?
Show answer
How do you validate JSON schema?
Show answer
How do you handle GraphQL APIs in Playwright?
Show answer
How do you send a POST request with a JSON body?
Show answer
How do you test API error scenarios?
Show answer
How do you handle rate limits or slow APIs in tests?
Show answer
Write an API test with the request fixture.
Show answer
Write a test that updates a user with PUT and verifies the change.
Show answer
How do you set baseURL and common headers for API tests?
Show answer
How do you test the difference between 401 and 403 responses?
Show answer
An API returns 200 but the body contains an error field. How should your test catch this?
Show answer
Why should you dispose an APIRequestContext?
Show answer
Write a test that deletes a record and confirms it is gone.
Show answer
How do you validate response headers?
Show answer
What does the failOnStatusCode option do?
Show answer
How do you write data-driven API tests with many inputs?
Show answer
An endpoint should reject invalid email addresses. Which negative tests would you write?
Show answer
Tell me about a bug you found through API testing that UI tests missed.
Show answer
How do you create test data through the API before a UI test?
Show answer
How would you design API test coverage for a new endpoint?
Show answer
How do contract tests differ from functional API tests?
Show answer
An API test fails randomly because another test changes the same record. How do you fix it?
Show answer
How do you test an async job API that returns 202 and finishes later?
Show answer
How do you keep API tests independent of environment data?
Show answer
How do you test that duplicate POST requests do not create duplicate orders?
Show answer
How do you test conditional GET requests that use ETag and If-None-Match?
Show answer
An endpoint streams server-sent events. How would you test it with Playwright?
Show answer
How do you verify that an API returns consistent data across two versions of an endpoint?
Show answer
An API receives a payload with an unknown extra field. How do you test what it should do?
Show answer
Frequently asked questions
How important is API Testing in Playwright Testing interviews?
Covers testing REST and GraphQL APIs with Playwright's request fixture and APIRequestContext: methods, status codes, headers, authentication, payload and schema validation, negative cases and test data setup. Interviewers check whether you can test the backend directly and combine API calls with UI flows to make suites faster and more reliable.
How should I use the 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.