SWE Fundamentals: Making Robust HTTP Calls (Client/Service)
You need to integrate with an external HTTP API (could be an internal microservice or a third-party service). The call is on the critical path of a user request.
Prompt
Explain how you would implement this HTTP integration robustly:
-
Which HTTP method(s) you would use and why
-
Timeouts (connect/read), retries, and backoff
-
Which failures are retryable vs not
-
Authentication and headers
-
Rate limiting and pagination
-
Observability (logging/metrics/tracing)
-
How you would avoid duplicate side effects (idempotency)
Assume high QPS and that the external API can be slow or intermittently failing.