Palo Alto Networks Interview Question

graph search question using BFS