How do you deploy a change that alters an API or contract without breaking consumers?
What they are really testing: Whether you understand that rolling deploys run old and new together, so changes must be backward-compatible, with versioning and expand/contract for breaking changes.
A real interview question
How do you deploy a change that alters an API or contract without breaking consumers?
What most people say
drag me
“I would update the API and tell the consumers to update their code.”
Coordinating a simultaneous breaking change across producer and all consumers is fragile and causes outages during the rolling window where both versions run. The safe approach is backward-compatible changes and expand/contract, not a flag-day break.
The follow-ups they ask next
Why is a simultaneous breaking change across producer and consumers so risky?
They deploy independently and rolling deploys run both versions, so there is always a window where an old caller hits a new server or vice versa. A breaking change in that window causes errors. Expand/contract avoids the flag day.
What is a tolerant reader?
A consumer that ignores fields it does not recognize rather than failing on them. It lets the producer add new fields without breaking existing consumers, key to evolving APIs backward-compatibly.
What the interviewer is listening for
- Knows old+new run together (rolling/independent deploys)
- Additive/backward-compatible + expand/contract
- API versioning + tolerant readers
What sinks the answer
- Coordinated flag-day breaking change
- Ignores the both-versions-live window
- Renames/removes in one step
If you genuinely do not know
Say this instead of freezing. Reasoning out loud from what you do know beats silence every single time, and a good interviewer is listening for exactly that.
“In [rolling and independent deploys, old and new run together], so a contract change must [work for both at once]. Prefer [additive, backward-compatible changes, new optional fields/endpoints, not remove/rename]. For breaking changes use [expand/contract: add new alongside old, migrate consumers, then remove old later]. Support with [API versioning and tolerant readers (ignore unknown fields)]. Never [break and remove in one step].”
Keep going with deployment
Foundation
What do CI and CD actually mean, and what is the difference between continuous delivery and continuous deployment?
Foundation
Why should you build an artifact once and promote the same one through environments?
Junior
What stages should a good CI/CD pipeline have?
Junior
A deploy went bad in production. How do you handle rollback, and how do you make rollback easy?
Junior
What are feature flags, and how do they decouple deployment from release?
Mid
Compare blue-green and canary deployments. When would you reach for each?
Knowing the answer is not the same as recalling it under pressure
Sign in to send the questions you fumble to spaced recall, so they come back right before you would forget them, and learn the concepts behind them with hands-on labs.
Start free