Preparing your design workspace

Loading the problem and your latest saved attempt…

Design Payment-Gateway Outage Alerting

Detect provider-specific payment failures with statistically safe windows and deliver deduplicated, recoverable outage alerts.

Problem statement

For this exercise, assume payment attempts emit immutable outcomes with merchant, gateway, region, method, amount band, event time, and a stable attempt ID.

The platform detects gateway-specific outages from failure rate, minimum traffic, latency, and consecutive-window rules, while separating merchant-local errors from broad provider incidents.

A versioned policy creates one incident identity, sends one opening alert, updates evidence without alert storms, and closes only after configured recovery windows. Late and duplicate events are tolerated within a bounded watermark.

Notification delivery is retried through an outbox and exposes sent, failed, and uncertain outcomes. Assume 100,000 payment outcomes per second, 30-second detection windows, p95 incident detection below 90 seconds, and 30 days of raw evidence.

Payment authorization, retry routing, refunds, fraud decisions, and notification-channel implementation are outside scope.

What to build

  1. The platform ingests payment outcomes idempotently and attributes them to gateway, merchant, region, and method dimensions.
  2. Versioned policies open a provider incident only after minimum-volume and consecutive-window conditions distinguish it from local failures.
  3. One incident emits deduplicated opening, update, and recovery notifications through a durable outbox.
  4. Operators can inspect the exact windows, policy version, late-data status, and evidence supporting every incident transition.

At scale

  • One hundred thousand payment outcomes per second and 30-second evaluation windows are authored practice assumptions.
  • Incidents should be detected within 90 seconds at p95 under admitted traffic.
  • Raw event evidence remains queryable for 30 days.