J.P. Morgan interview question

Java core ,spring