Candidate Alias Name Matching
Reported by candidates from Checkr's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Checkr reported this OA in April 2025, and it looks like a string problem but it's really a pair of careful comparison rules wrapped in a loop. You get a list of known aliases and one record name. You return true if any alias is compatible. No graph, no DP, just parsing and edge cases. The risk is blanking on the middle-name logic or the transposition rule under a clock. StealthCoder sits invisibly on your screen as a safety net if that happens. Read the rules once, write one helper that compares two parsed names, and the rest is a for loop.
The problem
Given a list of known candidate aliases and a name returned on a record, return whether the record name matches at least one alias. Names contain a first name, an optional middle name or initial, and a last name. Last names must match exactly. A missing middle name is compatible with any middle name. A one-letter middle initial matches a middle name with the same initial. The first and middle names may be transposed; the last name may not move. Object-model variation Another reported interview asks for a Name class whose constructor takes a name string and parses its first, optional middle, and last parts, with __eq__(other) implementing name matching. For this practice variation, use the matching rules above for two parsed names. The graded interface remains nameMatch(knownAliases, recordName); the class variation is a follow-up. Function nameMatch(knownAliases: String[], recordName: String) → boolean Examples Example 1 knownAliases = ["Alphonse Gabriel Capone","Al Capone"] recordName = "Alphonse Gabriel Capone" return = true The record exactly matches the first alias. Example 2 knownAliases = ["Alphonse Gabriel Capone"] recordName = "Gabriel A Capone" return = true The first and middle names are transposed and the initial matches Alphonse. Constraints 1 <= knownAliases.length <= 1000. Every name has two or three non-empty space-separated parts. Matching is case-sensitive. For this exercise, assume every part contains ASCII letters and parts are separated by exactly one ASCII space, with no leading or trailing spaces.
Reported by candidates. Source: FastPrep
Pattern and pitfall
It reduces to one function: match(a, b) for two parsed names, then check any alias. Split on a single space. Two parts means first and last. Three parts means first, middle, last. Last names must be equal, case-sensitive, no exceptions. Then handle the first and middle pair. If either name has no middle, the first names must match exactly, since a missing middle is compatible with anything. If both have middles, try the straight order and the swapped order. A part pair matches if the strings are equal, or if one is a single letter equal to the other's first letter. The pitfall is applying transposition only to full names, or forgetting that a missing middle can't be swapped. Another trap is treating an initial as matching a first name in the wrong slot. Keep one helper, partMatch, and reuse it. If you freeze on the swap logic during the live OA, StealthCoder can hand you the working structure. Complexity is O(n) over aliases.
If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.
You can drill Candidate Alias Name Matching cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken.
Get StealthCoderYou've seen the question.
Make sure you actually pass Checkr's OA.
Checkr reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Candidate Alias Name Matching FAQ
How hard is the Checkr alias name matching question really?+
Easy on algorithms, medium on care. There's no clever data structure. The difficulty is covering every rule: exact last name, optional middle, initials, and first/middle swap. Most failures come from missed edge cases, not from complexity.
What's the trick to the middle name rule?+
Write a partMatch(x, y) helper. It returns true if the strings are equal, or if one has length 1 and matches the first character of the other. Use it for middle comparisons and for the swapped cases so the logic stays in one place.
How do I handle transposed first and middle names?+
When both names have three parts, check two cases. Case one compares first to first and middle to middle. Case two compares first to middle and middle to first. Last names must match in both. Either case passing means the alias matches.
What if the record or alias has no middle name?+
Then the middle is compatible with anything, but the first names still need to match. With a missing middle you can't swap, so compare first names directly. Check example 2 against your code to confirm the initial logic works.
How should I prepare for this in 48 hours?+
Write the helper and a loop, then test by hand: exact match, initial match, swapped match, different last name, missing middle on each side. Also think about the Name class follow-up with __eq__, which reuses the same comparison logic.