Microsoft Interview Question for Program Managers






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

D: distance between 2 trains
v1,v2: speeds of two trains
v3: speed of bird(v3>v1 &&v3>v2)

1)Find the time taken to collide
T1=D/(v1+v2)

2)total distance traveled by the bird
D2=T1*v3

3)# of times bird makes a U turn
Maybe infinite (not sure)

- zglgjg May 10, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

You are right and number of turns is infinite.

- HSH February 05, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

hey i also think so

- Anonymous September 08, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

trains traveling in opposite directions never collide

- Anonymous September 28, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

You fool, why won't trains travelling in opposite directions not collide according to the given question.
N plz apply common sense before writing "can never collide".

- roshan November 28, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

First of all trains will never travel on the same track in opposite directions.

- Anonymous March 18, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Obviously you don't know much about how trains travel in China.

- Anonymous August 05, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

trains traveling in opposite directions never collide

- starman September 28, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Train travelling in opposite direction may collide, train travelling in same direction may collide.. only one train can also collide with itself.. ask Indian Railway..
what about the poor bird.. its not even afraid of train whistle..it should die before the last three U turns. :)

- Paul October 05, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

u all are bastards

- anonymous March 20, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

zglgjg is right.
No. of u turns is indefinite,the problem can be identified when there is too short a distance between the trains ie when they are about to collide.

- canmpuppala January 30, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

what is the answer for the second part i.e number of trips made by bird? there will be a infinite series right ..but what is it?

- Anonymous August 27, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Everybody know how to find the distance traveled by the bird. The attraction of the question is the second part... The answer will surprise you..... It depends on the size of the bird (If its a point then infinite, if it is not a point then why are we even solving such a puzzle :). BTW for the trains never colliding read: en.wikipedia.org/wiki/Zeno%27s_paradoxes

- Saurabh Mangal November 16, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

distance traveled: D/vb, where D is the initial distance and vb is the speed of the bird;

Time U turned: infinite. Suppose finite, at the last U turn, suppose the trains are d apart, in d/(vt + vb) time, the bird run into the other train, however the trains are still d(1 - 2vt/(vt + vb))>0 apart, which means there is another U turn. contradiction

- Walainlord December 11, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

if the time of collision of two trains is finite, how can the number of U turns be infinite??

- Silent September 19, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

perfect !!! number of U turns never will be infinite.

- Anonymous December 26, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

ok i understand

- Silent September 19, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Trains travelling in opposite direction on the same track towards each other.
Now is that clear U IDIOTS.

- mukesh February 01, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I just did this yesturday in class, train 1 goes 40mph, train 2 goes 60mph, the bird starts with the faster train and can fly 90mph, having to turn around when he reaches the other train and vice versa until the 2 trains collide. I got that the bird flew 130miles before they crashed.

- Cameron May 29, 2014 | Flag Reply


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