All jobs / Backend developer / API Development
Backend developer interview question · 3–5 years
The interviewer asks: “How do you version a public JSON API?” Strongest answer?
The strongest answer
Compatibility first: additive changes in place. When I must break, a version in the URL or a negotiated header, both documented, with a sunset date. I don't silently reshape fields.
Why it works
Exactly. Most “versions” should be additive. A real break needs a dual-run window, not a surprise. URL vs header is a taste; the contract and the sunset are the job.
What a good answer covers
- Prefer additive, compatible changes.
- Breaking change → explicit version + sunset.
- Document it; dual-run it.
- Don't reuse names for new meanings.
Answers that fall short
- Close, but not the strongest: Ship breaking changes on Friday; clients will adapt.
Friday breaking changes are how you spend the weekend. Version and communicate. - Weak: A new microservice per version so old URLs never change.
A service per version doubles ops without solving payload compatibility. Version the contract, not the org chart. - Red flag: Reuse field names for new meanings so the JSON stays small.
Repurposing a field is the worst break — old clients think they understand the data. New name, or a new version.
Who gets asked this
More API Development questions
- When would you pick gRPC over a JSON REST API, and what do you give up?
- Your OpenAPI document lists every path and method and nothing else. A partner team says integrating still…
- The interviewer asks: “You're building an internal platform API other teams will live on. What changes?”…
- The interviewer asks: “When do you use GET versus POST?” Strongest answer?
- The interviewer asks: “What's the difference between HTTP 401 and 403?” Strongest answer?
- The interviewer asks: “When is 404 the right status, and when is 400?” Strongest answer?
- The interviewer sketches /getOrder and /doDeleteUser. Strongest design?
- The interviewer asks: “Which HTTP methods are safe to retry, and why?” Strongest answer?