How do you test API versioning?
- API versioning
- backward compatibility
- migration
Answer it first, then compare. Nothing here is saved or scored.
Model answer
Verify: (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.
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.