Yahoo Interview Question for Software Engineer / Developers






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

dude thats relative velocity question.
lets assume velocity of band as u and dat of dog as v.
let total time be T.
uT=50; and 50/(v+u)+50(v-u)=T
so we get 50/(v+u)+50(v-u)=50/u
solve it to get (v-u)^2=2(u^2) i.e v=(sqrt(2)+1)u
den we know uT=50 so vT=(sqrt(2)+1)uT i.e (sqrt(2)+1)*50 =120.7

- saumils1987 September 20, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

The answer above of 120.7 (approx) is correct.

The dog will travel 50 + x feet to get to the front of the band, since the front of the band will have moved x feet by the time the dog reaches it. To get to the back of the band again, the dog must go x feet, since the back of the band will be where the front of the band was when the dog started out.

You know the time for the band to go 50 feet is the same as the dog to travel its entire journey, which is 50 + x + x = 50 + 2x. So equating the times, you get the equation:
(50 + 2x)/vd = 50/vb (where vd = speed of the dog and vb is speed of the band)

You also know that the band will travel 50 - x feet in the same time that the dog goes x feet after it has reached the front of the band. Thus you get the equation:
x/vd = (50 - x)/vb

If you solve these two equations, you get x equal to approximately 35.35 (since it involves a square root), so that 2x = 70.7 and 50 + 2x = 120.7, which is the total distance traveled by the dog.

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

it is 120.7 metres... for dog because speed of dog is (sqrt(2)+1) times that of band. and band travel 50 metre in overall time so dog would travel more by a factor of srt(2) time the distance traveled by band ..

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

Can you explain in detail.

- ByteScribbler September 20, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I am appalled at lack of thoughtlessness.
The extra distance travelled by dog is from back row to from row and back.
ITS PLAIN 50 (TRAVELLED BY EACH MENBER IN BAND) + 50 (JOURNEY TO FRONT GUY) + 50 (JOURNEY BACK TO OWNER)..sO U KNOW WAT THE ANSWER IS

- Amit Priyadarshi September 25, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

No, because by the time the dog reaches the front of the band, it is farther away than 50 feet from where the back of the band STARTED. Then, when the dog turns around, he has to go from wherever that point is back to where the beginning of the band was when the dog started running from the back of the band. So your first number has to be greater than 50 feet and the second has to be less.

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

I agree with Amit Priyadarshi..

- Crime_Master_GoGo November 27, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

@saumils1987: isnt it 50/(v+u) +50/(v-u)= 50/u ?
How did you solve it?

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

It's exactly 100 feet. The dog runs 50 feet from last row to first row, then 50 feet from first row to last row. The fact that the band moves is irrelevant as far as the distance is concerned, it only changes the times: it takes the dog longer to get to the first row, but shorter to get back.

- Anonymous December 16, 2010 | 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