Dsa
Queue
Medium
Order Processing System
You are tasked with simulating an order processing system for a small store. Customers arrive at the store and place orders. Each order takes a variable amount of time to process. You need to read a list of customer orders with their processing times and return the order in which they would be completed along with the end time for each. Input starts with an integer N indicating the number of orders, followed by N lines each containing a string (order name) and an integer (processing time in seconds). Output should be the order names and their respective completion times in the order they were processed.
Example Input:
3
Order1 2
Order2 3
Order3 1
Output:
Order1 2
Order3 3
Order2 6
Key concepts
queuesimulationfifo
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now