HardπŸ‘€ 8-15 years 1 min read

How do you evolve a public API without breaking existing clients?

Reviewed by Gurusankar M.

Asked inAmazonMicrosoftGoogleStripe-like
#backward compatibility#deprecation#contract#breaking change#api design
Report issue

⚑ Short Answer

Change additively: add optional fields/endpoints, never remove or repurpose existing ones, keep defaults stable, and tolerate unknown fields. For unavoidable breaks, introduce a new version, support both during a published deprecation window, and communicate via docs + Deprecation/Sunset headers.

β˜•Coffee Chat Question

Concept Made Simple

β€œHow do you evolve a public API without breaking existing clients?”

🧠Mind Map Answer

Remember It Faster

Safe→add optional fields/endpoints
Breaking→remove/rename/retype/make-required
Process→new version + deprecation window
Signal→Deprecation/Sunset headers + docs

πŸ”₯What If?

Think Beyond the Expected

You must remove a field thousands of clients still use β€” what's the rollout?

Don't remove it abruptly. Mark it deprecated in docs and via Deprecation/Sunset headers, monitor who still uses it (telemetry), reach out to those consumers, keep it working through the announced window, then remove only after usage drops β€” ideally behind a new version.

πŸ˜‚Real World

Stripe/GitHub-style API longevity comes from additive evolution + clear deprecation policies; the costliest API mistakes are silent breaking changes that take down integrations.

🎯Interviewer's Expectation

Keywords they're listening for:

βœ“ additive changesβœ“ what counts as breakingβœ“ tolerant readerβœ“ deprecation window + headersβœ“ usage telemetry

⚠️Common Mistakes

  • βœ—Removing/renaming fields in place
  • βœ—Repurposing an existing field's meaning
  • βœ—No deprecation communication

βœ…Best Practices

  • βœ“Evolve additively; tolerate unknown fields
  • βœ“Publish + signal deprecations (Sunset header)
  • βœ“Use contract tests + usage telemetry

πŸ”Follow-up Questions

  • 1What is the 'tolerant reader' principle?
  • 2How do consumer-driven contract tests help?
  • 3How do you measure who still uses a deprecated field?

🧩Related Technologies

OpenAPIPact (contract testing)Deprecation/Sunset headers

Continue Learning with AI

Take this question deeper with your favourite AI assistant. Pick a depth, copy the prompt, or open it directly β€” AI is your learning companion, not a shortcut.

Plain-language foundations

I'm preparing for a software engineering interview and want to understand this from scratch, as a beginner.

Topic: Versioning (REST APIs)
Interview question: "How do you evolve a public API without breaking existing clients?"

Please:
1. Explain the core idea in simple, plain language, using an everyday analogy.
2. Define any technical terms you use.
3. Walk through one small, concrete example.
4. Finish with a single sentence I can easily remember.

Keep the tone friendly and assume I'm new to this topic.

Was this answer helpful?

Support our platform by exploring our recommended products.

As an Amazon affiliate, purchases through these links may earn us a small commission β€” at no extra cost to you. It helps keep Full Stack Interview Guru free.

Related Questions