Morgan Stanley interview question

Queue, graph and array questions