Interview & Career

How to Explain Quick Sort in an Interview

Updated June 8, 2026 5 min read

Quick Sort is the algorithm interviewers most often ask you to explain. A clear, structured explanation signals strong fundamentals. Here is a script that works, followed by the common follow-up questions and how to handle them.

The three-step explanation

Keep it simple: (1) Choose a pivot element. (2) Partition the array so values smaller than the pivot go left and larger go right — now the pivot sits in its final position. (3) Recursively apply the same process to the left and right partitions. When partitions reach size one, the array is sorted.

Hit the key details

Mention that pivot selection matters: a random or median-of-three pivot avoids the O(n²) worst case on sorted input. State that average time is O(n log n), it is in-place with O(log n) stack space, and it is not stable. Reference the full Quick Sort explainer to prepare.

Expect these follow-ups

Common follow-ups: 'What is the worst case and how do you avoid it?' (bad pivots; randomize), 'How does it compare to Merge Sort?' (see Quick vs Merge), and 'Can you make it stable?' (yes, with O(n) space). Watch the partition step live in the visualizer to explain it fluently.

Frequently asked questions

How do you explain Quick Sort simply? +
Pick a pivot, partition the array so smaller elements go left and larger go right (placing the pivot in its final spot), then recursively sort each side. Mention pivot choice, O(n log n) average, O(n²) worst, in-place, and unstable.
What follow-up questions come after explaining Quick Sort? +
Expect questions about the worst case and how to avoid it, comparison with Merge Sort, whether it can be made stable, and the space complexity of the recursion stack.

See it in motion

Watch this algorithm and 9 others run step by step in our free interactive visualizer.

▶ Launch Visualiser

Related articles

← Back to all articles