Fall SalePremium questions, over 25% offUnlock all premium questions for over 25% off
Process Queue Simulation
Medium
Question
Processes sit in a queue, and your function should play out how that queue empties. The input is an array wait in which every element is the longest time, in seconds, that the matching process is allowed to wait before it has to leave the queue. Once per second, whichever process sits at the head of the queue gets handled and is taken out. That same second also clears out every process whose limit has been reached, meaning its wait time is less than or equal to the number of seconds that have passed.
...
Asked at:Amazon
More Amazon interview questions
- Get Daily Total Requestsmedium
- Find Minimum Reverse Operationsmedium
- Count Idle Driveseasy
- Test Array Generation Serviceeasy
- Maximum Balanced Shipment Countmedium
- Maximum Consecutive ON Servershard
- Merge Values Into Contiguous Blockshard
- Find Smallest Available Hubmedium
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.