Skip to main content

TL;DR

Expected Comparisons in Randomized Quicksort: A canonical quantitative trading interview question at olympiad difficulty. Commonly asked at Jane Street, HRT, Jump Trading.

By Valenke Exam Prep Team·Last updated 2026-06-01
olympiadProbabilistic Algorithm Analysis

Expected Comparisons in Randomized Quicksort

Asked at: Jane Street, HRT, Jump Trading

Problem
In randomized quicksort, a pivot is chosen uniformly at random at each recursive call. For an array of nn distinct elements, find the exact expected number of comparisons. Express your answer as a sum involving harmonic numbers.

Ready to practice for the Valenke Finance Exam?

Adaptive practice powered by Item Response Theory targets your weak areas. Start with 3 free sessions.

Start free practice →