Bloomberg interview question

how would you implement BFS