## 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?

Comment hidden because of low score. Click to expand.
0

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?

Comment hidden because of low score. Click to expand.
0

@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 ?

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

Comment hidden because of low score. Click to expand.
0

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

Comment hidden because of low score. Click to expand.
0

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

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)

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?

Comment hidden because of low score. Click to expand.
0

i have 0 year of experience.

Comment hidden because of low score. Click to expand.
0

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

Comment hidden because of low score. Click to expand.
0

ok you are write. I am just an aam aadmi

Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0

me too :-)

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.

### 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.