Dsa
Queue
Easy
Bank Queue Simulation
Simulate a bank queue system where customers arrive at different times and each customer takes a certain amount of time to be served. Implement a program that takes the number of customers and their respective arrival times and service times, and outputs the order in which customers are served.
Input Format:
- The first line contains an integer C, the number of customers.
- The next C lines each contain two space-separated integers: arrival time and service time for each customer.
Output Format:
- The order of customers (1-indexed) as they are served.
Example:
Input:
3
0 5
1 2
2 3
Output:
1 2 3
Key concepts
queuebankingcustomer service
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