Reported August 2024
Googlemath

Min Num Moves

Reported by candidates from Google's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Google OA. Under 2s to a working solution.
Founder's read

Google asked this in August 2024, and it's a pattern you need to recognize fast. Min Num Moves is deceptively simple on the surface but trips up candidates who don't catch the math or greedy angle underneath. The problem usually asks you to transform one state into another with minimum operations, and the trap is overthinking it with BFS or DP when a formula or greedy choice wins. StealthCoder sits in the background as your safety net if the insight doesn't click in the first five minutes.

Pattern and pitfall

The core trick is recognizing whether this is a pure math problem, a greedy walk-through, or a shortest-path search. Most candidates waste time coding BFS when the answer is a closed-form formula or a simple greedy simulation. If the problem involves moving elements, digits, or positions, check if there's an invariant or a parity argument first. Google likes these because they reward pattern recognition over brute force. The common pitfall is not spotting that the minimum isn't always obvious from simulation alone. StealthCoder can surface the pattern in seconds if you're stuck, letting you write the right approach with confidence.

If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.

If this hits your live OA

You can drill Min Num Moves cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as minimum moves to equal array elements. If you have time before the OA, drill that.

⏵ The honest play

You've seen the question. Make sure you actually pass Google's OA.

Google reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Min Num Moves FAQ

Is this a BFS problem or a math problem?+

Check the constraints. If n is small (under 100), BFS might work. If n is large or the problem feels abstract ("minimum moves to make X equal Y"), it's likely math or greedy. Google usually rewards the analytical approach over brute force here.

What's the most common wrong approach candidates try?+

Simulating every move naively or coding BFS without thinking about whether a formula exists. Most August reports point to overthinking. Spend 30 seconds asking: is there an invariant, a parity argument, or a direct calculation?

How much time should I spend trying to find the formula before coding?+

Two to three minutes max. If you see the pattern (e.g., XOR, difference, modulo), write it. If not, start with a small simulation on paper. Watching the pattern on 2-3 examples often reveals the insight.

Does Google test this problem the same way every time?+

The core logic stays consistent, but constraints and the target state change. August 2024 reports suggest the pattern is still heavily weighted. Master the insight, not the specific example.

If I blank on the approach, how do I recover in the OA?+

Code a working simulation for small inputs first. That buys you time to spot the pattern. Most candidates who fail rush straight to an optimized approach they're not confident in.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Google.

OA at Google?
Invisible during screen share
Get it