Question bank › Queue
Dsa Queue Medium

Event Ticket Queue

A ticketing system for a concert has a queue where customers arrive at different times and buy tickets in batches. Each customer arrives at the queue with a unique ID and a number of tickets they want to buy. Implement a function that reads the list of customers and calculates the total tickets sold in the order they are processed. Input will start with a number N (number of customers), followed by N lines with ID and number of tickets. Output the total tickets sold in order of processing. Example Input: 4 A1 3 B2 1 C3 2 D4 5 Example Output: 3 1 2 5

Key concepts

queuesorting

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
Part of Praxari's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.