Infosys Interview Question

They asked me to solve a simple array problem in code, tell about it's complexity and how can we make it better?