Reported September 2024
ZipRecruitersimulation

Eliminate Drivers by Slowest Personal Best

Reported by candidates from ZipRecruiter's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live ZipRecruiter OA. Under 2s to a working solution.
Founder's read

The ZipRecruiter OA reported in September 2024 looks like a racing story, but it's a simulation with a running minimum and a max-tie elimination loop. You track each driver's best lap time, and after every lap you kick out whoever has the worst personal best, ties included. Names go out alphabetically when tied. Whoever survives all the laps gets appended at the end, also alphabetical. It's short to code and easy to fumble on the tie rules. If you blank on the order of operations, StealthCoder runs invisibly during the live OA as a safety net.

The problem

Each lap contains one name:time report for every active driver. Maintain each driver's minimum time seen.
After each lap, eliminate all active drivers tied for the highest personal-best time, appending tied names alphabetically. Return elimination order, ending with any last remaining drivers alphabetically.

Function
eliminateDrivers(laps: String[][]) → String[]

Examples
Example 1
laps = [["a:10","b:12","c:11"],["a:9","c:10"]]
return = ["b","c","a"]
b is slowest after lap one, c after lap two, leaving a.
Example 2
laps = [["b:10","a:10"]]
return = ["a","b"]
The tied final drivers are alphabetical.

Constraints
1 <= laps.length <= 1000
Times are positive integers.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick is that it's pure simulation. Keep a map of name to min time and a set of active drivers. For each lap, parse every name:time string, update the min for that driver, then scan the active set for the max personal best. Collect every active driver equal to that max, sort them alphabetically, append them to the result, and remove them from the active set. After the last lap, sort the remaining active drivers and append them. The common pitfalls: updating mins only for drivers who appear in the lap, which is fine, but forgetting that eliminated drivers must never be reconsidered. Also compare times as integers, not strings, since "9" beats "10" numerically. Splitting on the colon is simple, but parse carefully. With at most 1000 laps, a plain scan per lap is fast enough. StealthCoder is your hedge if the tie handling trips you up mid-assessment.

Memorize the pattern. If you can't, run StealthCoder. The proctor sees the IDE. They don't see what's behind it.

If this hits your live OA

You can drill Eliminate Drivers by Slowest Personal Best 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. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass ZipRecruiter's OA.

ZipRecruiter reuses patterns across OAs. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Eliminate Drivers by Slowest Personal Best FAQ

What's the core trick in the ZipRecruiter eliminate drivers problem?+

It's a simulation. Keep a dictionary of each driver's minimum time and a set of active drivers. After each lap, find the max personal best among active drivers, remove everyone tied at it, and append those names sorted alphabetically.

How do ties work in the elimination step?+

All active drivers sharing the highest personal-best time are eliminated together in the same lap. You sort that group alphabetically before appending to the result. Example 2 shows the same rule applies to the final survivors, who also come out alphabetical.

Do I need a heap or fancy data structure?+

No. With up to 1000 laps, scanning the active drivers each lap is fine. A heap adds complexity because personal bests change and ties need grouping. A map plus a set and a sort on the tied names does the job cleanly.

What mistakes break the output on this one?+

Comparing times as strings instead of integers, reconsidering eliminated drivers, and forgetting to append the remaining drivers alphabetically at the end. Also make sure you update minimums before you pick the elimination group for that lap.

How do I prepare for this in 48 hours?+

Practice parsing name:time strings and write two or three small simulation loops with a running min and tie grouping. Walk through Example 1 by hand until the order b, c, a feels obvious. Then code it once from scratch and test the tie case.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with ZipRecruiter.

OA at ZipRecruiter?
Invisible during screen share
Get it