ASP.NET Core Web API Interview Question #199

How would you investigate intermittent 500 errors after deployment?

Senior API Design, Architecture, Scalability & Production Scenarios Senior Advanced

Quick Interview Answer

Start with the deployment time window and compare error rates by endpoint, instance, version, and dependency. Use trace identifiers to connect failed requests to logs and distributed traces, then inspect exceptions, database failures, configuration differences, timeouts, resource pressure, and recent schema changes.

Detailed Explanation

Start with the deployment time window and compare error rates by endpoint, instance, version, and dependency. Use trace identifiers to connect failed requests to logs and distributed traces, then inspect exceptions, database failures, configuration differences, timeouts, resource pressure, and recent schema changes.

If impact is significant, follow the system's rollback or mitigation procedure while preserving diagnostics. Fix the identified cause, add a regression test or monitoring signal, and review why pre-production checks did not detect it.

Code Example

// Investigation flow:
// metrics -> affected route/version
// traces  -> failing dependency/operation
// logs    -> exception + safe context
// config/schema/resource checks
// mitigate/rollback when required
// regression test + permanent fix