Question bank › Sorting
Dsa Sorting Easy

Tournament Win-Rate Seed

Tournament seeds are calculated using win rates. Given players, their number of wins, and total matches played: 1. Sort by Win Rate (wins / total_matches) descending. 2. If win rates are equal, sort by total matches played descending (more experience). 3. If still tied, sort by name alphabetically. Note: Total matches will always be > 0. Input Format: - An integer N. - N lines: 'PlayerName Wins TotalMatches'. Output Format: - The sorted PlayerNames, space-separated. Example: Input: 3 Alice 5 10 Bob 1 2 Charlie 8 10 Output: Charlie Alice Bob

Key concepts

floating pointtie-breaking

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.