Amazon Interview Question for Software Engineer / Developers






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

trie can be used

en.wikipedia.org/wiki/Trie

- chakra June 07, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Yes Its Trie

- WgpShashank June 08, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

if we have a lot of space at out disposal we can use Hashtable.
for each prefix of a word in the dictionary, we must hash that prefix and value should be a set of all the words which has that prefix...look up will be constant time

- Amm Sokun June 08, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

read trie on wikipedia. Its better than hash in such a situation.

- Anonymous June 09, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

We should definitely use a trie but also we should provide suggestions of word that are minimal in length from the current internal node.

- Ashish Kaila June 10, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Ternary search tree is good solution

- kumarasvn June 15, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hashtables are most efficient if we have a lot of space
for examples if the words are :
accomplish, accomplishment, account
then hash['a'] = {accomplish, accomplishment, account}
hash['ac] = {accomplish, accomplishment, account}
hash['acc'] = {accomplish, accomplishment, account}
hash['accom'] = {accomplish, accomplishment}
hash['accomp'] = {accomplish, accomplishment}
hash['accompl'] = {accomplish, accomplishment}
hash['accompli'] = {accomplish, accomplishment}
hash['accomplis'] = {accomplish, accomplishment}
and so on...

although a lot of extra space is used but search suggestion is always O(number of words mactching the prefix}...thus it is better than trie if space is sufficient.

Other than that trie is always used

- Amm Sokun June 22, 2011 | 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