OYO interview question

Sort an array based on frequency of its elements.