AppFolio Interview Question

Given an array, how would you return the three largest elements. Then follow up with ways to optimize.