Domanda di colloquio di J.P. Morgan

Basic coding questions, then your thought process on them