Build an API aggregator with concurrency and retries
Quick Overview
Build an API aggregator with concurrency and retries evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Build an API aggregator with concurrency and retries
Company: DoorDash
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Onsite
Build a service that exposes one endpoint which calls three external HTTP APIs in parallel, aggregates their responses, and returns a combined JSON result. Requirements: per-call timeouts and an overall request timeout; concurrency using futures/promises; a policy to wait for all vs fail-fast; retries with capped exponential backoff and jitter via a reusable RetryTemplate accepting a Callable; partial-failure handling and default values; structured logging, metrics, and clear code organization. Provide interface definitions, concurrency flow, and sample error-handling logic.
Quick Answer: Build an API aggregator with concurrency and retries evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Build an API aggregator with concurrency and retries
DoorDash
Jul 15, 2025, 12:00 AM
hardSoftware EngineerOnsiteSystem Design
17
0
Build an API aggregator with concurrency and retries
Build an Aggregation Service with Parallel Calls, Timeouts, Retries, and Observability
Context
You are designing a backend service that exposes a single HTTP endpoint. When called, the endpoint must call three external HTTP APIs in parallel, aggregate their responses, and return a combined JSON result. The service must be robust to timeouts, failures, and include proper retries, observability, and clear code organization.
Assume a typed language with futures/promises support (e.g., Java with CompletableFuture). You may choose reasonable defaults and make minimal assumptions if needed.
Requirements
Endpoint
Expose one endpoint (e.g., GET /aggregate) that returns a combined JSON response from three upstream services: A, B, and C.
Concurrency
Call the three upstream HTTP APIs in parallel using futures/promises.
Timeouts
Per-call timeout for each upstream request.
Overall request timeout (deadline) for the whole aggregation request.
Policy
Configurable policy to determine behavior:
WAIT_ALL: wait for all upstreams, return partial data with defaults if some fail.
FAIL_FAST: fail the overall request as soon as any upstream fails or times out.
Retries
Implement retries with capped exponential backoff and jitter via a reusable RetryTemplate that accepts a Callable.
Partial Failure Handling
When some upstreams fail, return partial data along with default values and error details.