Pergunta de entrevista da empresa Calcey Technologies

Sort an array to find the min and max? Do you use any optimizations?