MEDIUMasked at 1 company

Alice and Bob Playing Flower Game

A medium-tier problem at 46% community acceptance, tagged with Math. Reported in interviews at Rubrik and 0 others.

Founder's read

Alice and Bob Playing Flower Game is a medium-difficulty math problem that shows up in live assessments, most recently at Rubrik. The acceptance rate sits at 45%, which means nearly half of candidates either miss the pattern or make arithmetic mistakes under pressure. This isn't a graph problem or a dynamic-programming slog. It's a math trick disguised as a game simulation. If you walk into your OA cold on this one and the pattern doesn't click in the first two minutes, StealthCoder surfaces the mathematical insight instantly, invisible to the proctor. That's the hedge.

Companies asking
1
Difficulty
MEDIUM
Acceptance
46%

Companies that ask "Alice and Bob Playing Flower Game"

If this hits your live OA

Alice and Bob Playing Flower 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 a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE.

Get StealthCoder
What this means

The trick is recognizing that Alice and Bob's game outcome depends entirely on the initial values, not on simulation or game states. Most candidates code a turn-by-turn loop, burn time debugging off-by-one errors, and miss the real solution: a direct mathematical relationship. The problem tests whether you can extract the invariant before you start looping. Common misstep: spending eight minutes simulating when the answer lives in a formula. The Math topic tag is literal here. You need to spot the pattern in how the values change, not brute-force the game. If you freeze on the live assessment, StealthCoder reads the problem, identifies the mathematical property, and hands you working code. No simulation required.

Pattern tags

The honest play

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

Alice and Bob Playing Flower 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 a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Alice and Bob Playing Flower Game interview FAQ

Is this problem actually about game theory or just math disguised as a game?+

Pure math. The game narrative is flavor. The outcome is determined by a property of the starting numbers, not by optimal play. Recognizing this shifts you from simulation to formula, which is why it catches people.

How much does the acceptance rate of 45% tell me about difficulty?+

It means one in two candidates miss it. That's not because the math is hard, it's because the pattern isn't obvious on a first read. Most people code a loop when they should be thinking number theory.

Will I see this at companies other than Rubrik?+

Rubrik is the only reported company in the data. That doesn't mean it won't appear elsewhere; it means you should assume it could show up at any medium-difficulty online assessment and treat it as a risk.

What's the most common way to solve this wrong?+

Simulating the full game turn-by-turn. It works on small inputs but wastes time and introduces bugs. The efficient solution is recognizing the mathematical property that determines the outcome upfront.

How does this problem relate to other Math-tagged problems I should know?+

Math problems on coding assessments usually reward pattern recognition over brute force. They test whether you can think mathematically before you code. This one is no exception; the skill transfers directly.

Want the actual problem statement? View "Alice and Bob Playing Flower 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.