Palo Alto Networks interview question

graph search question using BFS