FastPrepDaily Notification Limit with Cooldown
Problems/Daily Notification Limit with Cooldown

Daily Notification Limit with Cooldown

WhatNot logoWhatNot● MediumNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Whatnot new grad phone screen as the first follow-up to a daily notification limit. Once a message is turned away because the day is full, that message has to wait out a cooldown before it can go out again. In the interview only the idea was discussed, with no code to run.

The report does not say how long the cooldown is, when it ends, or whether a refusal during a cooldown starts a new one. Here, you get the cooldown length, the message waits through that many days after the full day, and refusals during a cooldown do not restart it. The interviewer's hint about a queue is covered in the editorial.

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

Given notifications in the order they are sent, a daily limit k and a cooldown length cooldown, 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, and the same message may be sent any number of times. When a notification is refused because its day already has k different messages, its message starts a cooldown. If that refusal happens on day d, the message is refused on every day up to and including day d + cooldown.

Go through the notifications in order and decide each one with these steps:

  1. If its message was already sent earlier that day, it is sent.
  2. Otherwise, if its message is in a cooldown, it is refused. This refusal does not start a new cooldown.
  3. Otherwise, if fewer than k different messages have been sent that day so far, it is sent.
  4. Otherwise, it is refused and its message starts a cooldown.

A refused notification is not sent, so it does not use up the limit. Each new day starts with no messages sent. Cooldowns belong to one message and do not affect other messages.

Function

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

Examples

Example 1

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

Day 1 is full after "sale" and "live", so "drop" is refused and cools down on days 2 and 3. On day 2, "drop" is refused even though the day has room, while "live" is sent. On day 4 the cooldown is over.

Example 2

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

"promo" is refused on day 1 by the limit, so it cools down on days 2 and 3. The refusals during the cooldown do not restart it, so "promo" is sent on day 4.

Example 3

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

With cooldown = 0, a refusal only lasts for the rest of its day. "drop" is refused on day 1 by the limit and sent on day 2.

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
  • 0 <= cooldown <= 106

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

  • Logger Rate Limiter with Every-Arrival HistoryGoogle · PHONE SCREENGoogle interview questions
  • Propagating Fraud DetectorAffirm · PHONE SCREEN · ONSITE INTERVIEWAffirm interview questions
  • Order and Batch Open-Close LifecycleHudson River Trading · PHONE SCREENHudson River Trading interview questions
  • Pins Violation Log QueriesPinterest · PHONE SCREENPinterest interview questions
  • Resource Reconciler: Plan and Apply CreatesPerplexity AI · PHONE SCREENPerplexity AI interview questions
  • Realized Gains from a Real-Estate Transaction StreamKikoff · PHONE SCREENKikoff interview questions
  • Process On-Call Routing OperationsOpenAI · PHONE SCREENOpenAI interview questions
  • Batched Key Fetch CallbacksAnrok · PHONE SCREEN
  • Stateful Paginated Fetch NLyft · PHONE SCREENLyft interview questions
  • Count Active Employee Access GrantsIBM · PHONE SCREENIBM 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[] shouldSendWithCooldown(String[] messages, int[] days, int k, int cooldown) {
        // write your code here
    }
}
Checking account…