The interview question

Deliver email and push notifications reliably without overwhelming users or providers.

Track durable intent, provider attempts, user preferences, and ambiguous delivery outcomes.

01. Separate intent from delivery attempts

An application requests a notification with an event ID, recipient, template version, channel, and expiry. Persist this intent before dispatch. A separate attempt record tracks each provider call and response. The API can confirm durable acceptance without claiming the user has received the message.

User preference and channel eligibility checks belong in the workflow. Time-sensitive preferences should be rechecked before sending because a user may unsubscribe while a message waits in a queue. Give essential and optional messages explicitly different policies.

02. Avoid the dual-write gap

Durable intent
Channel queue
Provider attempt

If a business transaction commits but queue publication fails, the notification can be lost. If publication happens first and the business transaction fails, the message can describe an event that never happened. A transactional outbox records the event with the business update, then a relay publishes it.

The relay can publish twice after a crash, so downstream consumers still deduplicate by event and intended delivery identity. Version templates so a retry does not unexpectedly use different content from the original intent.

03. Treat timeouts as ambiguous

A provider may accept a message while its response is lost. Retrying through another provider can deliver two copies. Use provider-supported idempotency where available, retain request identifiers, and reconcile delivery callbacks or status queries. State honestly when end-to-end exactly-once delivery is unavailable.

Callbacks can arrive out of order or repeat. Apply transitions using provider semantics rather than setting state to whichever callback arrived last. A delivered event should not be overwritten by an older queued event.

04. Bound retries and campaign bursts

For ten million messages over one hour, average dispatch is about 2,778 per second before retries and provider-specific limits. Separate queues by channel and priority, apply quotas, and expire messages whose value has passed. A login code sent hours late is not a useful successful delivery.

Monitor acceptance, queue age, provider success, bounces, delivery confirmation, and suppression. Follow-up: failover improves availability only if the alternate provider is configured and warmed appropriately and duplicate risk is addressed. The recovery plan should respect both recipient experience and delivery urgency.

Practice the follow-up

Self-review

Explain the difference between accepted by your API, accepted by the provider, delivered, and read.

Connect this to choosing useful notifications.

Sources & further reading

AWS: transactional outbox pattern. The interview scenario, calculations, and proposed design choices are illustrative.

Continue your preparation

Choose a connected learning path or browse more System design questions. Read our editorial method and attribution policy.