Amazon Interview Question for Senior Software Development Engineers


Team: AWS
Country: United States
Interview Type: Phone Interview




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

I was also asked a similar question once.
We can use array to implement hashtable
and for collisions we can use self balancing trees like AVL or red black trees so that the searching time is logN

- swati4agrawal April 24, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I'm not quite sure I get this question. A Hash Table itself is a data structure. Why would we use another data structure to make this data structure?

- Anonymous April 13, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
3
of 3 votes

The question is basically asking if you have to implement your own hashTable how will you do .

1 simple approach to implement hashtable is using an array of fixed sized ( initial capacity = c) . If we consider load factor to be x, then everytime when hashtable is x% full, we will need to copy all the elements in our array a to another array with double size.

- champion April 14, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

I was also asked a similar question once.
We can use array to implement hashtable
and for collisions we can use self balancing trees like AVL or red black trees so that the searching time is logN

- swati4agrawal April 24, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I was also asked a similar question once.
We can use array to implement hashtable
and for collisions we can use self balancing trees like AVL or red black trees so that the searching time is logN

- swati4agrawal April 24, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

There are several variations.
1) as 'champion' said, create array of given data structure and use open addressing
2) use array of pointers to given data structure and use separate chaining. (in this case we have to insert a pointer to the data structure within the structure)

Deciding hash function depends on the content of the data structure.

for 1st method we need to have collision resolving techniques like linear probing, quadratic probing. (for more details read Data structures and algorithms by Mark Allen Weiss). And as 'champion' said when the array is full we need to increase the size and do rehashing.

- dadakhalandhar May 14, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

greg.txt;1;3

- qHTNGWUBUzatbql February 09, 2014 | 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