Dsa
Binary Search
Medium
Time to Notify Users
Imagine you are developing a notification system for a mobile app. You have a sorted list of user notification times represented in minutes past midnight, and you want to find how many users can be notified at a specified time so that the notifications are delivered in a manner that does not exceed the specified max wait time (in minutes). Input will contain the number of notifications, a sorted list of notification times, and the current time. Example:
Input:
5
5 15 20 30 45
25
Output:
3
Key concepts
binary_searchtimenotification
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now