Microsoft Interview Question for Software Engineer / Developers


Country: India
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
1
of 1 vote

is BFS good?

- zyfo2 January 04, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Do we need BFS? here is just to find the distance of 2. For two persons A and B, i think we can just check A and B's friend lists and find if there are shared friends or not.

I don't quite understand the last question. if we just define the most influential person has the highest weight (the sum of weights from each connected edge), then this most influential person can be simply found by finding the largest summed weight?

- mintaka January 04, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@zyfo2 : yes BFS is good for first question only, what about others
@lxduan :
consider the case when you have two people having equal number of edge connectivity, and there total weight sum are equal, does it mean that they are equally influential person, what if one person (out of two) is connected with the persons having more edge connectivity, and another person connected with persons having less edge connectivity,
for example A, B are two person
A connected with A1 and A2
B connected with B1 and B2
weight(A1) + weight(A2) = weight(B1) + weight(B2)
but A1 and A2 are connected with 10, 15 other people, and B1 and B2 are connected with 5 , 6 other people, then according to you both A and B are same influential person but they are not, actually A is more influential person then B, now to tell us your solution ?

- sonesh January 04, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think a simple Depth Bounded Search (BFS or DFS) should suffice for the 1st part.

If I understand the 2nd part correctly, we have to find the connectivity between 2 persons such that the people with most weight are included in the path. We can inverse the weights and then find the shortest weighted path using Dijstra's Algo.

For the 3rd question,
Maintain a variable which keeps track of the max. value of weight while doing part2.
OR my understanding of the question is wrong :D

- hero January 04, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

second solution is not correct, and for 3rd question please read my comment to "lxduan"

- sonesh January 04, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Hi sonesh

I am not able to understand why Djikstra wont work foe second part. Could you please explain as this is a really nice question?

Thanks
Anant

- anantkaushik89 January 28, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

1. best possible connections could be identified as sum of weights of all paths (connections) form a candidate person to the target person divided by number of paths.
a default weight of an edge may be assumed as one in this case, so for example- if a candidate vertices (person) is 2 vertices (person) away from target vertice then the sum of that connection is 2.

2. people with weight reduce the sum of each edge connected to them by a factor of their weights, ideally this would be a factor of weights of both sides of a given edge

3. influence of a person could be a function of sum strength of each connection (which may a function of frequency of contact, number of shared friends, duration of connection etc)

- AJ January 15, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 3 vote

Hey..How many yrs of experience u have??
I am only 2 yrs experienced...and i kind of find these question difficult..do they ask this level of questions from 2 yrs exp also?

- Swati January 05, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

i have 0 year of experience.

- sonesh January 13, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@sonesh don't boast of your college...being an iitian doesn't mean you are genious..

- Anonymous January 21, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

ok you are write. I am just an aam aadmi

- sonesh January 22, 2013 | Flag
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 votes

me too :-)

- Nitin Gupta January 04, 2013 | Flag


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

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.

Learn More

Resume Review

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.

Learn More

Mock Interviews

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.

Learn More