TuSimple Interview Question

I don't remember the question, but one is BFS pretty basic pattern, the other one is LinkedList also pretty basic , but need to pay attention to details.