Question bank › Sorting
Dsa Sorting Warm-up

Sort Dates

Implement a program that reads a list of dates from standard input and sorts them in chronological order. Each date is in the format 'DD-MM-YYYY'. Input format: - The first line contains an integer n (1 ≤ n ≤ 100). The second line contains n dates separated by spaces. Output format: - A single line containing the dates sorted in chronological order, separated by spaces. Example: Input: 4 01-01-2020 15-05-2019 02-02-2021 20-12-2019 Output: 15-05-2019 20-12-2019 01-01-2020 02-02-2021

Key concepts

sortingdatesstrings

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.