# Amazon Interview Experience for SDE-1 | On-Campus

• Last Updated : 29 Nov, 2021

It consisted of 2 rounds, first an online round and then later a F2F interview.

Online Round: The first round consisted of:

• 7 debugging questions – 20 mins
• 24 MCQs (reasoning based) – 35 mins
• 2 programming questions – 70 mins
• Behavioral questions – 10 mins

Programming Questions:

1. Given a 2D array (m x n) in which all the rows and all the columns are sorted separately, you have to find an element (given) in it.
```Ex : [ 2 4 8 10 13

3 6 11 12 17

5 7 12 15 18 ]

Find 7 in it. ```

Approach: I used simple binary search over row and column separately in two loops (just in case anyone of m and n is very large as compared to the other). Time comp. – O(min(m, n)*log(max(m, n)))

2. You are given an array A of size m*n matrix. It contains 1, 0 where 1 means path is allowed and 0 means path is not allowed. One cell contains ‘9’. You have to start with cell (0, 0) and find out whether it is possible to reach at the cell which contains ‘9’.
```Ex: A: {1, 1, 0}
{9, 1, 0}
{0, 0, 1}
Ans : 1
Ex: A: {0, 1, 0}
{9, 1, 0}
{0, 0, 1}
Ans : 0```

Approach: Simple bfs would do while maintaining a visited matrix to see if the cell has not already been visited.

(similar to rat in a maze problem).

Technical + HR Round: This round lasted for around 45-50 mins. The interviewer was pretty cool and exchanged pleasantries with me.

My Personal Notes arrow_drop_up