Amazon interview question

Code test Where do you improve your self find largest and smallest second number in large array sort space complexity