Peerspace interview question

sort an array of objects