## Apple Interview Question for SDE1s

Country: United States

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

Probability that they do not collide: 1/4
If all go in the same direction.. they will collide if they all move with unequal speeds.

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

Each ant has 2 directions to choose (clockwise and counter clockwise), so there are 2^3=8 cases. Only 2 cases will not get collision (all clockwise, or counterclockwise). So the possibility of collision is 2/8.

Comment hidden because of low score. Click to expand.
-2

if they are moving in either clockwise or anticlockwise simultaneously with same speed then they will collide at the incenter of equilateral triangle.

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

@Ravi - That will happen if they constantly travel towards each other.

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

If direction is same they never collide(here consider speed are same all the ants).
probability of do not collide is 1.

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

if the ant are moving with the same speed, possibility of not collide is 2/8.
If the ant are moving with different speed, possibility of not collide is 0.

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.

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