Upwind interview question

Array sorting question which I do not remember