Indeed interview question

How to reverse an array.