Dsa
Queue
Medium
Task Queue Manager
You are designing a task queue for managing a series of asynchronous tasks that need to be completed. Each task has a unique identifier and a required time to complete. The tasks are managed in a first-come, first-served order. In your program, you will read a list of tasks and output the sequence of task IDs as they are completed.
Example:
Input:
3
T1 5
T2 3
T3 1
Output:
T1
T2
T3
Key concepts
queuecompletiontask management
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