J.P. Morgan interview question

Linked list and arrays