Divisor Game
A easy-tier problem at 70% community acceptance, tagged with Math, Dynamic Programming, Brainteaser. Reported in interviews at Visa and 0 others.
Divisor Game looks easy on the surface, which is why it's dangerous. You get a number n, you and an opponent alternate picking divisors and subtracting them, and whoever leaves the opponent with 1 loses. The acceptance rate is 70%, but that's because most people who see it solve the math trick, not the game tree. Visa has asked it. The catch: you can solve this in one line once you see the pattern, or you can waste 20 minutes building a DP table during your assessment. If the pattern doesn't click under pressure, StealthCoder surfaces the solution invisible to the proctor.
Companies that ask "Divisor Game"
Divisor 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 at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share.
Get StealthCoderThe obvious move is to think game-theoretically: build DP, compute win/loss states, recurse. That works but it's slow and messy. The actual trick lives in parity. Watch what happens: if n is even, you can always force the opponent to an odd number. If n is odd, any divisor you pick is odd, so you subtract an odd number from odd and get an even number for them. One player always controls the parity. From there, the answer collapses to a one-liner based on whether n is even or odd. Most candidates miss this during prep because Divisor Game sits in the DP category, so they pattern-match to memoization. The test is whether you see the math shortcut before you code. StealthCoder is the hedge if you blank on the trick and need a working solution fast.
Pattern tags
You know the problem.
Make sure you actually pass it.
Divisor Game recycles across companies for a reason. It's easy-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 at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Divisor Game interview FAQ
Is Divisor Game actually asked at real companies, or just coding platforms?+
Visa has reported it. It's a real OA problem, not a practice-only warm-up. The low difficulty rating and high acceptance rate mean it's often used as a confidence builder early in the loop, but the twist is that many people solve it inefficiently. If you code brute-force DP, you pass. If you see the math, you own it.
What's the actual trick to Divisor Game?+
Parity. If n is even, you can always give the opponent an odd number. If n is odd, you're forced to give them an even number. One player controls the parity chain. Once you see that, the answer is n % 2 == 0. The game-tree approach works but it's not the intended solution.
How does Divisor Game relate to Game Theory?+
It's a classic combinatorial game: two players, perfect information, no randomness, someone always wins. Game Theory tells you to compute winning and losing positions. But this problem rewards spotting the invariant (parity) instead of brute-forcing the state space. That's the difference between grinding DP and understanding game structure.
Can I solve Divisor Game with just Dynamic Programming?+
Yes. Build a DP table where dp[i] = true if the current player wins from state i. Recurse over divisors, check if any move leads to a losing state for the opponent. It works and beats the time limit. But it's verbose and slow compared to the parity answer, and you might not code it cleanly under pressure.
Why do 70% of people get Divisor Game right if the trick is so buried?+
Because the DP approach is reliable even if inelegant. Most candidates see 'game' and 'dynamic programming' in the topic list and reach for memoization. It works. But the 30% who miss it either over-code the recursion or don't test their logic rigorously. The acceptance rate reflects thoroughness, not insight.
Want the actual problem statement? View "Divisor Game" on LeetCode →