MAQ Software Interview Question

I was asked to write the algorithm of finding the 3rd highest number in an array, and then optimize it.