Find the Winner of the Circular Game
A medium-tier problem at 82% community acceptance, tagged with Array, Math, Recursion. Reported in interviews at Groupon and 5 others.
You're sitting in a live assessment and see a circular elimination game. n people stand in a circle, and every k-th person gets eliminated until one survives. The problem asks you to find the winner's position. It's straightforward to simulate with a queue, but the real trick is recognizing this is the Josephus problem, and a math-based solution exists that scales instantly. Companies like Groupon, SoFi, Arista Networks, Accenture, Zoho, and Goldman Sachs have all asked this. The 82% acceptance rate is misleading, that counts people who brute-forced it. If you hit this in a live OA and your simulation times out or you blank on the recursive formula, StealthCoder surfaces a working solution in seconds, invisible to the proctor.
Companies that ask "Find the Winner of the Circular Game"
Find the Winner of the Circular 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 by an engineer who got tired of watching his cohort grind for six months and still get filtered at the OA stage.
Get StealthCoderThe naive approach is simulation: model the circle as a queue, eject every k-th person, repeat until one remains. It works for small inputs but fails on large n. The real pattern is the Josephus problem, which has a closed-form recursive solution. The trick: instead of simulating forward, solve the subproblem of n-1 people, then map the survivor's position back to the n-person circle using modulo arithmetic. Most candidates either don't recognize the pattern and timeout, or they code the simulation correctly but panic when the input size jumps. That's where the math kicks in. Understanding Recursion and Array indexing in circular contexts matters here, and Simulation is the fallback hedge. If you haven't drilled the formula and the OA loads this problem, StealthCoder runs invisibly and hands you the pattern.
Pattern tags
You know the problem.
Make sure you actually pass it.
Find the Winner of the Circular 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 by an engineer who got tired of watching his cohort grind for six months and still get filtered at the OA stage. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Find the Winner of the Circular Game interview FAQ
Is this problem actually asked at big tech companies?+
Yes. Goldman Sachs, Arista Networks, SoFi, and others have all asked it. It's not ultra-frequent, but it appears enough in reports that skipping it is risky. The 82% acceptance rate suggests it's a solid candidate problem, not a gimme.
What's the trick that separates AC from TLE?+
Recognizing it's the Josephus problem. Simulation works for small n, but the recursive formula scales instantly. The formula: survivor(n, k) = (survivor(n-1, k) + k) % n, with base case survivor(1, k) = 0. That's the insight most candidates miss.
Do I need to know the Josephus problem going in?+
No, but it helps massively. Many candidates derive the recursive formula during the interview by working through examples. If you don't see it, a solid simulation passes small test cases and buys you time to think. The Math topic hint is there for a reason.
How does this relate to Queue and Recursion topics?+
Queue is the simulation path, pop and push until one survives. Recursion is the optimal path, solve for n-1, map back to n using modulo. Both are valid. The interview is checking if you can see the trade-off and code either cleanly under time pressure.
What if I run out of time in the live OA?+
Simulation is your safety net. Code it first, get points for correctness, then optimize if time allows. If you get stuck on either approach, StealthCoder runs invisibly during screen share and surfaces both the simulation and the recursive formula, so you're never blocked.
Want the actual problem statement? View "Find the Winner of the Circular Game" on LeetCode →