Google Interview Question
Software Engineer / Developerssuppose d is distance and Va, Vb and Vc are their respective velocities. now when A finishes, time taken is d/Va. Also
d/Va = d/Vc - 16/Vc
d/Va = d/Vb - 8/Vb
this implies Vb/Vc = (d-8)/(d-16)
also, if you assume time taken by B to cover the remaining distance is t then
Vb = 8/t
and Vc = 6/t
this gives Vb/Bc = 8/6
now solve the two equations and u will get the value of d.
i get 30 mts.
va vb vc be the velocites.
from the change in position betw two given instances
vb = 8/t
vc = 6/t
vb/vc = 4/3
take the velocities as 4v and 3v
take the track distance as D
since both have travelled for the same time. equating their time,
D/3v = (D-10)/4v
which gives D as 30 .
Tell me if the ans is write and also if there is a better approach
Please check the logic:
Speed of A = Sa, Speed of B = Sb, Speed of C = Sc
Let D be the track length, T is time taken by A to travel the track
D/T = Sa, D/(T+8) = Sb, D/(T+16) = Sc.
In 8 minutes, the diff between A and B is 10 minutes.
In 1 minute, the diff is 8/10 =4/5 mins, so Sb=5/4*Sc, Sa=5/2*Sc
Substituting from above
D/(T+8) = 5/4*(D/T+16) => T=24.
Since all speeds can be represented in Sc=D/(24+16), the smallest integer value that makes Sc=1, makes D=40.
The distance is 40 distance units.
S.M - Dude take a vacation. You need one!
No need to complicate things when it can be explained as simply as what "interviewtomorrow" added.
Answer is 40 meter,
Let total distance is D and Total time taken by A is T
S(a) = D/ T , S(b) = D-8 / T , S(c) = D-16 / T;
Now lets assume times taken by B to cover 8ms to finish line was t
S(b) = 8 / t ; S(c) = 6 / t ( Since C only covered 6 meters in that duration);
On Solving this we get S(c) = 3/4 S(b);
Replace the value of S(b) & S(c) inside equation 1
D-8 / T = 4/3 (( D - 16 ) / T );
On Solving we get D = 40
40 meters.
- Anonymous August 09, 2009yt / y-8 = (y-10) t / y - 16
y is length of track
t is time in which A finished the race.