Debug an Issue-Creation API Failure
AmazonSoftware Engineer · Technical ScreenLast updated
This problem tests your systematic troubleshooting methodology for a distributed system, focusing on narrowing down the root cause of an API request failure.
Scenario
You are a Software Engineer at a company where internal dashboards allow users to report bugs. Users are reporting that the 'Create Issue' button on the dashboard is failing. The dashboard uses a frontend React application, an API Gateway, a microservice written in Go, and a PostgreSQL database.
The Task
Describe your step-by-step approach to identify where the failure occurs. You must propose a debugging strategy that minimizes impact on production while isolating the fault.
Consider the following components:
- Frontend: Client-side state, browser network console.
- Network/Gateway: Permissions, rate-limiting, authentication headers.
- Backend Service: Logs, configuration files, upstream/downstream connection strings.
- Database: Locks, schema migrations, connection pool exhaustion.
Outline your specific debugging actions, starting from the client and moving toward the database, and define which specific metrics or logs you would prioritize for each layer.
Example Situation
Assume the user clicks 'Create Issue' and receives a 500 Internal Server Error. How do you verify if the issue is due to a failing upstream dependency (e.g., an email notification service) versus a database write failure without manually corrupting production data?
Hints
Hint 1
Start by replicating the request using `curl` or Postman to determine if the issue is restricted to the UI or exists at the API layer.
Hint 2
Examine the correlation ID provided in the error response to trace the request lifecycle through distributed logging systems like CloudWatch or Jaeger.
Hint 3
Verify database connection pool health and check for uncommitted transactions that might be holding locks.
Follow-up questions
- If the issue is intermittent, how would you use log sampling or request tracing to identify the pattern of failing requests?
- How would you implement a circuit breaker pattern to prevent this failing service from impacting other downstream dependencies?
- If the fix requires a hotfix that involves a database schema change, how do you perform this safely without downtime?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.