Build an API aggregator with concurrency and retries

Read the full interview experience this question came from →

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.

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.

Read the full DoorDash Software Engineer interview experience this question came from

|Home/System Design/DoorDash
DoorDash logo
DoorDash
Jul 15, 2025
hardSoftware EngineerOnsiteSystem Design
21
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

  1. Endpoint
    • Expose one endpoint (e.g., GET /aggregate) that returns a combined JSON response from three upstream services: A, B, and C.
  2. Concurrency
    • Call the three upstream HTTP APIs in parallel using futures/promises.
  3. Timeouts
    • Per-call timeout for each upstream request.
    • Overall request timeout (deadline) for the whole aggregation request.
  4. 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.
  5. Retries
    • Implement retries with capped exponential backoff and jitter via a reusable RetryTemplate that accepts a Callable.
  6. Partial Failure Handling
    • When some upstreams fail, return partial data along with default values and error details.
  7. Observability
    • Structured logging with correlation IDs.
    • Metrics (latency, success/fail counts, timeouts, retries).
  8. Deliverables
    • Interface definitions for clients, retry template, and service layer.
    • Concurrency flow description.
    • Sample error-handling logic and example responses.

Clarifying Questions to Ask Guidance

  • Clarify users, core use cases, read/write patterns, scale, latency, availability, and data retention.
  • State explicit assumptions before making sizing or architecture decisions.
  • Prioritize the functional path first, then address reliability, security, observability, and rollout.

What a Strong Answer Covers Guidance

  • A scoped requirements summary with concrete non-goals and success metrics.
  • API, data model, architecture, consistency, capacity, and operations.
  • Reasoned trade-offs among simple and scalable designs, including bottlenecks and failure modes.
  • A validation, monitoring, migration, and launch plan appropriate for the risk level.

Follow-up Questions Guidance

  • What breaks first at 10x traffic or data volume?
  • How would you degrade gracefully during dependency failures?
  • What metrics and alerts would prove the design is healthy after launch?

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...