Decommission a depended-on API gracefully
graceful API deprecation with live consumers.
map consumers and usage, provide a migration target, announce a versioned timeline, decommission only after traffic hits zero.
shutting off the API with no replacement.
WHAT THIS TESTS The interviewer checks whether you treat an API as a contract with real consumers. Sunsetting the product does not free you to break dependents; you must orchestrate a migration so the two active products keep working throughout.
A GOOD ANSWER COVERS Start with discovery: use API access logs and analytics to learn exactly which endpoints the two products call, how often, and which fields they actually use, since the contract in practice is narrower than the full surface. Decide the migration target. The needed capability might be extracted and rehosted in a surviving service, or the consumers redirected to an equivalent API. Communicate a clear deprecation plan: announce a timeline, version the API, return deprecation response headers and a sunset date so callers get programmatic warnings, and document the migration path. Actively support the two consuming teams, treating their migration as part of the project's definition of done, not their problem. Crucially, gate the final shutoff on telemetry: only decommission after monitoring confirms traffic from both products has dropped to zero. Keep a brief rollback or grace window in case a forgotten caller appears.
COMMON WRONG ANSWERS Picking a shutoff date and turning the API off, breaking the dependents. Assuming the consuming teams will migrate without help or a target. No usage discovery, so you do not know what is actually used. No traffic monitoring before final decommission.
LIKELY FOLLOW-UPS How do you know it is safe to finally turn it off? What goes in a deprecation header and sunset response? How do you handle a consumer that misses the deadline?
ONE CONCRETE EXAMPLE Logs show product A uses three endpoints and product B uses one. You extract that capability into a surviving billing service, publish the new endpoints, add Deprecation and Sunset headers to the old API with a ninety-day window, and pair with both teams to migrate. When dashboards show old-API traffic at zero for two weeks, you decommission it, sunsetting the product without an outage.
Read the original → oneuptime.com
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.