FastPrepEarliest One-Hour Badge Alert Times
Problems/Earliest One-Hour Badge Alert Times

Earliest One-Hour Badge Alert Times

Robinhood logoRobinhood● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The reported earliest-hour employee-and-times task matches at about 95%; window anchoring, duplicate handling, ordering, serialization and bounds are stated practice assumptions.

The matching arrays keyName and keyTime describe unordered badge events: entry i records employee keyName[i] badging in at keyTime[i]. Each time is a valid 24-hour string in HH:MM format. All events occur during a single day.

Find every employee with at least three badge events in an inclusive one-hour period. If several such periods exist, select the earliest one for that employee. Return every badge time in that selected hour, rather than only the first three.

For this exercise, assume each candidate hour starts at one of the employee's badge events and spans the next 60 minutes, including both endpoints. An hour does not wrap across midnight.

For this exercise, assume every time has exactly five characters and uses two digits for the hour and minute.

Return one row [employee,time1,time2,...] per qualifying employee. For this exercise, assume employee rows are sorted lexicographically; times are sorted chronologically while retaining their original text, and equal times preserve input order. Each record counts separately, even when the employee and time are repeated. An empty input returns an empty result.

Function

badgeAlerts(keyName: String[], keyTime: String[]) → String[][]

Examples

Example 1

keyName = ["daniel","daniel","daniel","daniel","daniel","daniel","luis","luis","luis","luis"]keyTime = ["10:00","10:40","10:50","10:51","10:55","11:00","09:00","11:00","13:00","15:00"]return = [["daniel","10:00","10:40","10:50","10:51","10:55","11:00"]]

Each qualifying employee's earliest window is shown, with employee rows sorted. Every badge time within the selected hour is included.

Example 2

keyName = ["Amy","Amy","Amy","Amy","Bob","Bob","Bob"]keyTime = ["10:00","10:30","11:00","11:01","00:10","01:11","02:12"]return = [["Amy","10:00","10:30","11:00"]]

Amy's hour begins at 10:00 and includes the access exactly 60 minutes later. The next access is outside that hour; Bob has no qualifying hour.

Constraints

  • For this exercise, assume there are at most 2000 events.
  • Employee identifiers are nonempty case-sensitive alphanumeric strings of at most 30 characters.
  • Every time represents an hour from 0 through 23 and a minute from 0 through 59.
  • keyName.length == keyTime.length.

More Robinhood interview questions

  • Top Ten Most Frequent Words in a BookPHONE SCREEN · Seen Oct 2026
  • Fractional Share Inventory FlatteningPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Unique Transitive Dependent CountsPHONE SCREEN · Seen Sep 2026
  • Service Dependency Load FactorsPHONE SCREEN · Seen Sep 2026
  • Word Frequency in a Large TextPHONE SCREEN · Seen Jul 2026
  • Courses Shared by Every Student PairPHONE SCREEN · Seen Sep 2019
  • Middle Course in One Prerequisite ChainPHONE SCREEN · Seen Sep 2019
  • Friendship and Balance TrackerONSITE INTERVIEW · Seen Sep 2026
  • Transitive Employee Referral CountsONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Reconcile Unmatched Trades with Timestamp ToleranceCitadel · PHONE SCREENCitadel interview questions
  • Disjoint Target-Sum TripletsAmerican Express · PHONE SCREENAmerican Express interview questions
  • Earliest One-Hour Badge Alert TimesAtlassian · PHONE SCREENAtlassian interview questions
  • Earliest One-Hour Badge Alert TimesIndeed · PHONE SCREENIndeed interview questions
  • Top K Best-Selling Products in the Last N DaysAmazon · ONSITE INTERVIEW
  • All Distinct Palindromic SubstringsDoorDash · ONSITE INTERVIEWDoorDash interview questions
  • Efficient TeamsExpedia · OAExpedia interview questions
  • Count Cross-Array Target-Sum PairsVisa · OAVisa interview questions
  • Two SumMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Valid Triangle NumberBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
All Robinhood interview questionsSee Robinhood hiring insights
Saved
class Solution {
    public String[][] badgeAlerts(String[] keyName, String[] keyTime) {
        // Write your code here.
        return new String[0][0];
    }
}
Checking account…