Design an in-memory notification dedup engine
PremiumLow-level designMedium
- Sliding window
- Open addressing
- Ring buffer
Quick answer
This low-level design interview question asks you to design an in-memory notification dedup engine. Aim for a design that is modelled as clear classes, interfaces and relationships that can handle new requirements without a rewrite. Interviewers want to see how you name responsibilities, keep classes small and reason about change.
The problem
Design an in-memory notification dedup engine: a library inside one notification service instance that flags any notification UUID already seen in the last 10 minutes. It answers about 10,000 checks per second within a strict memory budget. The hard parts are the memory layout and expiring old IDs cheaply.
Producers retry, so the same notification can arrive two or three times within seconds or minutes. Before sending a push or email, the sender calls the engine and drops duplicates. This is a low-level design round: classes, data structures and code-level flows, not a distributed service.
What must an in-memory notification dedup engine do?
- Check and insert: One call takes a UUID and returns NEW (and remembers it) or DUPLICATE, as a single atomic step.
- Ten-minute window: An ID is a duplicate only if it was first seen less than 600 seconds ago; after that it counts as new again.
How well must it do it?
- Memory budget: At most 256 MB for all engine data, including room for bursts.
- Fast checks: check-and-insert runs in O(1) expected time (O(log N) is acceptable) and under 10 microseconds at p99, with expiry work spread out.
What scale should you design for?
Use these numbers in your estimates.
The scale numbers unlock with this questionUnlock
Key concepts
- Sliding window
- Open addressing
- Ring buffer
- Check and insert
- Memory layout
- UUID
How you’ll practise
- Requirements
- Core objects
- Class relationships
- Key flows
- Extensibility
- Wrap-up
Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.
What do interviewers look for?
In any low-level design round.
- Lists the use cases before writing classes
- Gives each class one clear responsibility
- Uses interfaces where behaviour is likely to change
- Applies a design pattern only when it solves a real problem
- Handles edge cases and invalid states explicitly
- Walks through one use case end to end with the model
Questions people ask about this interview question
- Which design type is this question?
- It is a low-level design question. You design an in-memory notification dedup engine and explain your choices the way you would in an interview.
- Is this question asked at entry level?
- It is marked Medium. Entry-level engineers can practise it, but it expects you to reason about requirements and trade-offs, not only list components.
- What should I cover first?
- Start with the use cases and the core entities, then the responsibilities of each one. Agree on scope with the interviewer before you design anything.
- Can I practise it for free?
- It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.
Related questions
Updated · Written by the SevyDevy team