Amazon Interview Question
Software Engineer / DevelopersI guess its simple question
for every 10m distance A covers B cover 9. So if A runs 110m(100 + 10) B will run 99 (90 + 9)
So A will win for sure
A is the winner in the second race also
From first race, time taken by both rabbits is same. Let S1 & S 2 be the speed of two rabbits respectively
Hence 100/s1 = 90/s2 -> s1 = 10s2/9
In the second race, A takes time t1 = 110/s1 = 99/s2
B takes time t2 = 100/s2
Obviously t1<t2 and hence A is the winner
All you people wrote craps/duplicates without going through the very first solution which is clear and perfect.
@seema, don't criticize others, ppl may not be as brilliant as u .. respect others views/opinions
@Anon: criticism can be a good thing.
@seema. Did you even bother to read all the solutions? At least try to understand what others write before claiming it is crap. You have only added to the crap.
One of those solutions (give by two different people) is particularly clear (and perfect):
1) A is faster than B
2) When A runs 100m, B has run 90m and at that point they are at the same spot in the second race. Now, since A is faster, he wins.
In the first race A and B reached 100m and 90m respectively, say in time T. In the second race, the only difference is that A starts 10m behind. So by simple geometric translation, in the same time T, A will reach 90m, same as B. So now A and B will race the last 10m from the same point. But A will win because A's speed is greater, as demonstrated by the first race.
It's obviously A, look
- Anonymous December 23, 2008In the first race A runs 100m while B runs 90m,
in the second race this puts A at meter 90 when B is at meter 90, because A is faster (from the first race) he will run that last 10m faster than B, so be will lose on meter 99.