Amazon Interview Question for Software Engineer / Developers






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

got selected by the way :)

- AnonymousUser March 27, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

were the results announced the same day?

- xyz March 27, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

--

- AnonymousUser March 27, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

no, after 2-3 days

- AnonymousUser March 27, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

did u answer all questions correctly???

- Anonymous March 27, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Given a matrix of characters M and an input string S, find if S occurs in M in horizontal or vertical direction.

Any thoughts on this questions .

I think i should search the first char of string S in matrix which will take O(M*M) time then i think we can proceed in horizontal or vertical direction. I know this is very basic solution and interviewer is probably expecting better than this .

- sachin323 March 27, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

My approach towards this problem is
Lets say we have matrix of M having m rows and n columns
always search row wise for S[0] or S[x-1] where x is the length of string.
Now suppose currently you are at (i,j) position in matrix.
int a =0; // a global variable
if( M[i,j]== S[0] && i<=(m-x)){

bool flag = true;
for( a = 1 to x-1){
if( S[a] == M[i+a,j])
continue;
else{
flag = false;
break;
}
}
a= 0;
if(flag){
we got the string.
return ;
}
}
if( M[i,j]== S[0] && j<=(n-x)){

bool flag = true;
for( a = 1 to x-1){
if( S[a] == M[i,j+a])
continue;
else{
flag = false;
break;
}
}
if(flag){
we got the string.
return ;
}
}

if( M[i,j]== S[x-1] && i<=(m-x)){

bool flag = true;
for( a = 1 to x-1){
if( S[x-a] == M[i+a,j])
continue;
else{
flag = false;
break;
}
}
a = 0;
if(flag){
we got the string.
return ;
}
}
if( M[i,j]== S[x-1] && j<=(n-x)){

bool flag = true;
for( a = 1 to x-1){
if( S[x-a] == M[i,j+a])
continue;
else{
flag = false;
break;
}
}
if(flag){
we got the string.
return ;
}
}

//If none of the above returns then
//Start searching from S[i,j+ a+1] if a+1 <=n
// else start from S[i+1,0]

- Tito March 28, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Are you telling me they asked you only coding questions ?

- Really? March 28, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Not only coding but all were related to algorithms , design and coding.

- Anonymous March 28, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

What' the answer to the linked list question (2) and the stock question (3)?

- Anonymous March 28, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

In list question. make one scan on list 1 and one scan on list 2. Let sizes be m and n. If m is larger then n, then skip pointer of m from head (m-n) times. now size of both list is same. now skip each pointer side by side, till you reach common node.

in stock question one option in brute force method O(n*2). Another way is to keep track of current max and try to find minimum after that. if you find max again. reset every thing and remember the last max loss.

- Anonymous March 28, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Can you eloborate more on the stock solution please? What exactly does the question mean and what's the solution in detail.

- Anonymous March 28, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Congratulations, AnonymousUser

- Anonymous March 28, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Thanks

- Anonymous March 28, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

How do you answer the Round 5 questions?

- Anonymous March 28, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Given an array of integers from 1 to N, and given a number X, how many ways are there to pick X elements from the array such that no two elements in the selected X elements are consecutive.

for any k : k*(k-2)*(k-4)* (k-6) till zero......

- For the 3rd round question March 28, 2010 | 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