Goldman Sachs Interview Question

Question related to linked lists and graphs.