Dsa
Queue
Warm-up
Customer Service Line
A customer service center uses a queue to manage incoming calls. Each customer call is represented by a unique ID. When a call comes in, it is added to the end of the queue. The service agent answers calls in the order they are received. Create a function that simulates this behavior by processing a list of incoming calls and outputting the order in which they are answered.
Input format:
- The first line contains an integer n (1 ≤ n ≤ 100) - the number of customer calls.
- The following n lines each contain a unique call ID.
Output format:
- Print each call ID in the order they were answered on a new line.
Example:
Input:
4
123
456
789
101
Output:
123
456
789
101
Key concepts
queuesimulation
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