Amazon Interview Question for Software Engineer / Developers


Team: Retail
Country: India
Interview Type: In-Person




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

are we given the another word?

- Anonymous November 14, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

No. Asked the same question. he told thats the trick :). Was looking for modification of minimum edit distace problem.

- aniketnit November 14, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

go for lcs of the current word with the dcitionary. The longest lcs gives the minimum edit distance.

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

Looks like TRIE data structure question.

- Anonymous November 16, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

@Anonymous

Dictionary can be quite big.

Minimum edit distance can solve the problem but in that we are actually given a word to which we need to make a match.
But here it is a dictionary in which it can match to any word.

Two concerns:
1)If we are going to add a word than which word need to be added.If we are looking for all possible characters than it sounds like very inefficient.
2)To what extent the word length can increase.This is still a question mark until we iterate dictionary to find actual length.

- nitin November 16, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I was going through some spell checker algorithms in the web. Found this one very useful. May be this solves the basic concept to the problem.

norvig.com/spell-correct.html

- Anonymous November 16, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I believe its about the levenshtein distance algorithm. Please refer the following link

Refer Wikipedia for more.

Thanks

Vinod Varma ( vinodbvarma@gmail.com)

- Vinod Varma November 20, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Its about String alignment. for eg the strings:-

String A:> bat
String B:> bath
String C:> cat

we use Alignment scores:
if 2 different chars align, score = 2. It represents a replace(del nd insert op)
if a char match with a space, score = 1. It represents an insert op.

Now consider Alignment with A,C:-
b-a-t
c-a-t
here 'b' aligns with 'c' so score = 2.

Consider string A,B:-
b-a-t
b-a-t-h
here 'h' aligns with a space: ' '. so score = 1.
this score is min, so the nearest string is bath and it involves an insert operation.

This is a standard 'string alignment' problem. can google it.

But the question is how to get the other strings to which we should compare with ?
I am not getting any idea how to go 4 it...
guess compare it with all the strings in the dictionary, using 'branch and bound' technique, starting with the nearest strings as a heuristic.

- Sapthrishi November 21, 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