How would you evolve a public API without breaking existing clients?
Interactive Practice Mode
Formulate your thoughts or take notes before revealing the model solution.
Saved automatically
Model Answer & Deep-Dive Explanation
First identify the documented contract and real client usage. Prefer additive changes, but check whether clients reject unknown fields or enum values. Introduce incompatible changes through an explicit version or migration path, publish examples, and support an agreed overlap period. Use contract tests and telemetry to detect old-client usage before removal. Deprecate with a clear timeline and rollback plan. Compatibility includes behavior, validation, error responses, and performance assumptions, not just whether the same method names and field types still exist.
Related Questions in Software Engineering & OOP
Explain the SOLID Principles of Object-Oriented Software Engineering with Examples
Intermediate level • 621 views
Explain ACID properties in relational databases and how different Transaction Isolation Levels prevent concurrency anomalies.
Intermediate level • 151 views
How does encapsulation protect an object’s rules? Explain using a bank account.
Easy level • 1 views
How do abstraction and inheritance solve different problems?
Easy level • 1 views
What is the Liskov substitution principle, and why can a square-as-rectangle hierarchy violate it?
Medium level • 1 views