A ride-hailing app sorts a hundred thousand waits in place. A last-value pivot on a reversed list takes 83 minutes; a random pivot and a shallow recursion make quick sort safe.
You work on the ride-hailing app.