📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

Tell me about a time an API release broke a mobile app that users hadn't updated. Walk through how you detected it, how you rolled back or mitigated, and the versioning, compatibility and deprecation policy you put in place so older app versions keep working.

A real-world incident where an API change broke old mobile app versions: detection, rollback and mitigation, root cause, and the resulting policy for app-version telemetry, compatibility windows, minimum-version enforcement and deprecation.

Senior RealWorldScenario Advanced api-versioning backward-compatibility deprecation incident-response mobile web-api

🎯 Key points

  • Mobile clients can't be redeployed: old versions live for months or years
  • Detect via error rate segmented by app version (X-App-Version header) in Application Insights, alongside client crash telemetry (Crashlytics)
  • Mitigate first: roll back the deployment or flip a feature flag, then investigate
  • Root cause usually a 'harmless' change: renamed field, new enum, stricter validation, changed default, new auth scope or tighter rate limit
  • Policy: support window (e.g. last 12 months of app versions), contract tests against each supported app version
  • Minimum supported version endpoint and forced-upgrade flow for genuine breaks
  • Expand-and-contract and versioned endpoints instead of in-place changes; API changes reviewed with the mobile team
  • Blameless post-incident review with measurable follow-ups

⏱ 30-second answer

Mobile is where backward compatibility hurts most, because you can't redeploy the client: app store review, staged rollouts and users who never update mean old versions call your API for months.

The story structure: detect through errors segmented by app version (I send an X-App-Version header and chart failures by it), mitigate first by rolling back the API deployment or flipping a feature flag, then find the root cause, typically a change that looked additive or harmless.

The lasting fix is a policy: a published support window for app versions, contract tests that run each supported version's expectations against every API build, expand-and-contract instead of in-place changes, and a minimum-version check with a graceful forced-upgrade screen for genuine breaks. The trade-off is carrying compatibility code for the length of the support window.

🗣 Full answer (senior)

How I would answer this in an interview

"The situation: at [company] we had a [retail] app with about [N] monthly users on iOS and Android, and an ASP.NET Core API behind Azure Front Door. A backend release [renamed deliveryWindow to deliverySlot and made it an object], because the new web front end needed it, and the web and the latest app version were updated together. What nobody accounted for was that [around 35]% of users were still on app versions from the last six months, which expected the old field.

We detected it from the app side first: crash-free sessions in [Firebase Crashlytics / App Center] dropped on older versions within [20 minutes], and in Application Insights the checkout dependency failure rate jumped, but only for requests with older X-App-Version values. I was [on call / the tech lead]. My first action was mitigation, not diagnosis: we redeployed the previous API build through our slot swap in [about 10 minutes], and crash rates recovered. Then we found the cause in the PR: a field rename treated as a refactor, with no contract test covering older clients.

The fix that mattered was the policy afterwards. We published a support window: the API supports every app version released in the last 12 months. Every request carries the app version, and we have a dashboard of traffic by version. Contract tests capture the requests and responses each supported app version uses and run on every API build. Changes follow expand-and-contract: add the new field, keep the old one populated until the last app version that reads it falls out of the window. And for real breaks there's a minimum-version endpoint the app checks at start-up, which shows a friendly upgrade screen instead of crashing. Over the next [year] we had [zero] incidents of that kind, and the forced-upgrade path was used [once], deliberately."


Incident timeline (template)

Time Event
T+0 API release with field rename deployed to production
T+15 min Crash-free sessions on app versions [4.1-4.6] drop from 99.6% to [91]%
T+20 min Alert on checkout failure rate segmented by app version
T+25 min Decision: roll back first, investigate second
T+35 min Previous build restored via slot swap; crash rate recovers
T+2 h Root cause found: rename without compatibility; no old-client contract test
T+1 week Blameless review; policy and follow-ups agreed

The policy we put in place

Element Detail
App version telemetry X-App-Version and platform on every request; Application Insights custom dimension
Support window All app versions released in the last 12 months (published to product and support)
Compatibility tests Recorded contracts per supported app version run against every API build
Change rule Expand and contract; no renames or type changes in place
Minimum version GET /app-config returns minimumVersion; app shows upgrade screen below it
Deprecation Old fields removed only when traffic from versions reading them is under [0.5]%

Production example

The rollback took [10] minutes, but the incident affected about [8,000] checkout attempts. In the six months after the policy, oasdiff and the per-version contract tests blocked [four] changes that would have broken older app versions.

