Sorting coding challenges

Practise sorting with 6 coding challenges, from easy to hard. Every challenge runs in your browser with instant tests, an AI review of your code and community solutions to compare.

Easy · 2 Medium · 3 Hard · 1

Skills you'll practise: Aggregating resultsComparersConcurrencyDivide and conquerGroupingLINQ JoinMerge sortPartitioningPriority queuesQuickselectSortingSorting with keys
  • Python · C++ · C#
  • Automated tests
  • AI code review
  • Community solutions
226
Challenges
2
Solutions shared
3
Languages

All challenges

Search by topic, language, or difficulty.

6 challenges
Medium

K-th Smallest Element

Find the k-th smallest value without fully sorting.

You'll learn QuickselectPartitioning
AdvancedCompetitive-programmingSorting
No solutions yet
Medium

Tournament Standings

Rank teams from match records.

You'll learn Aggregating resultsSorting with keys
DictionariesParsingSorting
No solutions yet
Hard

Count Inversions

Count the out-of-order pairs in a list.

You'll learn Merge sortDivide and conquer
AdvancedCompetitive-programmingSorting
No solutions yet
Medium

Parallel Task Completion Order

Run tasks concurrently with at most k at a time and report the order in which they finish.

You'll learn ConcurrencyPriority queues
SimulationSorting
No solutions yet
Easy

Join Customers and Orders

Join customers with their orders like a LINQ Join and report each customer's total spend.

You'll learn LINQ JoinGrouping
ArraysSorting
No solutions yet
Easy

Sort by a Chosen Key

Sort people by name or by age with a comparer chosen at run time, breaking ties consistently.

You'll learn ComparersSorting
ArraysSorting
No solutions yet