Resolve Notification Settings Across Global, App, and Thread Overrides
Last updated: November 29, 2026
Quick Overview
Given layered notification preferences (global defaults, per-app overrides, per-thread overrides and timed mutes), write a resolver that returns the effective push, email and sound settings for a given app and conversation thread.
Meta
November 29, 20260
0
0 solved
Given layered notification preferences (global defaults, per-app overrides, per-thread overrides and timed mutes), write a resolver that returns the effective push, email and sound settings for a given app and conversation thread.
Messenger and Instagram Direct let people mute a single chat, turn off sounds for one app, or change account-wide defaults, and the effective setting has to be resolved consistently on every device. A phone screen uses this to see whether you can model inheritance cleanly with a small data structure rather than a pile of nested if statements.
What the Interviewer Expects
- Represents each layer as a partial map where a missing key means inherit
- Resolves from most specific to least specific and falls back to defaults
- Treats a timed mute as an override that expires based on a passed-in clock
- Keeps time as a parameter so the resolver is deterministic and testable
- Explains how adding a new setting key requires no new branching code
Key Topics to Cover
How to Approach This
- Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
- Choose data structures based on access patterns, not familiarity.
- Prefer immutable data and message passing over shared mutable state for concurrency.
- Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
- How would you show the user why a setting is off (which layer set it)?
- How would you add a per-contact layer that sits between app and thread?
- How would you sync these layers across devices and resolve conflicting edits?
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
- Settings keys:
push,email,sound, each a boolean with a product default. - Layers from least to most specific: global, app, thread. A layer only stores keys the user changed.
- A thread mute ...
High-Level Design
Model each layer as a small Layer dataclass with a values dict and an optional muted_until. The settings object keeps the global layer plus dictionaries of app layers and thread layers, created ...