API & Integration Testing interview questions.
Questions on REST API testing, contract testing, Postman, REST Assured, status codes, authentication, and schema validation.
A test passes locally but fails in CI about one run in five. Walk me through what you check first, and why.
This single answer is scored on four dimensions: Technical accuracy · Coverage · Clarity · Best practices.
Free to start · 7-day trial on paid plans
How to approach api testing questions.
API testing interviews look easy on paper and trip up surprisingly senior candidates. The questions sound like trivia (what is the difference between PUT and PATCH, what does a 422 mean) but the follow-ups push into territory most QA engineers only cover when the contract actually breaks in production. Treat every answer as a chance to talk about real systems, not the textbook.
Lead with the contract. Whether the team uses OpenAPI, Pact, or hand-written request fixtures, your first move is to validate that the response matches the published schema before you assert on values. A surprising number of "API tests" in real codebases only check status codes, which means a backend can quietly drop a field and every test still goes green. Mention schema validation early and you signal that you have lived through that exact incident.
Authentication is where strong candidates separate themselves. Be ready to explain how you handle bearer tokens that expire mid-suite, how you exchange OAuth refresh tokens inside a fixture without leaking secrets into logs, and why you rotate credentials per worker when running tests in parallel. Bonus points for knowing the difference between testing the auth flow itself and testing through it as a precondition.
Contract testing belongs in this conversation, not in a separate question. If the team consumes services it does not own, mention consumer-driven contract tests with Pact and how they catch breaking changes before deploys instead of after. If the team owns the service, mention provider verification and how it gates backend merges. Saying "we test the API end to end" without naming this layer is a yellow flag for senior interviewers.
What hiring managers are listening for
- Schema-first thinkingYou validate response shape before you assert on values, every time.
- Status-code literacyYou can defend why 401 vs 403 vs 422 matters for the consumer.
- Contract awarenessYou know when consumer-driven contract tests beat end-to-end checks.
- Auth fluencyYou can describe rotating tokens across parallel workers without secrets in logs.
Do not let the conversation collapse into Postman trivia. Interviewers will sometimes start there to warm you up and pivot to "now write me a test for this endpoint in code." If your only tool is a GUI client, you will not survive that pivot. Be ready to write a request and a schema assertion in JavaScript, Python, or Java, depending on the stack.
Need the vocabulary first? Browse all 35 Specialized Testing terms in the QA glossary.
Showing 35 questions · 10 free answers remaining
Five layers of validation: (1) Status code, correct for the scenario (200, 201, 400, 404, etc.). (2) Response body - correct data, structure, and types. (3) Headers - content-type, cache-control, security headers. (4) Performance - response time within SLA. (5) Error handling - proper error messages and codes for invalid inputs. Also validate idempotency for PUT/DELETE and pagination for list endpoints.
Practice this question on its own pageTry a scored practice question, freeREST: fixed endpoints per resource, HTTP verbs for CRUD, multiple round trips for related data. GraphQL: single endpoint, client specifies exactly what data it needs, fewer round trips. Testing differences: REST, test each endpoint/method combo. GraphQL - test queries, mutations, and subscriptions; validate query depth limits, authorization per field, and N+1 query performance. Both need schema validation, auth testing, and error handling tests.
Practice this question on its own pageTry a scored practice question, freeAuthentication tests: valid token returns 200, expired token returns 401, missing token returns 401, malformed token returns 401. Authorization tests: user A cannot access user B's resources (403), role-based access (admin vs. user), resource-level permissions. Test with multiple user roles and verify each endpoint enforces the correct access level. Also test token refresh flows and session expiration.
Practice this question on its own pageTry a scored practice question, freeContract testing verifies that a consumer and provider agree on the API interface without needing both running simultaneously. Pact workflow: (1) Consumer writes tests defining expected requests/responses, generates a "pact" (contract file). (2) Provider runs the pact against its real implementation to verify compliance. (3) Pact Broker stores contracts and verification results. Benefits: catches integration breaks in CI without deploying all services. Essential for microservices where full integration environments are expensive.
Practice this question on its own pageTry a scored practice question, freeSend requests at the documented rate limit boundary, verify that the Nth+1 request returns 429 (Too Many Requests) with a Retry-After header. Test reset behavior - after the window expires, requests should succeed again. Verify rate limit headers in responses (X-RateLimit-Limit, X-RateLimit-Remaining). Test across different API keys and IP addresses. Use tools like k6 or Artillery for load-based rate limit testing.
Practice this question on its own pageTry a scored practice question, free200 OK (success), 201 Created (resource created), 204 No Content (success, no body, common for DELETE). 301/302 Redirects. 400 Bad Request (client error - invalid input), 401 Unauthorized (not authenticated), 403 Forbidden (authenticated but not authorized), 404 Not Found, 409 Conflict (duplicate resource), 422 Unprocessable Entity (validation failed). 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable. Know these by heart - every API test validates status codes.
Practice this question on its own pageTry a scored practice question, freeUse JSON Schema validation libraries (Ajv for JavaScript, jsonschema for Python) to verify response structure: required fields present, correct data types, string formats (email, date-time, UUID), enum values, and array item types. Store schemas as files and validate every API response against them. This catches breaking changes early, a removed field or type change fails the schema check even if the endpoint returns 200.
Practice this question on its own pageTry a scored practice question, freeSetup: create test data via API calls (POST endpoints) before each test, don't rely on pre-existing data. Teardown: delete created data after each test. Use unique identifiers (UUIDs, timestamps) to avoid conflicts in parallel runs. For complex scenarios, use database seeding or transaction rollbacks. In frameworks like Playwright, use `beforeAll`/`afterAll` for shared setup and `beforeEach`/`afterEach` for test-specific data.
Practice this question on its own pageTry a scored practice question, freePositive testing verifies the API works correctly with valid inputs: creating a user with all required fields returns 201. Negative testing verifies graceful handling of invalid inputs: missing required fields (400), invalid email format (422), SQL injection strings (400, not 500), extremely long strings (400), wrong data types (422). A thorough API test suite has more negative tests than positive, the happy path is one path, but there are many ways to fail.
Practice this question on its own pageTry a scored practice question, freeFor webhooks: set up a test endpoint (using tools like webhook.site or a local server) to receive webhook payloads. Trigger the event, then poll your endpoint to verify the webhook arrived with the correct payload, headers, and timing. For async operations: call the initiating endpoint, then poll the status endpoint until completion (with timeout). Verify the final state and any side effects. Test retry behavior for failed webhook deliveries.
Practice this question on its own pageTry a scored practice question, freeTest: (1) First page returns correct page size. (2) Navigating all pages returns all records without duplicates. (3) Empty page when offset exceeds total. (4) Page size parameter works correctly. (5) Sorting is consistent across pages. (6) Total count header/field is accurate. (7) Edge cases: page=0, page=-1, pageSize=0, very large pageSize. For cursor-based pagination, verify cursor stability when data changes between requests.
Practice this question on its own pageTry a scored practice question, freeBeyond basic requests: (1) Collections, organize tests by feature/workflow. (2) Pre-request scripts - dynamic data generation, token refresh. (3) Tests tab - JavaScript assertions on status, body, headers, response time. (4) Environments - switch between dev/staging/prod variables. (5) Collection runner - run all tests sequentially with data files (CSV/JSON). (6) Newman - CLI runner for CI integration. (7) Monitors - scheduled runs for production API health checks.
Practice this question on its own pageTry a scored practice question, freeVerify: (1) Both versions (v1, v2) work simultaneously during migration. (2) v1 responses match documented v1 schema (no v2 leakage). (3) Deprecation headers are present on old versions. (4) Backward compatibility, clients using v1 aren't broken. (5) Version negotiation (via URL path, header, or query param) routes correctly. Test the full lifecycle: create in v1, read in v2, and vice versa if supported.
Practice this question on its own pageTry a scored practice question, freeKey areas: (1) Injection, SQL injection, NoSQL injection, command injection in parameters. (2) Broken auth - test with expired/invalid/missing tokens, horizontal privilege escalation (access other users' data). (3) Mass assignment - send extra fields to see if the API blindly accepts them. (4) Rate limiting - verify limits are enforced. (5) CORS - verify allowed origins. (6) Input validation - boundary values, special characters, oversized payloads. Tools: OWASP ZAP, Burp Suite for automated scanning.
Practice this question on its own pageTry a scored practice question, freeREST Assured is a Java library for testing REST APIs with a fluent, readable syntax: `given().header(...).when().get(...).then().statusCode(200)`. Use it when: your team is Java-based, you need tight integration with TestNG/JUnit, or you want type-safe request/response handling. Advantages: fluent DSL, JSON/XML path extraction, schema validation built-in. Alternatives: Postman+Newman (language-agnostic), Playwright API testing (JavaScript), Requests+pytest (Python).
Practice this question on its own pageTry a scored practice question, freeUpload tests: verify multipart/form-data handling, file size limits (test at boundary and over), allowed file types (reject .exe, accept .pdf), filename sanitization (special characters, path traversal attempts like "../"), and virus scanning if applicable. Download tests: verify Content-Disposition header, correct MIME type, file integrity (checksum comparison), range requests for large files, and authorization (user A can't download user B's files).
Practice this question on its own pageTry a scored practice question, freeCritical areas: (1) Happy path, successful charge, refund, subscription creation. (2) Payment failures - declined cards, insufficient funds, expired cards (use test card numbers). (3) Idempotency - duplicate charge requests don't double-charge. (4) Webhooks - verify event delivery for charge.succeeded, charge.failed, subscription.canceled. (5) Currency handling - decimal precision, conversion. (6) PCI compliance - ensure no raw card data in logs or responses. (7) Concurrency - race conditions on balance updates. Use sandbox/test mode exclusively.
Practice this question on its own pageTry a scored practice question, freeApproach: (1) Send requests at the documented rate limit and verify they succeed. (2) Exceed the limit and verify 429 status code with Retry-After header. (3) Test the reset window, wait for the window to pass and verify requests succeed again. (4) Test with different API keys/users to ensure per-user limits. (5) Verify rate limit headers in responses (X-RateLimit-Remaining, X-RateLimit-Reset). (6) Test edge cases: concurrent requests at the limit boundary, burst vs sustained rate.
Practice this question on its own pageTry a scored practice question, freeContract testing verifies that a provider API meets the expectations defined by consumer services, without deploying both together. Tools: Pact, Spring Cloud Contract. Integration testing deploys both services and tests actual communication. Contract testing is faster, runs in isolation, and catches breaking changes early. Use contract testing when: many consumers depend on an API, teams deploy independently, or integration environments are costly. The contract is a shared agreement, not a full integration test.
Practice this question on its own pageTry a scored practice question, freeKey differences: (1) Single endpoint, so test different query shapes, not different URLs. (2) Test query depth limits and complexity to prevent abuse. (3) Test fragments, nested queries, and pagination (cursor-based). (4) Verify type system compliance, fields return correct types. (5) Test error handling, partial failures (some fields resolve, some error). (6) Subscription testing for real-time features. (7) Test query variables and input validation. (8) Performance: N+1 query detection, dataloader effectiveness. Use tools like graphql-request or Apollo testing utilities.
Practice this question on its own pageTry a scored practice question, freeTest cases: (1) First page returns correct count and has next link. (2) Last page has no next link. (3) Empty collection returns empty array. (4) Page size parameter is respected. (5) Cursor/offset consistency when data changes between pages. (6) Invalid page numbers return appropriate errors. (7) Large page sizes are capped. (8) Total count accuracy. (9) Sorting is consistent across pages, no duplicate or missing items. (10) Performance with large datasets. Both offset-based and cursor-based pagination have different edge cases to cover.
Practice this question on its own pageTry a scored practice question, freeAuthentication tests: valid credentials succeed, invalid fail (401), expired tokens rejected, refresh token flow works, rate limiting on auth endpoints. Authorization tests: user can access own resources, cannot access others (IDOR prevention), role-based access works (admin vs user), permission escalation blocked, deleted/deactivated users rejected. Always test the negative cases, a passing auth test suite means nothing if you only tested happy paths.
Practice this question on its own pageTry a scored practice question, freeChallenges: webhooks are asynchronous and push-based. Approach: (1) Set up a webhook receiver (ngrok, webhook.site, or custom endpoint). (2) Trigger the event and verify the webhook is received within the timeout. (3) Verify payload structure, signature, and headers. (4) Test retry logic: return 500 and verify retries with backoff. (5) Test idempotency: process the same webhook twice, verify no duplicate effects. (6) Test signature verification: tamper with the payload and verify rejection. (7) Test ordering: verify events arrive in order or handle out-of-order gracefully.
Practice this question on its own pageTry a scored practice question, freeTest both versions during migration periods. Strategy: (1) Maintain separate test suites per version or use parameterized tests. (2) Verify backward compatibility, v1 consumers still work when v2 is deployed. (3) Test version negotiation (Accept header, URL prefix). (4) Verify deprecation warnings in v1 responses. (5) Test that v1-only fields are not in v2. (6) Contract tests ensure consumers are not broken by version changes. (7) Sunset testing, verify v1 returns 410 Gone after deprecation date.
Practice this question on its own pageTry a scored practice question, freeLayers of testing: (1) Unit tests with mocked third-party responses (fast, reliable). (2) Integration tests with a sandbox environment if the third-party provides one (Stripe test mode, Twilio test credentials). (3) Contract tests to verify your code handles the documented response shapes. (4) Synthetic monitoring in production to catch third-party outages. (5) Test error handling: timeouts, rate limits, malformed responses, partial outages. Never let your tests depend on a live third-party in CI.
Practice this question on its own pageTry a scored practice question, freeUpload tests: valid file types accepted, invalid rejected, size limits enforced, multipart form data correctly parsed, progress tracking works, concurrent uploads handled. Download tests: correct Content-Type and Content-Disposition headers, file integrity (checksum match), range requests for large files, expired download links rejected. Edge cases: empty files, very large files, special characters in filenames, duplicate uploads.
Practice this question on its own pageTry a scored practice question, freeOWASP API Top 10 coverage: (1) BOLA/IDOR, access other users' resources by changing IDs. (2) Broken auth, test token manipulation, session fixation. (3) Excessive data exposure, verify response does not include sensitive fields. (4) Mass assignment, send extra fields and verify they are ignored. (5) SQL/NoSQL injection in query parameters. (6) SSRF, test internal URL blocking. (7) Security headers present (CORS, CSP). Tools: OWASP ZAP, Burp Suite, custom scripts. Run as part of CI, not just penetration testing.
Practice this question on its own pageTry a scored practice question, freeEvery API should return consistent error shapes. Test: (1) All error responses follow the same schema (e.g., { error: { code, message, details } }). (2) Correct HTTP status codes: 400 for bad input, 401 for unauthorized, 403 for forbidden, 404 for not found, 409 for conflict, 422 for validation, 500 for server error. (3) Error messages are helpful but do not leak internals (no stack traces). (4) Validation errors include field-level details. (5) Rate limit errors include Retry-After.
Practice this question on its own pageTry a scored practice question, freeSteps: (1) Organize requests into collections by feature. (2) Use environment variables for base URL, auth tokens, dynamic data. (3) Write test scripts (pm.test assertions) for status codes, response body, headers. (4) Chain requests using collection variables (save ID from POST, use in GET). (5) Use pre-request scripts for data generation. (6) Run with Newman in CI. (7) Set up monitors for scheduled health checks. For code-based approach: use Playwright API testing, supertest, or REST Assured for better version control and IDE support.
Practice this question on its own pageTry a scored practice question, freeEventually consistent systems require patience and polling in tests. Approach: (1) After a write, poll the read endpoint with exponential backoff until the data appears (with a max timeout). (2) Test the consistency window, verify reads return stale data within the window. (3) Test conflict resolution, concurrent writes should resolve predictably. (4) Test cross-region consistency if applicable. (5) Never assume immediate consistency in tests, always use retry/polling assertions. Tools: custom polling helpers, expect.poll() in Playwright.
Practice this question on its own pageTry a scored practice question, freeIdempotent operations should have the same effect on server state when called multiple times. Tests: (1) POST with same idempotency key twice, assert the second response matches the first (same status and body). (2) Verify database state has only one record. (3) Test expired idempotency keys. (4) Test with different payloads but same key, should return error or original result. (5) PUT and DELETE should be naturally idempotent. (6) Concurrent requests with same key should not create duplicates. Common mistake: testing only the response, not the side effects.
Practice this question on its own pageTry a scored practice question, freeLayered strategy: (1) Unit tests within each service, fast, mocked dependencies. (2) Contract tests between services (Pact or similar), run in isolation. (3) Service-level integration tests with real database but mocked external services. (4) End-to-end API tests hitting the full stack through the API gateway. (5) Chaos testing, inject failures in service mesh. (6) Each team owns their service tests, platform team owns e2e. (7) Shared test infrastructure: service mesh test doubles, test data factories, observability for test failures.
Practice this question on its own pageTry a scored practice question, freeInclude performance assertions in functional tests: (1) Assert response time is under the SLA (e.g., p95 < 200ms). (2) Measure and trend response times in CI over time. (3) Set up alerts when response times degrade beyond thresholds. (4) Test under realistic conditions (auth, typical payload sizes). (5) Separate performance benchmarks from functional tests to avoid flakiness. Tools: Playwright request timing, k6 for dedicated load tests, custom timing middleware.
Practice this question on its own pageTry a scored practice question, freeMultipart testing: verify boundary parsing, mixed file + JSON payloads, character encoding in field names and values. Test edge cases: missing required parts, extra unexpected parts, very large parts, empty parts. Content-type testing: verify API rejects unsupported content types, handles charset correctly, responds with appropriate content type. Use tools that let you control raw request construction (curl, custom HTTP clients) for edge case testing.
Practice this question on its own pageTry a scored practice question, freeComponents: (1) API design guidelines (naming, versioning, error formats) that make testing predictable. (2) Shared test libraries: auth helpers, assertion utilities, data factories. (3) Template test suites that teams can fork for new services. (4) Quality gates in CI: minimum test coverage, contract test passage, security scan passage. (5) API documentation as the source of truth (OpenAPI spec), generate tests from specs. (6) Regular cross-team reviews of test approaches. (7) Internal testing handbook with best practices and examples.
Practice this question on its own pageTry a scored practice question, freeStop reading answers. Start practicing them.
AssertHired's AI interviewer asks follow-up questions, scores your responses across 4 QA-specific dimensions, and gives you actionable feedback.
Answer a Free QuestionFree to start · 7-day trial on paid plans
More Question Categories
Explore questions across all QA interview topics.
Practice by Tool & Technology
Dive deeper with tool-specific interview questions.
Go deeper on API testing
Go beyond practice interviews - get the guides, drills, and frameworks that top QA engineers use.
Free QA career tools, no account needed
Instant and private, everything runs in your browser. Try them before you sign up.
QA Resume Checker
Instant 0-100 score on automation keywords, impact, and ATS formatting.
QA Cover Letter Generator
A tailored 3-paragraph QA cover letter from your resume and a job post.
QA Application Tracker
Drag-and-drop kanban to track every QA application from Applied to Offer.
QA Take-Home Test Generator
A realistic take-home assignment with a scenario, tasks, and a rubric.
QA LinkedIn Headline Generator
A recruiter-searchable headline, About section, and skills list.
QA STAR Story Builder
Structure a QA behavioral answer with the STAR method and instant checks.
QA Bug Report Generator
Build a clean, reproducible bug report for Markdown, Jira, or plain text.
Boundary Value Analysis Generator
Generate boundary value and equivalence partitioning test cases from a range.
QA Metrics Calculator
Calculate DRE, defect leakage, defect density, and pass rate with interpretation.
QA Test Plan Generator
Build a structured test plan (scope, approach, criteria, risks) in Markdown.
QA Salary Calculator
Estimate QA, SDET, and automation tester pay by level, market, and skills.
QA Offer Evaluator
See total comp, a counter range, and a ready-to-send negotiation message.
Ready to Ace Your QA Interview?
Stop reading answers, start practicing them live with AI that knows QA.
Join 700+ QA engineers already practicing with AssertHired.
A test passes locally but fails in CI about one run in five. Walk me through what you check first, and why.
This single answer is scored on four dimensions: Technical accuracy · Coverage · Clarity · Best practices.
Rather skip ahead? Create a free account