Interview Prep/Real-World Interview/Deployments and releases

How do you deploy a change that needs both a new API version and a new frontend at the same time?

AdvancedScenarioDeployments and releases
Answer

Situation read → You almost never can deploy two components atomically. Design so the order doesn't matter.

What I'd do →

  1. Make the backend backward compatible: add the new field or endpoint while keeping the old one. Deploy backend first.
  2. Deploy the frontend that uses the new API. Old cached frontends in browsers still work against the old contract.
  3. Gate the new user-facing behaviour behind a flag so it turns on when both sides are live.
  4. After traffic to the old endpoint drops to zero (check access logs or metrics), remove it in a later release.
  5. For mobile clients, keep old API versions alive much longer, since users don't update.

Why → Browsers, CDNs and mobile apps cache old clients for days. "Deploy both together" is a myth.

Interview tip → Mention CDN-cached JavaScript; it is why the frontend can't assume a fresh backend contract.

All Real-World Interview questions Roadmap: Interview readiness

More on Deployments and releases