Dell Technologies interview question

Write the logic to Reverse an array