Pregunta de entrevista de Shopee

Write efficient code to find 2nd largest element in array, by considering all possible user inputs.