← Questions

Design a webhook delivery system

0
OpenAIStripeSystem designLast asked Dec 2025

A system design interview question asked in Stripe's system design round and at OpenAI, last asked Dec 2025. It tests queues, retries and delivery guarantees.

Design a webhook delivery service. Customers register a callback URL for the events they care about (a payment succeeded, a job finished), and whenever a matching event fires, the service sends an HTTP request with the event's data to that URL. Delivery must be at least once, with retries and backoff, signed payloads, ordering where it matters, and a visible delivery history, while slow or failing endpoints never hold up healthy ones.

Requirements

  • Functional: create, update and delete subscriptions (event types and a callback URL); deliver an HTTP POST per matching event; retry failures; show per-event delivery status and attempt history; let customers replay events or requeue failed ones.
  • Non-functional: up to about 1 billion events a day (about 11.6K per second on average, peaks 3–5x higher); an accepted event is never silently dropped; delivery within seconds; at-least-once delivery with an idempotency id so receivers can deduplicate; multi-tenant and secure.

Clarifying questions

  • Which events need ordering, and per what key (per object, per customer)?
  • How long do we keep retrying before giving up? What happens after?
  • Can one event match many subscriptions (fan-out), or one URL per event type?
  • Do customers need to verify that requests really came from us?
  • What latency do customers expect, and is there a per-customer rate limit?

What a strong answer covers

  • Accept, then deliver: ingestion writes the event to a durable, partitioned, replayable log and returns; a separate dispatcher fleet does the outbound HTTP.
  • Sizing the log and dispatchers from the event rate and typical endpoint latency.
  • Retries with exponential backoff and jitter, a maximum attempt count or age, then a dead-letter store with an admin and customer requeue path.
  • Isolation from bad endpoints: per-endpoint queues or concurrency limits, circuit breakers that pause a failing endpoint, and timeouts, so one slow customer doesn't block others (no head-of-line blocking).
  • Ordering only where required, by partitioning on the ordering key and delivering one at a time per key, and the cost of that choice.
  • Security: HTTPS only, HMAC signatures with a timestamp against replay, per-tenant authorization, and SSRF protection for customer-supplied URLs (no internal addresses).
  • A delivery status store (attempts, last status code, final state) and dashboards and alerts on lag, failure rates and dead letters.

Follow-ups

  • A big customer's endpoint is down for six hours, then comes back. What happens to its backlog and to everyone else?
  • Guarantee per-object ordering while still retrying failed deliveries.
  • Rotate a customer's signing secret without breaking deliveries.
  • Reduce cost when most deliveries succeed on the first try.

Where it's asked

What it tests

queues · retries · delivery guarantees

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing