Amazon interview question

A linked list and a graph question