Apple interview question

All the questions were easy. Simple pointer chasing or DFS