EASYasked at 1 company

Lemonade Change

A easy-tier problem at 58% community acceptance, tagged with Array, Greedy. Reported in interviews at Zalando and 0 others.

Founder's read

Lemonade Change is one of those problems that seems trivial until you're live in an OA and realize you're overthinking it. You're running a lemonade stand, customers pay with $5, $10, or $20 bills, and you need to give correct change. It hits the Greedy and Array topics, and despite a 58% acceptance rate, most failures come from missing the greedy strategy, not the implementation. Zalando asks it. The trick isn't complex, but if you blank on how to prioritize which bills to hand back, StealthCoder solves it in seconds invisible to the proctor.

Companies asking
1
Difficulty
EASY
Acceptance
58%

Companies that ask "Lemonade Change"

If this hits your live OA

Lemonade Change 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 an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too.

Get StealthCoder
What this means

The naive approach is to simulate the transaction and hand back coins, but this problem wants bills as change. The real pattern: when someone pays $20 after buying a $5 lemonade, you have $15 change to give. Greedy choice matters: prefer giving one $10 and one $5 over three $5 bills, because $10 bills are rarer and you'll need $5s for future $10 payments. Track your bill counts in an array or map, and for each customer, check if you have valid change before completing the sale. If you can't make change, return False immediately. The edge case people miss: a $20 payment requires either three $5s or one $10 and one $5. Choose the $10 and $5 combination first. If you're stuck on the greedy priority during your live assessment, StealthCoder surfaces the working solution without the proctor seeing it.

Pattern tags

The honest play

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

Lemonade Change 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. Made by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Lemonade Change interview FAQ

Why is 58% acceptance rate so low for an Easy problem?+

Most failures miss the greedy insight: which change combination to prefer when options exist. Others track change wrong or return True before verifying all transactions complete. It's easy once you see it, hard before you do. That's the 42% gap.

Do I need to use an array or can I use a map/dictionary?+

Either works fine. An array indexed by bill value (5, 10, 20) is slightly cleaner for this problem since there are only three bill types. Readability matters more than performance here since input size is small.

What's the greedy strategy for making change?+

When a customer pays $20 and owes $5, prefer giving one $10 and one $5 over three $5s. You'll need $5s for future $10 payments. When giving change for $10, you must use one $5. If you can't, return False immediately.

Is this still asked at companies like Zalando?+

Yes, Zalando specifically reports asking it. It's a screening-stage problem that filters for basic greedy reasoning and simulation logic. Not hard, but it rewards clear thinking.

What's the time and space complexity?+

Time is O(n) where n is the number of customers, one pass through the array. Space is O(1) because you only track three bill counts regardless of input size. Very efficient.

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