Yahoo Interview Question for Software Engineer / Developers






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

they all will meet at the center of square, and will follow a circular trajectory...

time = pi*L/(4*v)

where L is length of cube, and v is the speed with which dogs are running

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

can u explain ??

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

what if the polygon is a hexagon ?

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

Be any polygon relative velocity always works

- vijay October 01, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

rv's answer is correct. They meet at the center of the square and move on a circular trajectory. The distance from a corner to the center is therefore 1/4 of the circumference of the circle (2*pi*radius). The radius is 1/2 the length of a side of the square, L. So the distance traveled by a dog is:
1/4 * 2 * pi * 1/2 * L = pi*L/4
Since time = distance/velocity,
t = (pi*L)/(4*v)

- Frank January 28, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

How is "The distance from a corner to the center is therefore 1/4 of the circumference of the circle" ?

- Unknown June 09, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

let 'd' be the side of square and 'v' be the velocity of dogs.Now,the relative velocity of any dog w.r.t. its neighbour is {v_rel=v+vcos(90)}=>v.Hence the time taken is
d/v
correct me if wrong

- vijay October 01, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Your way to look at the problem is the same as mine. And there is also another way to look a the problem. The dogs will meet at the center is for sure. So the velocity of each dog, at every moment, can be divided into two parts: the sub velocity towards the center (V_c) and the velocity perpendicular to the line between the dog and the center (V_p). |V_c| = |V_p| = |V|/sqrt(2), for each and every moment before they meet. The distance between the center and the dog was initially d/sqrt(2), so the time taken is [d/sqrt(2)] /[V/sqrt(2)] = d/V.

- liutongsg October 11, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

The dogs will meet at the center of the square.Probably u should refer to H.C.Verma Physics of class 12 or Arihant. I think a similar problem was there in that book but just instead of square there was a triangle and I remember that they would meet at centroid.

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

Can someone explain it?

- srav December 09, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Meeting point is common sense - they all travel with the same velocity and for same time => they all travel same distance. Also, they all meet. center is the only point inside the square which is at same distance from all the 4 corners. Similarly centroid.

Rest is math.

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

relative velocity computed is wrong....check direction of travel...

- Anonymous January 17, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Consider a small time interval ∆t at the beginning of journey . In this time interval,all of them travel a distance v∆t in the direction of person they are facing.(See figure) Through this process, all persons travel along the four different quadrants of the circles with one end at their starting position and another at the center of square O.The radius of each arc is d/2 and length of arc is 1/4(2π (d/2)> = πd/4. Thus the time taken by each person moving with speed v to reach O along he quadrant arc is t= πd/(4v)

- Aryamaan Yadav May 16, 2016 | 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