← Questions

Sorting complexity: beat O(n²), then design the worst correct sort

0
MercorCodingLast asked Oct 2026

A verbal round with no coding, asked as a quick series:

  1. Explain a sorting algorithm faster than O(n²) and why it is faster; be ready for quicksort's worst case.
  2. Name or invent the worst sorting algorithm you can that is still correct (always terminates, returns the input in order) and give its running time.
  3. If your slow sort tries orderings, how would you generate every permutation of the input?
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding