J.P. Morgan interview question

Basic DSA questions were asked