Amazon Interview Question

The question was essentially to implement breadth first search on social network