HARDasked at 1 company

Zuma Game

A hard-tier problem at 31% community acceptance, tagged with String, Dynamic Programming, Stack. Reported in interviews at Baidu and 0 others.

Founder's read

Zuma Game is a hard string-manipulation problem that Baidu has asked in their online assessments. You're given a board state and colored balls, and you need to find the minimum number of balls to insert to clear the board. The trick isn't brute force. Most candidates see the board string and think dynamic programming on substrings, but the real trap is that you're searching a state space of possible insertions. You need BFS or memoized DFS to explore which balls to insert where, tracking visited states to avoid infinite loops. If this problem hits your live OA and you blank on the search strategy, StealthCoder solves it in seconds, invisible to the proctor.

Companies asking
1
Difficulty
HARD
Acceptance
31%

Companies that ask "Zuma Game"

If this hits your live OA

Zuma 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 FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know.

Get StealthCoder
What this means

The core insight is that this isn't a string-parsing problem. It's a shortest-path problem in a game state graph. Each state is a board configuration. From each state, you can insert a ball at any position. After insertion, you collapse consecutive same-colored balls (recursively). BFS finds the minimum insertions needed to reach an empty board. The pitfall: naive recursion explodes exponentially. Memoization is essential. You must cache board states you've already explored with a given hand, otherwise you revisit the same configuration thousands of times. Stack and String topics are real here (you'll manipulate the board and use a stack to collapse balls), but BFS and Memoization are the spine. Most failures come from forgetting memoization or using DFS without tracking depth carefully. StealthCoder has the state graph and collapse logic wired correctly from day one.

Pattern tags

The honest play

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

Zuma Game recycles across companies for a reason. It's hard-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 FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Zuma Game interview FAQ

Is Zuma Game still asked at major tech companies?+

Baidu reports it in their assessment history. At 30% acceptance rate and marked HARD, it's not a common warm-up. It tends to appear in companies that emphasize game-theory or state-search problems. If Baidu is interviewing you, this belongs on your prep list.

What's the trick to Zuma that most solutions miss?+

Memoization of board states. Without it, recursive backtracking re-explores the same configuration dozens of times. Also, you must collapse balls recursively after each insertion, not just once. Many solutions collapse once and miss that a cascade can clear more balls.

How does BFS differ from DFS for this problem?+

BFS guarantees you find the minimum number of insertions first, since it explores all insertions of depth k before k+1. DFS with memoization works too, but you must track the minimum across all branches. BFS is cleaner for 'minimum' queries.

Do I need to understand the String topic deeply for this problem?+

String appears in the topic list because you're manipulating the board as a string (or list) and collapsing subsequences. But the heavy lifting is search and memoization. String skills matter for the collapse logic, not the main algorithm.

How much time should I spend drilling Zuma before an OA?+

If Baidu is your target, it's worth one solid session. If not, lower priority. Most OAs won't include state-search games this complex. But if you see it live and haven't drilled it, that's what StealthCoder is for.

Want the actual problem statement? View "Zuma 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.