Domanda di colloquio di PayPal

Basic Java theory questions, 1 Algo question, Questions on manipulating numbers on arrays, A pseudo-code which asks how you can improve it better