New
ML System Design & SQL tracks just landed
See what's new
×
Question Bank
Pricing
Blog
Forum
HOT
Referral
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
Google
Coding Question
AI Insights
Quick Summary
Simulate an ATM queue where customers withdraw at most k dollars per turn.
Customers who still need money cycle to the back until their balance reaches zero.
Return the 1-based indices of customers in the exact order they finish.
What This Tests
Queue simulation mechanics
Ceiling division and integer math
Stable sorting and tie-breaking logic
Time-space complexity trade-offs
Common Patterns
Sorting
Collapse
Hint 1
Hint 2
Hint 3
What Interviewers May Ask Next
Accepted
1.4k
/2.1k
Acceptance Rate
66.7%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.6-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
amounts =
k =
Output
Expected