🔍 What the interviewer is checking

Checks incident handling under pressure and, more importantly, the senior ability to turn an incident into a durable compatibility policy.

Green flags

  • Mitigates first (rollback or flag), then diagnoses
  • Segments telemetry by client version
  • Describes a concrete policy: support window, contract tests, expand and contract, minimum version
  • Reports measurable results and a blameless review

Red flags

  • Blames the mobile team or users for not updating
  • No telemetry by version
  • Fix is "be more careful next time"
  • Story with no numbers or no personal role

📚 Learn in depth

1. Why mobile is different

web client:     deploy ──► every user on the new version within minutes
mobile client:  build ──► store review (hours-days) ──► staged rollout (days) ──►
                users update over weeks... some never do

version distribution 3 months after a release (typical):
  latest  ██████████████████ 55%
  -1      ███████ 20%
  -2      ████ 12%
  older   ███ 13%

The API must serve the whole tail. A web release can be coordinated with the API; a mobile release can't.

2. Detecting by client version

You can only segment what you record. Options:

  • A custom header (X-App-Version: 4.6.1, X-App-Platform: ios) set by the app's HTTP client.
  • The User-Agent (less reliable to parse).

In ASP.NET Core, a small middleware puts these on Activity.Current as tags, which Application Insights records as custom dimensions. Then a KQL query groups failures by version:

requests
| where timestamp > ago(1h)
| summarize failures = countif(success == false), total = count()
    by appVersion = tostring(customDimensions["app.version"])
| extend rate = todouble(failures) / total
| order by rate desc

Alerts should fire on the failure rate per version, because a total rate can hide a 30% failure in a version with 10% of traffic.

3. Mitigate before you diagnose

The fastest safe action is usually reverting the change:

  • Slot swap back on App Service, or redeploy the previous container image.
  • Feature flag off if the change was behind one (Azure App Configuration feature management).
  • Database changes make rollback harder, which is why schema changes should also be expand-and-contract.

4. Compatibility tests per app version

Two practical approaches:

  1. Consumer-driven contracts (Pact): each app release publishes its pact, tagged with the app version; the API pipeline verifies all pacts for versions inside the support window.
  2. Recorded traffic replay: capture representative requests per app version in a test environment and assert responses still deserialise with that version's models.

5. Minimum version and forced upgrade

app start ──► GET /app-config ──► { minimumVersion: "4.2.0", recommendedVersion: "4.8.0" }
                                     │
                    current < minimum │ ──► blocking upgrade screen (store link)
                    current < recommended ──► dismissible banner

The config endpoint itself must never break, so keep it tiny and version-neutral. The API can also return 426 Upgrade Required (or a ProblemDetails with a code like CLIENT_VERSION_UNSUPPORTED) when a too-old version calls a changed endpoint, which the app maps to the upgrade screen.

6. Running the post-incident review

Blameless format: timeline, impact (users, transactions), what went well (fast rollback), what went wrong (no per-version contract), and follow-ups with owners and dates. The follow-ups, not the incident, are what an interviewer is listening for.

Try it yourself

  1. Add middleware that tags Activity.Current with X-App-Version and confirm it appears in Application Insights.
  2. Write the KQL query above and build an alert on per-version failure rate.
  3. Implement GET /app-config with minimum and recommended versions from configuration.
  4. Rename a DTO field and write a test using an old client's model that fails; then fix it with expand-and-contract.
  5. Practise the STAR story out loud in under two minutes.

💻 Code

App-version telemetry, a minimum-version gate and an expand-and-contract response that serves old and new apps.

// Program.cs
using System.Diagnostics;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddProblemDetails();
builder.Services.Configure<AppVersionOptions>(builder.Configuration.GetSection("AppVersions"));

var app = builder.Build();

// 1. Record the client version on every request so failures can be segmented by version.
app.Use(async (ctx, next) =>
{
    if (ctx.Request.Headers.TryGetValue("X-App-Version", out var v))
        Activity.Current?.SetTag("app.version", v.ToString());
    if (ctx.Request.Headers.TryGetValue("X-App-Platform", out var p))
        Activity.Current?.SetTag("app.platform", p.ToString());
    await next();
});

// 2. Tiny, version-neutral config endpoint the app calls at start-up.
app.MapGet("/app-config", (Microsoft.Extensions.Options.IOptionsSnapshot<AppVersionOptions> o) =>
    TypedResults.Ok(new { o.Value.MinimumVersion, o.Value.RecommendedVersion }));

