J.P. Morgan interview question

Spring, Java, Ds