How to Explain Quick Sort in an Interview
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? +
What follow-up questions come after explaining Quick Sort? +
See it in motion
Watch this algorithm and 9 others run step by step in our free interactive visualizer.
▶ Launch Visualiser