Yahoo Interview Question
Software Engineer / DevelopersThe 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.
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 ..
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
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.
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.
dude thats relative velocity question.
- saumils1987 September 20, 2010lets 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