Qualcomm Interview Question for Software Engineer / Developers






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

We can start inquiring the the numbers at indices at 2, 4, 8, ... till we find a 1 at say 2^(n-1) and a 0 at 2^n. Now we can do binary search between these two indices for 0.

- Anonymous May 22, 2007 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

We can't apply binary search as we don't know the size of the array and I guess there is no better solution that what's posted by Anonymous.

- gauravk.18 February 29, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The bit operators are faster.
So just keep XOR-ing with 1 all the indices starting from the first index.. The index where this operation gives a result 1 is the required index

- Thirumalai T March 31, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

WHy not use Xors with exponentiating indices as suggested earlier?

- Lokesh February 04, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

'\u2202'

- Anonymous November 21, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

I think the above suggested solution would take no less average time then applying the binary search algorithm . So we have a easy solution for this doing this in 'log n' time . Do u need it further faster than this, even I would like to know if there is any way to improve time complexity .

- Dinesh January 16, 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