What are the key things you validate in an API test?
- API validation
- response verification
- fundamentals
Answer it first, then compare. Nothing here is saved or scored.
Model answer
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.
What interviewers listen 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.