Yahoo Interview Question for Software Engineer / Developers






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

Answer = 273

Let x, y, z and d be the distance of the uphill, plain, downhill, and total distance, respectively, where uphill and downhill are viewed as coming from A to B. You get 3 equations that summarize all the data :

x + y + z = d
x/72 + y/64 + z/56 = 4
x/56 + y/64 + z/72 = 4 and 2/3

Though we have only 2 equations for 3 variables, we can still solve this as we need to find (x+y+z) and not x,y,z individually.

Solving equation 2 and 3 above, we get

7x+8y+9z = 4*504 = 7 (x+y+z) + y + 2z
9x+8y+7z = 14*504/3= 9 (x+y+z) - y - 2z

Adding the above 2 equations, we get

16 (x+y+z) = 4368
Hence d = (x+y+z) = 4368/16 = 273

- vijay.bits February 07, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

504/64=7.874 instead of 8, so the answer is a little bit off, not by much though

- ygfster July 31, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

if the plain speed is 63, the problem is solvable. otherwise, it can't get the answer.

- jby1985 February 24, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

distance = (8+2/3)*64
because the downhill become uphill when the car come back. so the average speed for the downhill or uphill is (72+56)/2 = 64.

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

AVERAGE SPPED for uphill and downhill will be

2*72*56/(72+56) and not simply mean

- Aditya October 12, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

30.41 metres assuming speeds are given in m/s

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

30.41 metres assuming speeds are given in m/s

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

30.41 metres assuming speeds are given in m/s

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

30.41 metres assuming speeds are given in m/s

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

Even if we consider the speed is given in m/s,then the given speeds are multiplied by 18/5 and we get the following speeds
259.2kmph,230.4kmph and 201.6kmph.So obviously it should not take more than a few seconds to travel 60.82mts(to & fro).

- canmpuppala January 30, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 2 vote

I disagree. Let x, y, z and d be the distance of the uphill, plain, downhill, and total distance, respectively, where uphill and downhill are viewed as coming from A to B. You get 3 equations that summarize all the data :

x + y + z = d
x/72 + y/64 + z/56 = 4
x/56 + y/64 + z/72 = 4 and 2/3

The 3x3 matrix of the coefficients on the left hand side has det NOT zero, so for EVERY distance d, there are x, y, and z that solve the system.

It's also impossible that only one of these infinite solutions has all x, y and z positive...

So this can't be solved

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

275.69KM
The downhill,plain & regular speeds are given.As we exactly dont know whether the journey from A to B is entirely downhill and B to A as entirely uphill,we just ignore these two speeds.
Therefore,Let D be the distance and k be the average increment and decrement of speed during the to and fro journeys respectively,viz
speed*time=Distance ie
A to B: D=(64+K)*4
B to A:D=(64-k)*14/3(ie 4hrs 40min in fraction)
As D is same,therefore,
(64+k)*4=(64-k)*14/3
=(64+k)/(64-k)=14/(3*4)
solve this to get k=64/13(approx 4.92kmph)
Therefore,D=275.69KM
As A to B and B to A are considered not to be entirely downhill and uphill,the incremental speed(4.92kmph) is less than what is stated in the question 8kmph (ie 72-64 or 64-56)

- canmpuppala January 30, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

x + y + z = d
x/72 + y/64 + z/56 = 4; (1)
x/56 + y/64 + z/72 = 14/3; (2)

from (1) and (2)
56x + 63y + 72z = 16128; (1')
72x + 63y + 56z = 18816; (2')

from(1') and (2')
(2') - (1') => x - z = 168;
63(x + y + z) - 7x + 9z = 16128; (1'')
63(x + y + z) - 7z + 9x = 18816; (2'')
(1'') + (2'') => 63*2(x + y + z) - 2(x - z) = 34944;
So x + y + z = 280 KM

- zombie June 24, 2013 | 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