FastPrepDaily Limit on Different Notifications
Problems/Daily Limit on Different Notifications

Daily Limit on Different Notifications

WhatNot logoWhatNot● EasyNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Whatnot new grad phone screen as the second coding question. You get a list of notifications, each with a message and a day, sorted by day. A day may carry only a few different messages, but a message can repeat freely. You decide which notifications go out.

The report does not say what a refused notification does to the count, or how the input is laid out. Here, a refused notification does not count, and you get the messages and days as two arrays. The cooldown follow-up from the same interview is a separate problem, and the queue idea is in the editorial.

Our version is about 85% the same as the reported question.

Given notifications in the order they are sent and a limit k, return a boolean array answer where answer[i] is true if notification i is sent and false if it is refused. Notification i carries the message messages[i] and is sent on day days[i].

On any day, at most k different messages may be sent. The same message may be sent any number of times. Go through the notifications in order. A notification is sent if its message was already sent earlier that day, or if fewer than k different messages have been sent that day so far. Otherwise it is refused.

A refused notification is not sent, so it does not use up the limit. Each new day starts with no messages sent.

Function

shouldSend(messages: String[], days: int[], k: int) → boolean[]

Examples

Example 1

messages = ["sale","live","sale","drop","live"]days = [1,1,1,1,2]k = 2return = [true,true,true,false,true]

On day 1, "sale" and "live" use up the limit of 2. The second "sale" is a repeat, so it is sent. "drop" would be a third different message, so it is refused. Day 2 starts fresh, so "live" is sent.

Example 2

messages = ["promo","promo","news","news","promo"]days = [3,3,3,4,4]k = 1return = [true,true,false,true,false]

With k = 1, day 3 only allows "promo", so "news" is refused. On day 4, "news" comes first and takes the only slot, so "promo" is refused.

Example 3

messages = ["alert","digest","alert","digest"]days = [5,5,5,5]k = 1return = [true,false,true,false]

All four notifications are on day 5. "alert" takes the only slot, so every "digest" is refused and every "alert" is sent.

Constraints

  • 1 <= messages.length <= 105
  • days.length == messages.length
  • 1 <= messages[i].length <= 20
  • messages[i] consists of lowercase English letters.
  • 1 <= days[i] <= 109
  • days is sorted in non-decreasing order.
  • 1 <= k <= 105

More WhatNot Phone Screen questions

  • Adjacent Pair and Run RemovalPHONE SCREEN · Seen Nov 2026
  • Merge Sorted Squares of Two ArraysPHONE SCREEN · Seen Nov 2026
  • User Journey PathsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Knight Dialer SequencesPHONE SCREEN · Seen Oct 2026
  • Reachable Exits in an Obstacle GridPHONE SCREEN · Seen Oct 2026
  • Palindrome with One DeletionPHONE SCREEN · Seen Oct 2026
  • Search a 2D MatrixPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Attraction Route Without Reusing TrailsPHONE SCREEN · Seen Sep 2026
  • Earliest Car for Each PassengerPHONE SCREEN · Seen Sep 2026
  • Minimum Stores for a Shopping ListPHONE SCREEN · Seen Sep 2026

Similar questions at other companies

  • Count Distinct Underwriting PII ValuesAffirm · PHONE SCREEN · ONSITE INTERVIEWAffirm interview questions
  • Bounded IPv4 FilterAmazon · PHONE SCREEN
  • SimpleRDD Multiset IntersectionDatologyAI · PHONE SCREEN
  • Vehicle Maintenance Event ReadinessWaymo · PHONE SCREENWaymo interview questions
  • Summarize the Latest Event for Each DeviceOneTrust · PHONE SCREEN
  • Project JSON Fields into a Target FormatBooking.com · PHONE SCREEN
  • Employee Training StatusVanta · PHONE SCREEN
  • Select Object by Key ExtremeBridge · PHONE SCREENBridge interview questions
  • Group Names by DepartmentMastercard · PHONE SCREENMastercard interview questions
  • AI Role: Collection with Add and Remove OperationsApple · PHONE SCREENApple interview questions

Interview reports that mention this question

  • Whatnot SWE New Grad Second Technical Interview: 8 Experiences

WhatNot interview experiences

  • Whatnot interviews · October 2026
  • Whatnot Experienced SWE Phone Screen Questions: 2 Experiences
  • Whatnot SWE Interview Questions: 6 Experiences
All WhatNot interview questionsSee WhatNot hiring insights
Saved
class Solution {
    public boolean[] shouldSend(String[] messages, int[] days, int k) {
        // write your code here
    }
}
Checking account…