Qualcomm Interview Question for Software Engineer / Developers






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

I had this one before too.
There are 2 scenarios where no ants will ever meet one another:
1) L L L
2) R R R

If any of the goes a different direction they will collide.

Different combinations for 3 ants:
L L L
L L R
L R L
R L L
R R L
R L R
L R R
R R R
= 8 = 2**3

1 - 2/8 = 6/8 = 3/4 = 0.75

For any polygon, generic formula would sth like:
1 - 2/(2**n)

Pentagon = 1 - 2/32 = 15/16 etc.

- NC April 07, 2006 | Flag Reply
Comment hidden because of low score. Click to expand.
2
of 2 vote

here is nice post on this question
campuscoke.blogspot.in/2014/12/3-ants-and-triangle-puzzle_12.html

- Jack December 10, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The three ants will not be colloiding with eachother only if either they moving in clockwise or anticlickwise direction.So taking two ants simultaneously the pobability of colloiding the ants will be 1/4 so probability of not colloiding the ants=1-1/4=3/4=0.75.

- Tarun Varshney(AMU Aligarh,UP) July 08, 2006 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Can the ants stand still? Must they all move at the same speed? :)

- John Hascall August 08, 2006 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

you can assume all three go at the same speed and never stop.

- Sach August 08, 2006 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

they can be stationary too

- srinivas January 09, 2008 | 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