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.

- Murali Mohan January 31, 2014 | Flag Reply
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.

- Westlake January 31, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
-2
of 2 votes

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

- RAVI February 07, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

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

- romil.bm April 14, 2015 | Flag
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.

- abc January 31, 2014 | Flag Reply
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.

- ABCD February 01, 2015 | 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