## Amazon Interview Question for SDE1s

Team: AppStore
Country: United States
Interview Type: In-Person

Comment hidden because of low score. Click to expand.
2
of 4 vote

This question is absurd, I doubt if it is coming from Amazon.

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

You, either did not understand even a bit of the question in the first place or unable to explain it properly.

Comment hidden because of low score. Click to expand.
2
of 6 vote

Can someone explain the question to me ? What blocks is he/she talking about?

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

I may be a wrong but is not the L shape hint for knight movement in a chess.
So basically it boils down to filling the knight path with 1's and making sure that you dont fill the given i,j.

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

LOL

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

No its not knight movement because knight goes 2 step forward then 1 step left or right.

Here its one step forward and then 1 step left or right.

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

@nithin: but why think of starting point as the mid point.We can start from any point.We can start from anywhere as we just need to fill the matrix with L shaped shapes.I may be wrong in understanding the question.

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

@anish[1] - Yes you can start from anywhere. When did I said that you have to start from middle ?

You have to fill whole matrix with L shaped blocks such that only that cell remains unfilled whose co-ordinate is given.

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

For NxN, where N is a power of two. This is a classic divide and conquer.

For others I suppose he was expecting some backtracking algorithm.

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

I gave divide and conquer solution. But I don't think divide and conquer is correct.
For Ex. In the last recursive call we will have 2 X 2 matrix where we can fill only 3 block, which is not correct as we have to fill all blocks except i,j

There must be some DP solution.

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

possible = (N x M -1) % 3 == 0

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.

### 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.