Nokia interview question

1. find second largest and smallest element in an array without using any inbuilt functions