is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
I think the simplest way would be to use adjacency matrix.
- Anurag March 10, 2021-> Let's say there are 10 users right now in the network
-> Use a 10X10 matrix (M) where M[i][j]=1 means i and j are friends (Of-courseM[j][i] will also be 1 ). keep M[i][i]=0.
-> AddFreindShip(int i, int j): Just mark M[i][j]=1 and M[j][i]=1;
-> List<Integer> GetSuggestedFriends(int i): These could be friends of friends. Just retrieve all the integers in i row where value M[i][0 to 9] == 1. Let' s say you have got a List<Integer> tmp. Now find all friends of the person in tmp list. Make sure you are not adding duplicate values and also do not include the numbers which are already in tmp;