Amazon Interview Question for Software Engineer / Developers






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

fuck

- john February 09, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

It can be solved in optimized way using divide and conquer. Being 2d space, need to divide array in four parts. Call same function recursively and take care of border elements.

- vt February 09, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hi siva.sai.2020,

Please post the answer for this question also, in case you know

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

Could do this-

1. Generate a graph using the Grid. Can use Adjacency List or Grid as is (i.e. adjacency Matrix)
2. Define these functions -
-> gen_words(startchar, endchar)
{ /*BFS traversal of the graph*/ }
-> gen_all_words()
{
for(i=A to Z)
for(j=A to Z)
gen_words(i,j)
}
-> construct_graph(grid[][]){/* graph construction to be done only once at start*/}
-> main(){ construct_graph();
gen_all_words();
}

- srikar February 12, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

We need to maintain a Visited[n][n] flags.. so that we don't loop around.. once this is done the algorithm is simple.. check for boundary conditions and for visited flags.. if not recurse in all 4 direction (i, j) - > (i-1, j), (i, j-1), (i+1, j), (i, j+1).. print the words as we traverse.. remember to reset the flag as we recurse out..

- raj March 01, 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