Fall SalePremium questions, over 25% offUnlock all premium questions for over 25% off
Ball Picking Contest
Hard
Question
Balls stand in a line, and two players, Player One and Player Two, take them in alternating turns, Player One going first. Each player's score is 0 when play begins. Whoever is to move removes the first ball, or the first two balls, of what is left of the line. Every ball carries an integer value, possibly negative, which is added to the score of the player who takes it. A taken ball leaves the game for good. Each side is out to finish with the biggest profit it can get for itself. Play continues until the line runs out. ...
Asked at:Google
More Google interview questions
- Find Minimum Increment Moveseasy
- Largest Tree Root IDmedium
- Find Median In Large Unsorted Arraymedium
- Highway Checkpoint Tollsmedium
- Grep Command With Context Linesmedium
- Design Unix Find Command With Filtershard
- Paint a Row of Houseshard
- Maximum Flying Distancehard
OfferRetriever
Master technical interviews with real questions from top companies. Build your confidence and career.
LEGAL
© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.