J.P. Morgan Interview Question

Two coding questions and two behavior questions.