Domanda di colloquio di Apple

All the questions were easy. Simple pointer chasing or DFS