FastPrepBadge Records Without a Match
Problems/Badge Records Without a Match

Badge Records Without a Match

WhatNot logoWhatNot● EasyNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Whatnot new grad Karat screen as the coding question, after a short resume talk. The report only names it as the well-known door badge-swipe question from a shared question list and gives no details.

Here, we use the common version of that question: a time-ordered log of people badging in and out of a secure room, where you find who entered without exiting and who exited without entering. The room starts empty, everyone must leave by the end, and each list is sorted with no repeats. The common next part, finding people who badge in three or more times within one hour, is covered in the editorial but not tested.

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

Given a log records of badge swipes at the door of a secure room, return two lists: the people who entered without exiting, and the people who exited without entering.

Each record is [name, action], where action is "enter" or "exit". The records are in time order. The room is empty when the log starts, and everyone must leave before it ends. Track each person as inside or outside:

  • An "enter" while the person is already inside means they left earlier without badging out, so they entered without exiting. They stay inside.
  • An "exit" while the person is outside means they came in without badging in, so they exited without entering. They stay outside.
  • Anyone still inside when the log ends also entered without exiting.

Return [enteredWithoutExiting, exitedWithoutEntering]. Each list holds every matching name once, sorted in alphabetical order. A list can be empty, and the same person can be in both lists.

Function

findMismatchedRecords(records: String[][]) → List<List<String>>

Examples

Example 1

records = [["Anna","enter"],["Ben","enter"],["Anna","exit"],["Ben","enter"],["Cara","exit"],["Ben","exit"]]return = [["Ben"],["Cara"]]

Ben badges in twice without badging out in between, so he entered without exiting. Cara badges out while she is not in the room, so she exited without entering. Anna is fine.

Example 2

records = [["Dana","exit"],["Dana","enter"]]return = [["Dana"],["Dana"]]

Dana badges out of an empty room, then badges in and never leaves before the log ends. She belongs in both lists.

Example 3

records = [["Eli","enter"],["Eli","exit"],["Eli","enter"],["Eli","exit"]]return = [[],[]]

Every entry is followed by an exit, and the room is empty at the end, so both lists are empty.

Example 4

records = [["Finn","exit"],["Gus","enter"],["Finn","exit"],["Gus","enter"],["Gus","enter"]]return = [["Gus"],["Finn"]]

Finn exits twice without being in the room, and Gus enters three times without leaving. Each name appears once in its list.

Constraints

  • 1 <= records.length <= 105
  • records[i].length == 2
  • records[i][0] is an uppercase English letter followed by 0 to 9 lowercase English letters.
  • records[i][1] is "enter" or "exit".

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 List<List<String>> findMismatchedRecords(String[][] records) {
        // write your code here
    }
}
Checking account…