The interview question

Choose which optional notifications to send, to whom, and when.

Optimize useful interruptions, enforce frequency caps, and measure outcomes beyond clicks.

01. Define the action space

Separate essential account or service messages from optional recommendations. The model decides whether to send an eligible optional message now, later, or never. User preferences, quiet hours, and channel permissions constrain that decision before ranking.

A baseline can prioritize recent relevant events with simple frequency caps. Define success over a meaningful window: useful engagement, retained interest, and low opt-out or complaint rates. Maximizing opens alone can encourage attention-grabbing messages that users eventually resent.

02. Represent the missing counterfactual

Candidates
Score & policy
Delivery queue

Logs show outcomes for notifications that were sent. They do not reveal what would have happened without sending, and a later purchase may have occurred anyway. A response-probability model is not automatically an incremental-value model.

Log candidate eligibility, policy decisions, delivery status, timestamps, and subsequent outcomes. Use randomized holdouts or carefully designed experiments to estimate incremental impact. Preserve the distinction between provider acceptance, device delivery, and user interaction.

03. Separate scoring from policy enforcement

An event stream produces candidates. A ranking service scores relevance and timing. A durable policy layer checks preferences, deduplicates equivalent events, and atomically consumes an allowed notification budget before enqueueing delivery. Recheck time-sensitive permissions at send time.

Suppose a user has a cap of two optional messages a day. Three workers each reading a counter of one can otherwise all send. Serialize the admission decision per user or use a conditional update. The same idempotency key must survive delivery retries.

04. Measure long-term effects and overload

Evaluate incremental engagement alongside opt-outs, complaints, retention, and the distribution of messages per user. Allow sufficient follow-up for delayed effects. If a campaign creates ten million candidates in five minutes, the illustrative candidate rate is about 33,333 per second; the system may choose to expire low-value candidates instead of sending them late.

Follow-up: a new model improves clicks but raises opt-outs. Inspect whether it repeatedly targets a highly responsive minority. User-level constraints and randomized evaluation of the full policy are more informative than an offline click metric alone.

Practice the follow-up

Self-review

Explain why a user who clicked a notification is not sufficient evidence that sending it caused additional value.

Connect this to A/B testing.

Sources & further reading

Google: recommendation systems overview. The interview scenario, calculations, and proposed design choices are illustrative.

Continue your preparation

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