## Adobe Interview Question Developer Program Engineers

• 0

There is an ant in a cube placed at one corner and you need to find the shortest path to the diagonally opposite corner. The ant can not fly tht is obvious.

Country: India
Interview Type: In-Person

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

Its simple . Just open the cube box . and join the two diagonally opposite corners .
I mean first ant will move to the middle of the opposite side on the same plane from the staring point .
Then from that point , it'll start move to the corner (which lies diagonally opp to the starting point )
Total length covered = a*(5^0.5)

Comment hidden because of low score. Click to expand.
0

Can you elaborate it???

Comment hidden because of low score. Click to expand.
0

The thing will be like this

First ant will reach at the opposite side of the same plane with respect to the corner in which it's right now.
So then distance covered (If A is the length of one side):
X1=A*(5^(.5))/2
Then again he will move in the same way:
X2=A*(5^(.5))/2

So total distance = A*(5^(.5))

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

In case of cube the minimum distance is daignal of the cube but as mention in question that ant cant fly so we will first cover the daignal of the surface in which ant is placed currently then we will cover the edge that is luying to the target corner from the current position

Comment hidden because of low score. Click to expand.
0

Just check the total distance covered . Because as per my illustration , distance covered is a*(5^0.5)

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

oh yes answer would be a*(5^0.5)

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

a*(5^0.5)

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

a*(5^0.5) it is...

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

shortest distance would be=diagonal of the surface+edge
diagonal of the surface=sqrt(2)a
edge =a
shortest distance = a(sqrt(2)+1)

Comment hidden because of low score. Click to expand.
0

U r incorrect .

Comment hidden because of low score. Click to expand.
0

Comment hidden because of low score. Click to expand.
0

bbc.co.uk/schools/ks3bitesize/maths/images/net_of_a_cube.gif

this image show the 3D and 2D view of cube. Mark the diagonals and you will get the answer

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

i am getting : a*( (1+ sq-root(2))/2) + 1) which is definitely less then a a*(5^0.5)

move half distance along the edge parallel to horizontal plane and then hypotenusely(a/sq-root(2)) to the lower corner(which is 'a' distance from the destination) , now calculate.

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

``The above answer is correct``

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

Answer should be 3^0.5 * L
l is length of cube

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

It would be (2^0.5 +1)*a

Comment hidden because of low score. Click to expand.
0

my ans is the shortest one .

Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

### Books

is a comprehensive book walking you through every aspect of getting a job at a top tech company, while focuses on software engineering interviews.

### 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.