Accenture Interview Question

They asked me to explain how to reverse an array without using any extra space.

Interview Answer

Anonymous

Sep 15, 2025

I explained the two-pointer approach, where one pointer starts at the beginning and the other at the end of the array. I swap elements until both pointers meet in the middle, which reverses the array in place with O(1) extra space and O(n) time complexity.