Question bank › Sorting
Dsa Sorting Easy

Event Countdown

You are tasked with sorting a list of upcoming events given their start dates and times. The events should be sorted first by date and then by time within the same date. Each event is represented by its name, start date, and start time. Input format: - The first line contains an integer, n (1 ≤ n ≤ 1000): the number of events. - The next n lines contain a string (the event's name), a date in the format YYYY-MM-DD, and a time in HH:MM format. Output format: - Print the sorted list of events, each on a new line. Example: Input: 3 Conference 2023-10-05 09:00 Meeting 2023-10-05 11:00 Workshop 2023-10-04 10:00 Output: Workshop 2023-10-04 10:00 Conference 2023-10-05 09:00 Meeting 2023-10-05 11:00

Key concepts

sortingdatestime

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.