Design Quiet Hours and Per-User Notification Rate Limits
Last updated: November 29, 2026
Quick Overview
Design a shared policy layer that every Google product calls before sending a notification, enforcing a user's quiet hours and a cap on how many notifications each user receives per day across products.
0
0
0 solved
Design a shared policy layer that every Google product calls before sending a notification, enforcing a user's quiet hours and a cap on how many notifications each user receives per day across products.
A compact design question suited to a Google phone screen: one small service with a clear contract, but it sits on the hot path for many products. The interviewer checks the API, the per-user counter design, and what to do with notifications blocked during quiet hours.
What the Interviewer Expects
- Define a simple decide(user, notification) API with allow, defer or drop outcomes
- Store quiet hours with the user's time zone
- Implement daily caps with counters that are cheap and approximately correct
- Let urgent categories (security alerts) bypass limits
- Keep added latency to a few milliseconds
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How do you schedule deferred notifications to go out when quiet hours end?
- Should caps be global or per product, and who decides?
- What happens if the policy service is down?
- How do you avoid a burst of deferred alerts at 7:00 am?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: users set quiet hours (for example 22:00 to 07:00 local) and products declare a category and priority for each notification. The service returns ALLOW, DEFER(until) or DROP. Caps...
High-Level Design
- Settings store: per-user quiet hours, time zone, per-product overrides, cached in memory at the policy servers with short TTL.
- Counter store: in-memory sharded counters keyed by `(user, lo...