Halloween Sale
Unlock all premium questions for over 30% off
Process Queue Simulation
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.
...
More Amazon interview questions
- Maximize Total Server Throughputeasy
- Minimum Initial Battery Leveleasy
- Custom Alphabet String Sortingeasy
- Password Similarity Checkmedium
- Pascal Triangle Digit Encryptioneasy
- Maximum Server Set Stabilitymedium
- Bring Down All Serversmedium
- Maximize Assigned Negative Signseasy
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.