title: Printing the friend connections level by level
body: <p>I recently encountered this question in an interview and did pretty bad at it. </p>
  
  <pre><code>Setup:
  Assume primitive Facebook. FB has Members.
  
  class Member {
  String name;
  String email;
  List&lt;Member&gt; friends;
  }
  </code></pre>
  
  <p>Question: 
      Code printSocialGraph(Member m). Direct friends of m are Level 1 friends.
      Friends of friends are level 2 friends.....and so on
      Print level 1 friends first. Then print level 2 friends....and so on</p>
  
  <pre><code>void printSocialGraph (Member m){
  //Your code here
  }
  </code></pre>
  
  <p>I tried to maintain a queue for storing the friends at each level but I did not get it very far. Any idea how we could go about solving it with all error checking conditions ?</p>