Design an ATM Machine
A medium-tier problem at 42% community acceptance, tagged with Array, Greedy, Design. Reported in interviews at Yandex and 0 others.
Design an ATM Machine is a medium-difficulty system design problem that shows up in Yandex interviews and tests whether you can build a stateful machine that handles real constraints. You need to model withdrawal logic, bill denominations, and state management without getting bogged down in over-engineering. The 42% acceptance rate isn't because the algorithm is hard. It's because candidates either over-complicate the data structures or miss edge cases around cash availability and denomination combinations. If this hits your live OA and you blank on the state machine pattern, StealthCoder surfaces a working solution in seconds, invisible to the proctor.
Companies that ask "Design an ATM Machine"
Design an ATM Machine 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 trick is recognizing this is a Greedy problem wrapped in a design shell. You maintain a count of each bill denomination in your ATM. When a withdrawal request comes in, you greedily dispense the largest bills first, working down to smaller ones. The real catch is checking if the requested amount is even possible before you start dispensing. A naive approach tries denominations in order without validation, then gets stuck halfway through a withdrawal. The correct flow: validate the total amount matches available bills, then greedily pull denominations from largest to smallest, and only commit the transaction if the full amount can be satisfied. State management matters because you can't half-dispense cash. If this problem appears in your assessment and the greedy order isn't obvious, StealthCoder handles the denomination logic and state rollback instantly.
Pattern tags
You know the problem.
Make sure you actually pass it.
Design an ATM Machine recycles across companies for a reason. It's medium-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.
Design an ATM Machine interview FAQ
Is this really just a greedy problem or is there a DP twist?+
Pure greedy. You dispense largest bills first because smaller denominations can always combine to make up any remainder your greedy pass leaves. DP would be overkill and slower. The design layer is state and validation, not algorithmic complexity.
What's the main edge case that tanks submissions?+
Attempting to dispense before validating the full amount is available. You must check if the requested sum can be satisfied by your current bills before modifying any state. Partial withdrawals cause hard failures in production and in test cases.
How do I handle deposits and multiple users?+
Deposits add to your denomination counts. Multiple users typically aren't required unless the problem explicitly states it. Keep your solution scoped to what's asked. Multi-user concurrency would require locking, which is almost never the intent at medium difficulty.
Does Yandex ask this differently than other companies?+
Data is limited, but Yandex has reportedly asked it. Assume standard ATM rules: support common denominations like 10, 20, 50, 100. Don't invent exotic requirements. Follow the problem statement exactly.
Should I use a heap or just track counts in a dictionary?+
Dictionary of denomination counts is simpler and faster. You don't need a heap because you iterate denominations in a fixed order. Simpler code passes more test cases and runs cleaner.
Want the actual problem statement? View "Design an ATM Machine" on LeetCode →