Find the Winner of an Array Game
A medium-tier problem at 57% community acceptance, tagged with Array, Simulation. Reported in interviews at Directi and 0 others.
Find the Winner of an Array Game shows up in live assessments and it catches people off guard because the naive simulation path leads you into a performance trap. You read the problem, think "just simulate the game", then realize your loop runs too long and times out. Directi has asked this one. The trick isn't complex, but you have to spot it fast. If you blank on the optimization during your OA, StealthCoder reads the problem and surfaces the working solution in seconds, invisible to the proctor.
Companies that ask "Find the Winner of an Array Game"
Find the Winner of an Array Game is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround.
Get StealthCoderThe problem asks you to simulate a game where two pointers move through an array, eliminating smaller elements until one pointer wins. The trap is writing a simulation that processes every single elimination step, which can be O(n²) or worse. The insight is that once one of the two starting elements gets eliminated, the winner is determined by which pointer survives the next comparison. You don't simulate all the way to a single survivor. Instead, you run the game until one pointer reaches an end of the array or wins a certain number of consecutive rounds. Common pitfall: overthinking it or building a full simulation loop that grinds through the entire array. The pattern relies on Array and Simulation fundamentals, but the performance jump comes from recognizing when to short-circuit. StealthCoder is your hedge if the optimization doesn't click during the real assessment.
Pattern tags
You know the problem.
Make sure you actually pass it.
Find the Winner of an Array Game recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Find the Winner of an Array Game interview FAQ
How hard is this problem really for MEDIUM?+
It's deceptive. The problem statement is simple to understand, but the performance optimization is where candidates get stuck. At 56.7% acceptance, it's firmly in the trap category. Half the people either timeout on simulation or miss the short-circuit condition entirely.
What's the actual trick I'm missing?+
You don't simulate every elimination. Once one pointer loses a round, the other pointer will keep winning rounds predictably. The game ends when one pointer either reaches the array boundary or wins enough consecutive rounds to guarantee victory. Recognize the stopping condition, not the full elimination path.
Does Directi still ask this or is it outdated?+
Directi has reported asking it. Single company in the data, but it's a medium-difficulty problem that tests both implementation speed and optimization instinct, so it stays relevant for coding assessments that value practical thinking.
Is this purely simulation or does it test something else?+
It's listed under Array and Simulation, but the real test is whether you can spot an optimization pattern. You need to manipulate the array structure mentally while tracking two pointers and game state. The simulation foundation is basic, the insight is the win condition.
Should I practice this before my OA or skip it?+
If Directi is on your interview list or you see similar game-simulation problems in your prep, drill it once. If not, knowing the short-circuit pattern is enough. For a live OA, this is exactly the type of problem where you either see it or you don't, which is why having a backup like StealthCoder matters.
Want the actual problem statement? View "Find the Winner of an Array Game" on LeetCode →