Bloomberg Interview Question

Describe an algorithm to find mutual friends on Facebook.

Interview Answer

Anonymous

Apr 25, 2011

Say you want to find mutual friends for A and B. Perform a BFS at A and enter all nodes into a hashtable. Similarly perform a BFS at B and find the collisions

1