Intuit Interview Question

algorithm for friends connections using graph