IDFC FIRST Bank interview question

Coding question . They asked bfs with queue