TEKsystems interview question

Coding mainly on arrays they have asked