Citadel interview question

variation of the quickselect algorithm