FastPrepEarliest Hour with Frequent Badge Access
Problems/Earliest Hour with Frequent Badge Access

Earliest Hour with Frequent Badge Access

Intuit logoIntuit● MediumNEW GRADINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Intuit online assessment. The complete images need every entry in the first qualifying hour, with both ends counted, in employee-name order. Those original rules win over two short reports that disagree, one about returning only three entries and one about sorting by last entry. Here, rows keep the input time strings, names use ASCII order, and the input has limits.

Our version is about 97% the same as the reported kind of task.

Each record [employeeName, time] in badgeRecords gives one room entry during a single day. Records are unordered. The time is a three- or four-digit 24-hour HHMM string, such as 830 or 2250. Interpret it as hours and minutes, not an ordinary numeric distance.

Find employees with at least three entries in one inclusive 60-minute period. For each employee, consider periods beginning at one of their entry times. Return every entry from the first such period, in increasing time order. Include an entry exactly 60 minutes after the period starts. Do not stop after the first three entries if more occur in that same period.

Return a String[][] with rows [employeeName, time1, time2, ...], sorted by employee name. For this exercise, assume names sort in ascending ASCII order and each output time keeps its original input spelling, including leading zeros. If nobody qualifies, return an empty array, representing the original None result.

Times do not wrap into another day. There are no invalid times or repeated entries for the same employee at the same actual time.

Function

earliestBadgeWindows(badgeRecords: String[][]) → String[][]

Examples

Example 1

badgeRecords = [["Paul","1355"],["Jennifer","1910"],["Marcel","830"],["Paul","1315"],["Marcel","835"],["Paul","1405"],["Paul","1630"],["Marcel","855"],["Marcel","930"],["Marcel","915"],["Jennifer","1335"],["Jennifer","730"],["Marcel","1630"]]return = [["Marcel","830","835","855","915","930"],["Paul","1315","1355","1405"]]

Marcel has five entries from 8:30 through 9:30, including the inclusive endpoint. Paul has three entries from 13:15 through 14:05. Jennifer has no qualifying hour. Rows sort by name, and later entries at 16:30 are outside the chosen periods.

Example 2

badgeRecords = [["Zoe","950"],["Amy","0900"],["Zoe","1050"],["Amy","0959"],["Zoe","1000"],["Amy","1001"]]return = [["Zoe","950","1000","1050"]]

Zoe has three entries from 9:50 through 10:50, exactly 60 minutes apart at the ends. For Amy, the 9:00 through 10:01 span is 61 minutes, so she does not qualify.

Constraints

  • For this exercise, assume 0 <= badgeRecords.length <= 500.
  • Every record has exactly two fields. Every field has 1 to 30 characters.
  • Names contain only ASCII letters A through Z or a through z and are case-sensitive.
  • A time field has exactly 3 or 4 decimal digits. Its hour is from 0 through 23 and its minute from 0 through 59. There is no 24:00.
  • All times are from one day. No employee has two records representing the same hour and minute.

More Intuit Online Assessment questions

  • Employee Promotion OpportunitiesOA · Seen Oct 2026
  • Next Pascal Row CoefficientOA · Seen Oct 2026
  • Parse Router LogsOA · Seen Oct 2026
  • Longest Repeated Letter Block with Adjacent SwapsOA · Seen Oct 2026
  • Maximum Square-Free DivisorOA · Seen Oct 2026
  • Two Tribes from Taller-Person CountsOA · Seen Oct 2026
  • Shortest Path from an Encoded GraphOA · Seen Sep 2026
  • Oldest and Youngest EmployeesOA · Seen Sep 2026
  • Pressure-Isolation Shutdown OrderOA · Seen Sep 2026
  • Submask Sum QueriesOA · Seen Sep 2026

Similar questions at other companies

  • Count Servers With No Requests in a Time WindowIBM · OAIBM interview questions
  • Count Zero Request ServersSalesforce · ONSITE INTERVIEWSalesforce interview questions
  • Sliding-Window Frequency SnapshotsGoogle · ONSITE INTERVIEWGoogle interview questions
  • Detect Security Attacks from Network LogsFireworks AI · PHONE SCREEN
  • Smallest Range Covering Elements from K ListsSnap Inc. · PHONE SCREENSnap Inc. interview questions
  • Maximum Escape Game ScoreMicrosoft · OAMicrosoft interview questions
  • Minimum Distinct Prefix CostChubb · OAChubb interview questions
  • Top K Frequent ElementsAmazon · OA · PHONE SCREEN
  • Count Redundant File BackupsGoldman Sachs · OAGoldman Sachs interview questions
  • Count Subarrays with at Least K Equal-Fruit PairsTikTok · OATikTok interview questions

Intuit interview experiences

  • Intuit Software Engineering Intern - Full Stack OA Format
All Intuit interview questionsSee Intuit hiring insights
Saved
class Solution {
    public String[][] earliestBadgeWindows(String[][] badgeRecords) {
        // Write your code here
    }
}
Checking account…