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