Dsa
Queue
Medium
Order Delivery System
You are tasked with designing a delivery queue where multiple delivery personnel are working in a circular manner. Each personnel can pick an order from the front of the queue, deliver it, and return to the end of the queue. If there are no more orders, they must report 'No orders left'. Your task is to simulate this delivery process. The program will first take in the number of delivery personnel, followed by the list of orders and output the order of deliveries as they happen. After all deliveries are made, report how many personnel were active until all orders were delivered.
Example Input:
2
order1
order2
order3
Example Output:
order1
delivered by worker 1
order2
delivered by worker 2
order3
delivered by worker 1
2 active personnel
Key concepts
queuecirculardelivery
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