Google Interview Question

A four step question on a linear array