Question d’entretien chez Shopee

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