J.P. Morgan Interview Question

Data structures puzzles.