Katkat

Debug an Issue-Creation API Failure

AmazonSoftware Engineer · Technical Screen

Last 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:

  1. Frontend: Client-side state, browser network console.
  2. Network/Gateway: Permissions, rate-limiting, authentication headers.
  3. Backend Service: Logs, configuration files, upstream/downstream connection strings.
  4. 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?