// 3. Expand and contract: new apps read deliverySlot; old apps still get deliveryWindow.
app.MapGet("/v1/orders/{id:int}", (int id) =>
{
    var slot = new DeliverySlot(new DateTimeOffset(2026, 11, 21, 9, 0, 0, TimeSpan.FromHours(11)),
                                new DateTimeOffset(2026, 11, 21, 12, 0, 0, TimeSpan.FromHours(11)));
    return TypedResults.Ok(new OrderResponse(
        id,
        DeliverySlot: slot,
        // Kept until app versions that read it fall outside the 12-month support window.
        DeliveryWindow: $"{slot.Start:HH:mm}-{slot.End:HH:mm}"));
});

app.Run();

public sealed class AppVersionOptions
{
    public string MinimumVersion { get; set; } = "4.2.0";
    public string RecommendedVersion { get; set; } = "4.8.0";
}

public sealed record DeliverySlot(DateTimeOffset Start, DateTimeOffset End);

public sealed record OrderResponse(
    int Id,
    DeliverySlot DeliverySlot,
    [property: System.Obsolete("Remove when app < 4.7 traffic < 0.5%")] string DeliveryWindow);
// appsettings.json - change without a deployment via Azure App Configuration if needed
{ "AppVersions": { "MinimumVersion": "4.2.0", "RecommendedVersion": "4.8.0" } }

⚠ Common mistakes

  • Mistake: Treating the API and the latest app as one deployable unit. Why it is wrong: Older app versions stay in use for months and can't be updated by you. Instead: Design for the whole version tail inside a published support window.
  • Mistake: Diagnosing before mitigating. Why it is wrong: Users keep failing while you read code. Instead: Roll back or flip the flag first, then investigate.
  • Mistake: Monitoring only the overall error rate. Why it is wrong: A large failure in a minority version hides in the average. Instead: Alert on failure rate per app version, and watch client crash telemetry too.
  • Mistake: Renaming fields as a "refactor". Why it is wrong: A rename is a remove plus an add for every client. Instead: Expand and contract, removing the old field after the support window.
  • Mistake: Regression tests that only use the latest client models. Why it is wrong: They pass while every older app version breaks. Instead: Automated integration or contract tests that deserialise responses with each supported app version's models (Pact pacts tagged by app version, or recorded requests replayed in CI).
  • Mistake: Looking only at schema changes for root cause. Why it is wrong: New required auth scopes, tighter rate limits, slower responses past the app's timeout and a dependency change can break old apps with an identical schema. Instead: Review the whole release diff, including gateway policies and configuration.
  • Mistake: API changes planned without the mobile team. Why it is wrong: The API team doesn't know which fields old app versions read. Instead: Review contract changes with the mobile team and share the version distribution dashboard.
  • Mistake: No minimum-version mechanism. Why it is wrong: When a break is unavoidable, old apps crash instead of asking users to upgrade. Instead: Ship a config endpoint and upgrade screen in the very first app release.
  • Mistake: Inventing personal details in the interview story. Why it is wrong: Interviewers probe details and invented ones collapse. Instead: Use your real incident and real numbers; if you don't have one, say so and walk through how you would handle it.

🏛 Senior insight: trade-offs

The incident is the least interesting part of this answer; interviewers want the system you built so it couldn't happen again, and evidence you balanced compatibility cost against product speed. A 12-month support window means carrying old fields and mapping code for a year, so I agree the window with product and make the cost visible: a dashboard of traffic by version and a list of compatibility shims with their removal conditions.

Option When it fits Cost When not to
Expand and contract in place Most field and shape changes Duplicate fields for the support window Fundamentally different models
New versioned endpoint (/v2/...) Large, incompatible changes Two endpoints to maintain Small additive changes
Backend for frontend per app major Very different clients (mobile vs web) Extra service to run Small teams, similar clients
Forced upgrade (minimum version) Security fixes, unavoidable breaks User friction, store-review timing Routine changes

I measure success with crash-free sessions by app version, the share of traffic outside the support window, and the number of compatibility breaks caught in CI versus in production.

