Optimal (WA) Interview Question

Write code to sort an array, explain algorithm, build a max heap, and there were some word problems/riddles.