Dsa
Queue
Easy
Review Queue Management
You are tasked with managing a code review queue for software developers. Each developer can submit code for review, and reviews are processed in the order they were received. Your job is to simulate this review process. Write a program that manages the submission and processing of code reviews based on a series of commands. Commands are given as follows:
1. `ADD NAME` - A developer named `NAME` submits their code for review.
2. `PROCESS` - Process the review of the oldest submission. If there are no submissions, output 'No submissions to process.'
3. `COUNT` - Output the current number of submissions in the queue.
The input consists of several lines representing commands. The output must reflect the results of the `PROCESS` and `COUNT` commands.
Example Input:
ADD Alice
ADD Bob
COUNT
PROCESS
COUNT
PROCESS
PROCESS
Example Output:
2
1
1
No submissions to process.
Key concepts
queuedata structuresimulation
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