Dsa
Queue
Warm-up
Customer Support Rotation
A customer support team of N agents works in a fixed rotation. When a ticket arrives, the agent at the front of the queue handles it and then moves to the back of the queue. Given the initial list of agents and the total number of tickets received today, identify which agent will handle the very last ticket.
Example:
Input:
Alice,Bob,Charlie
4
Output: Alice
(Explanation: T1: Alice, T2: Bob, T3: Charlie, T4: Alice)
Key concepts
queuecircular buffer
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