MEDIUMasked at 1 company

Stone Game

A medium-tier problem at 72% community acceptance, tagged with Array, Math, Dynamic Programming. Reported in interviews at Cisco and 0 others.

Founder's read

Stone Game hits your online assessment and you've got two players alternating turns, removing stones from piles. It feels like a DP problem until you realize the math beneath it. Cisco has asked this one. The acceptance rate sits at 72%, which sounds high until you're staring at the game tree and can't tell if you need optimal play simulation or if there's a closed-form trick. The difference between a brute-force recursion that times out and the one-liner that passes is knowing when game theory beats DP. StealthCoder surfaces that pattern instantly if you blank mid-OA.

Companies asking
1
Difficulty
MEDIUM
Acceptance
72%

Companies that ask "Stone Game"

If this hits your live OA

Stone 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. Made by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too.

Get StealthCoder
What this means

The trap is building a full DP table to compute minimax scores for all game states. That works, but the real insight is mathematical. In the classic stone game variant, the answer often doesn't depend on computing every turn. Instead, game theory tells you that the first player can always win if they play optimally, or the game outcome is determined by parity and pile structure alone. You'll see candidates write 50 lines of recursion with memoization when a 3-line proof wins. The second pitfall is misreading the problem rules: different variants (single pile, multiple piles, alternating vs simultaneous choices) flip the entire solution. Read the exact problem statement twice. If it's the canonical version with one pile and you remove 1 to 3 stones per turn, the answer is almost never "compute all states." StealthCoder handles the variant you actually face and the math behind why the obvious DP is overkill.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Stone 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. Made by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Stone Game interview FAQ

Is Stone Game really asking for optimal play simulation, or is there a trick?+

There's a mathematical shortcut in most variants. The first player can often force a win by the structure of the game alone, not by computing every possible move. If you find yourself writing minimax recursion, pause and check if parity or game-theoretic argument solves it in constant time.

Does this problem still come up in interviews?+

Yes, Cisco has asked it. It's less common than standard DP, but it shows up to test if you can spot when game theory beats brute force. It's a pattern-recognition problem more than a coding grind.

What's the difference between Stone Game and similar game DP problems?+

Stone Game often has a closed-form or parity-based answer, while other game DP problems (like Nim variants) require full minimax trees. Read the rules carefully. A single pile with bounded removal per turn usually hints at math. Multiple piles or unrestricted moves usually mean DP.

If I code the DP solution, will it pass?+

Probably, depending on problem size. A memoized recursion is correct but inelegant and slower than the mathematical insight. In a live OA, a working DP solution is better than a failed math proof. Submit working code first, optimize second.

How long does Stone Game take to solve under interview pressure?+

If you see the trick, 5 to 10 minutes to code and test. If you don't, you'll spend 20 to 30 minutes building DP and debugging state transitions. The trick matters. StealthCoder shows you the pattern instantly if you're stuck.

Want the actual problem statement? View "Stone Game" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.