🔗 Follow-ups the interviewer may ask

  1. When: Candidate mentions renames or enum values as the root cause Why: Checks the general classification of breaking changes and tolerant readers.
    How to answer

    A breaking change is anything that makes a correct existing client fail or behave wrongly. Obvious ones are removing or renaming fields and changing types. Less obvious ones: a new required request field, stricter validation, a changed default or sort order, a different status code, and a new enum value that a client's exhaustive switch doesn't handle.

    Adding optional fields and endpoints is safe only if clients are tolerant readers: they ignore unknown members and unknown enum values. System.Text.Json ignores unknown members by default, but opting into strict settings, such as UnmappedMemberHandling.Disallow or a plain JsonStringEnumConverter, makes a client throw JsonException on the next additive server change.

    I protect compatibility with OpenAPI diffs for structure and consumer-driven contract tests (Pact) for the behaviour each consumer actually relies on, and I document what isn't promised. The trade-off: every observable behaviour becomes a contract, so you decide deliberately what you promise.

  2. When: Candidate mentions versioned endpoints or deprecation headers Why: Checks hands-on versioning and deprecation implementation.
    How to answer

    I add Asp.Versioning 10.x (Asp.Versioning.Http for Minimal APIs, plus Asp.Versioning.Mvc.ApiExplorer and Asp.Versioning.OpenApi), declare a versioned API with route groups per version, and let API Explorer group endpoints into v1 and v2 so the built-in OpenAPI support emits one document per version.

    For deprecation I mark 1.0 as deprecated, so api-deprecated-versions is reported, and send the Deprecation header (RFC 9745, @epoch-seconds) and Sunset header (RFC 8594, HTTP-date) with a Link to the migration guide.

    Both versions call the same handler; only the request and response DTOs and their mapping differ. The trade-off: every extra version is more mapping code and tests, so I keep the version count low and measure v1 traffic to know when to remove it.

  3. When: Candidate mentions web and mobile needing different shapes Why: Checks architectural judgement about BFFs versus a shared API with compatibility rules.
    How to answer

    Maybe. A mobile BFF owned by the app team lets the app's contract evolve with the app and isolates it from changes the web needs, which removes a lot of coordination. It can also aggregate several backend calls into one mobile-shaped response, cutting round trips and payload on slow mobile networks.

    But it is another service to host, secure, monitor and be on call for, it adds a hop and a second contract to version, and it moves rather than removes compatibility: the BFF still has to serve every supported app version. I would introduce one when web and mobile needs genuinely diverge or the app team wants to own its API, not just to dodge one incident.

🛠 Real-world problems: how you handle them

Field rename crashed checkout on older app versions
Situation
A [retail] mobile app with [N] monthly users on iOS and Android called an ASP.NET Core API on Azure App Service behind Front Door. About [35]% of users were on app versions older than the latest. A backend release renamed `deliveryWindow` to an object field `deliverySlot` for the new web front end.
Signals
Crash-free sessions in [Crashlytics] dropped from 99.6% to [91]% for app versions [4.1-4.6] within 15 minutes; Application Insights showed checkout failures concentrated in requests with older `X-App-Version` values; app store reviews mentioning crashes started within the hour.
Investigation
Segmented Application Insights requests and exceptions by the `app.version` custom dimension; correlated the start time with the release in Azure DevOps; inspected the app's crash stack (null reference on `deliveryWindow`); found the rename in the release PR with no compatibility review or per-version contract test.
Resolution
Immediate: swapped back to the previous deployment slot ([10] minutes) and confirmed recovery per version. Then reintroduced the change as expand-and-contract (both fields), and redeployed with a contract test using the old app's model.
Prevention
Published a 12-month app-version support window; added per-version failure alerts; Pact contracts per supported app version in the API pipeline; oasdiff breaking gate; `/app-config` minimum-version mechanism with an upgrade screen; renames banned in place by the API guidelines.

How to tell it (STAR)

**S:** A backend release renamed a delivery field for our new web front end and crashed checkout for the [third] of mobile users on older app versions. **T:** As [on-call tech lead] I had to restore checkout and make sure old app versions couldn't be broken like that again. **A:** I rolled back with a slot swap in [10 minutes] before investigating, then traced it through Application Insights segmented by app version to the rename. I reshipped it as expand-and-contract, and led the policy work: a 12-month support window, per-version alerts, contract tests for every supported app version and a minimum-version upgrade path. **R:** About [8,000] checkouts were affected that day; in the following [year] we had zero version-compatibility incidents, and CI blocked [four] changes that would have caused one.

More in API Design

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me