#500 Notification Filtering System

Companies:
Yandex
Themes:
System DesignService CommunicationPractice

The company provides a bulk notification service for other businesses. A product owner asks for a notification filtering system that takes user preferences into account.

Definitions

A notification contains:

  • notification id;
  • notification type: EMAIL, SMS, or PUSH;
  • recipient id;
  • message text.

A recipient may have preference settings:

  • allowed notification channels;
  • blocked senders.

The sent-notification history contains the list of notifications already sent to the user.

Important

User settings and notification history are supplied by other system components. For this exercise, define contracts for obtaining this data. Storage implementation is not required.

Exercise

Implement a notification filtering system that:

  • accepts a list of notifications to filter and a sender id;
  • excludes notifications that do not match the recipient's preferences;
  • excludes notifications from blocked senders;
  • prevents duplicate notification delivery;
  • returns the filtered list of notifications ready to be sent.

If a notification with the same id has already been sent to a specific user during the last 24 hours, it must not be sent again.

Notification delivery is outside the scope of the exercise. Another team will send the filtered list.

Question review

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in