Amazon interview question

Implement a breadth first search