Quick revision
The short answer
We first quantify what each version costs (code paths, test matrix, incidents) against the customers and revenue still on it. Then we stop adding major versions: the core implements only the latest model, and an edge translation layer, often with date-based version pinning and a chain of small transformations, maps older versions onto it. Retiring the oldest versions becomes a negotiated business decision with commercial teams, supported by migration tooling and tied to contracts.
What to remember
In this answer, we replaced the habit of shipping major versions with a strategy for the next five years. We priced each version against its users, moved to additive evolution, put a translation layer with date-based pinning and transformation chains in front of a core that knows only the latest model, kept that layer bounded, and treated retirement of the oldest versions as a commercial decision with migration tooling and contract terms. Versioning became a governance decision rather than an engineering habit.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
We first quantify what each version costs (code paths, test matrix, incidents) against the customers and revenue still on it. Then we stop adding major versions: the core implements only the latest model, and an edge translation layer, often with date-based version pinning and a chain of small transformations, maps older versions onto it. Retiring the oldest versions becomes a negotiated business decision with commercial teams, supported by migration tooling and tied to contracts.
Why this question is asked
Five live major versions usually mean five partly copied code bases, a test matrix that multiplies with every feature, and engineers who spend more time back-porting than building. The cost grows quietly until it dominates the roadmap. Interviewers ask this question at the most senior level because the fix is not a clever header; it is a change of strategy that involves product, sales and engineering. In this answer, we will measure the cost, look at evolution without major versions, see how a translation layer with version pinning works, plan the retirement of old versions, and make versioning a governance decision.
1Putting a Price on Each Version
We cannot argue for a strategy change with a feeling that versions are expensive. So we measure, per version: how many code paths and DTOs exist only for it, how many test cases and environments it adds to the matrix, how many incidents in the last year involved it, and how much engineering time back-porting consumed. On the other side we list the customers, contracts and revenue still on each version.
The result often looks like this: version 1 serves 2 percent of traffic from 30 customers but causes a fifth of the incidents, while version 5 serves 60 percent. That table is the basis for every decision that follows, and it is the document we take to commercial leaders.
| Version | Share of traffic | Customers | Share of incidents |
|---|---|---|---|
| v1 | 2% | 30 | 21% |
| v2 | 6% | 85 | 18% |
| v3 | 12% | 140 | 15% |
| v4 | 20% | 260 | 14% |
| v5 | 60% | 900 | 32% |
2Evolving Without New Major Versions
The root cause of five versions is that every breaking change produced a whole new copy of the API. The first change in strategy is to stop doing that. Most changes are made additive, as a tolerant-reader rule allows: new optional fields, new endpoints, new values clients must handle. Genuinely breaking changes are kept small and described individually, rather than bundled into a new major version.
Each individual breaking change is then implemented as a translation at the edge. The core service, its domain model and its database know only the latest contract. A thin layer in front of it converts a request from an older contract into the current one, and converts the current response back into the older shape. Back-porting a feature to old versions disappears, because the feature exists only in the core and old clients simply see it through their translation, or not at all.
3Version Pinning With Transformation Chains
A well-known way to organise the translation layer is date-based versioning with per-client pinning. Each breaking change gets a dated version such as 2026-03-01. When a client first integrates, its account is pinned to the current date version, and it can override the pin per request with a header. The edge holds an ordered list of small transformations, one per breaking change. For a client pinned to an old date, the response from the core is passed back through every transformation newer than that date, newest first, until it reaches the shape the client expects.
- Clients pinned to dated versions2024-01-10, 2025-06-01, 2026-03-01
- Edge translation layerchain of small request and response transformations
- Core API and domain modelimplements only the latest contract
- Databaseone schema, no per-version data
4 layers, from the top down. Step through them one at a time.
Notice that each transformation knows only about one change, so it stays small and testable. Adding a new breaking change means adding one new transformation, not a new copy of the API. A request transformation chain works the same way in the opposite direction, upgrading old requests step by step to the current contract.
4Keeping the Translation Layer Bounded
A translation chain that only ever grows becomes its own problem, so we give it limits. Each transformation has an owner and tests that run an old-shaped request through the whole chain. We record how much traffic still depends on each transformation, and when no client is pinned before a change's date, that transformation is deleted. Some changes cannot be expressed as a translation at all, for example a field the core no longer stores; those must be treated as real retirements and negotiated, rather than hidden in the edge.
5Retiring the Oldest Versions as a Business Decision
The existing five versions do not vanish because we built a new layer. The oldest ones must be retired, and that is a commercial question, because customers have contracts and integrations they paid for. We take the cost table to product and sales leaders, agree on retirement dates, and tie API support periods into new contracts so the problem does not return. We help customers move with migration guides, compatibility reports that show which of their calls will change, and where possible by mapping the old version onto the new edge layer so their move is small.
Finally, versioning becomes governance. A new breaking change is approved by a group that includes product and commercial voices, because each one creates a long-term cost the business carries, not only the engineering team.
6Follow-up questions
How would you structure the edge translation layer so it does not grow without limit?
One small, tested transformation per breaking change, ordered by date, with an owner and a traffic metric showing how many clients are pinned before it. Transformations are deleted once no client needs them, and support windows in contracts guarantee that this happens. Changes that would require the edge to hold its own data or business logic are not allowed into the layer; they go through a negotiated retirement instead.
Does this approach mean clients never have to migrate?
No. It makes old versions cheap to keep for a while, but support windows still end. Pinning simply lets clients choose when to upgrade, one dated step at a time, instead of facing a large jump between major versions.
What is the main risk of the strategy?
Moving to it. Teams must agree on one core model and rewrite back-ported code as translations, which is a large project. We do it per area, starting with the endpoints that cause the most back-porting work.
7Conclusion
In this answer, we replaced the habit of shipping major versions with a strategy for the next five years. We priced each version against its users, moved to additive evolution, put a translation layer with date-based pinning and transformation chains in front of a core that knows only the latest model, kept that layer bounded, and treated retirement of the oldest versions as a commercial decision with migration tooling and contract terms. Versioning became a governance decision rather than an engineering habit.
Open with
First I would put numbers on each of the five versions: the code paths and DTOs that exist only for it, its share of the test matrix and of incidents, and the back-porting hours, compared with the customers and revenue still on it.
Then, if they want more
That makes it a business conversation instead of an engineering complaint. Then I would stop creating major versions. Most changes can be additive. For the breaking ones, the core service implements only the latest model, and a translation layer at the edge maps older contracts onto it.
A good way to structure that is date-based version pinning, where each client is pinned to the version current when it integrated, and each breaking change is a small transformation that converts the current response back to the shape before that change. The edge applies the chain of transformations newer than the client's pin.
New features then live only in the core, so back-porting disappears. I would keep the chain bounded by deleting transformations nobody is pinned before. For the existing oldest versions, I would negotiate retirement with commercial teams, offer migration tooling, and put support windows into contracts, and I would make future breaking changes a governance decision involving product and sales.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Framework reference, Spring Web MVC
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Your company supports five major versions of its public API, and each new feature must...": https://scrivio-interview-library.netlify.app/spring-boot/rest-api-design/1cdb10312a/