Water Bottles
A easy-tier problem at 71% community acceptance, tagged with Math, Simulation. Reported in interviews at Amadeus and 1 others.
Water Bottles is an easy problem that shows up in real OAs at companies like Amadeus and HiLabs. The acceptance rate is over 70 percent, which means most people who attempt it pass, but that's also why interviewers use it as a filter for clean thinking. The trap isn't the math or the simulation itself. It's the off-by-one errors and tracking state across multiple drink cycles. If you blank on the order of operations during the live assessment, StealthCoder surfaces the exact simulation logic in seconds, invisible to the proctor.
Companies that ask "Water Bottles"
Water Bottles 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. Built by an engineer at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share.
Get StealthCoderThe problem requires you to simulate drinking and exchanging empty bottles for full ones. Most candidates start with a naive loop and hit a wall when they forget that you can't exchange a bottle until you finish drinking it, or they lose track of how many full bottles remain after each exchange. The Math and Simulation topics aren't fancy here, but they force you to be precise about state: how many empty bottles do you have, how many full bottles do you have, and when exactly does the exchange happen. The common mistake is treating the exchange as instant without properly tracking the inventory between each drink. During a live OA, this kind of off-by-one cascades into wrong output. StealthCoder is the hedge for when you realize mid-assessment that your simulation loop is leaking state. It shows you the exact sequence of operations that works.
Pattern tags
You know the problem.
Make sure you actually pass it.
Water Bottles recycles across companies for a reason. It's easy-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. Built by an engineer at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Water Bottles interview FAQ
Is Water Bottles actually an easy problem, or is the acceptance rate misleading?+
The 70 percent acceptance rate reflects that it is genuinely an easy problem by LeetCode standards. The math and simulation logic are straightforward once you understand the state transitions. The difficulty comes from implementation details and avoiding off-by-one errors, not from algorithmic insight. Most people who spend 10 minutes thinking it through before coding get it right.
What's the main trick that people miss when they code this live?+
People often forget to track the remainder bottles when exchanging. For example, if you finish drinking 5 bottles and your exchange rate is 4 bottles for 1 full bottle, you get 1 new bottle but have 1 empty left over. Not accounting for that leftover causes your simulation to stop too early or count wrong.
How does this problem actually test Math and Simulation?+
Math comes in when you figure out how many full bottles result from exchanges, and Simulation is the loop where you drink, empty, exchange, and repeat. You're doing arithmetic on bottle counts within a state machine. Both topics are light here, but working cleanly at the intersection is what separates a clean solution from buggy code.
Does Amadeus or HiLabs typically ask follow-up questions after this problem?+
The input data doesn't specify what happens after Water Bottles. Assume that if you solve it cleanly in the first attempt, they may move on or ask you to optimize for space or explain your logic. If you stumble, they'll likely watch your debugging process.
Should I spend a lot of time drilling this problem?+
No. At 70 percent acceptance, this isn't a gatekeeping problem. You're better off drilling harder problems. Water Bottles is a warm-up. If you hit it in a live OA and blank on the state tracking, that's exactly when StealthCoder is your safety net, not when you should be grinding it for two hours beforehand.
Want the actual problem statement? View "Water Bottles" on LeetCode →