Amazon Interview Question for SDE1s


Country: India
Interview Type: In-Person




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

what do you mean starting of 1's ? Can you give an example?

- guilhebl June 20, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Starting if 1 will be there if numbers are sorted.
If we assume coming numbers are sorted then we can find starting of 1's by binary search in logn time

- ash.taunk3 June 20, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Please be more clear...
1. What do we mean by numbers are coming.
Does it mean that we have a binary stream random integers.
2. What about the starting position of 1.
Does it mean we have to determine the location of most significant 1 in the binary representation of any integer.

Also, are these integers sorted already as they come into the system. I guess not but someone has presented an answer based on that assumption.

- footloose June 20, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Ideally hashing gives the best order of search in such cases O(1) but its preffered in cases of unsorted array i guess,if your question is for sorted array use Binary search to get atleast O(logn)

- Anamay June 24, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

if the sequence is like this (000111) then single variable is enough to hold that position.

That variable will show 3 as 1's start at position number 3

- sivanraj July 07, 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