Two Sigma interview question

array sorting and recursion type question