Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding
Ninjas X Naukri.com

Amazon interview experience Real time questions & tips from candidates to crack your interview

Amazon

2 rounds | 4 Coding
problems

Preparation

Duration: 7-8 months

Topics: Data Structures, Algorithms, Operating System, DBMS , OOPS

Tip

Tip 1 : Create a timetable and set goals. Keep aside 3-4 hours for studying. Consistency is the key.

Tip 2 : Do atleast 2 projects

Tip 3 : Know the complexities of the code that youâ€™ve written.

Application process

Where: Campus

Eligibility: 65% in 12th

Resume tip

Tip 1 : Do not put false things on resume.

Tip 2 : You should have good projects to showcase.

01

Round

Medium

Online Coding Interview

Duration140 minutes

Interview date22 May 2020

Coding problem2

Timing: 7 pm

```
1) From any cell you can move UP, DOWN, LEFT, or RIGHT.
2) You cannot move out of the grid.
```

Problem approach

I Used Dynamic Programming to solve it.

```
1. The matrix may also contain some negative elements.
2. A square matrix is a matrix with the same number of rows and columns.
A matrix obtained by deleting some (possibly zero) of the rows and/or columns from the beginning and/or from the end of a matrix is said to be a sub-matrix of the given matrix.
Example: Given a matrix
A = 1 2
3 4
Possible non-empty sub-matrices of A are represented below by bold numbers-
```

Problem approach

I used HashMap to solve it.

02

Round

Easy

Video Call

Duration90 minutes

Interview date11 Jun 2020

Coding problem2

Timing : 2 pm

The interviewer was very friendly.

```
Input: Consider the binary tree A as shown in the figure:
```

```
Output: [10, 5, 3, 7, 18, 25, 20]
Explanation: As shown in the figure
The nodes on the left boundary are [10, 5, 3]
The nodes on the right boundary are [10, 20, 25]
The leaf nodes are [3, 7, 18, 25].
Please note that nodes 3 and 25 appear in two places but are considered once.
```

Problem approach

Step 1 : I first applied vertical traversal and store it in a hashmap and print boundary element of each value in the hashmap.

Step 2 : He asked me the time complexity and space complexity.

Step 3 : He asked to optimise the solution and gave some hints.

Step 4 : I wasn't able to think at that points but he was expecting something using recursion.

```
The given singly linked list is 6 -> 5 -> 3 -> 4 -> 7 -> 1 -> 2
```

```
The modified linked list should have all even values in starting and odd values in the end.
```

Problem approach

Step 1 : I told him to create two linkedLists. One for odd elements and another for even elements. and while traversing the given list adding elements to even and odd lists respectively.

Step 2 : He asked me to optimise the space complexity.

Step 3 : I told him to change the list in place which will be taking O(1) complexity.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Suppose list1 is [2, 133, 12, 12], what is max(list1) in Python?

Choose another skill to practice

Start a Discussion

Similar interview experiences

SDE - Intern

3 rounds | 3 problems

Interviewed by Amazon

1241 views

0 comments

0 upvotes

SDE - Intern

3 rounds | 7 problems

Interviewed by Amazon

453 views

0 comments

0 upvotes

SDE - Intern

2 rounds | 3 problems

Interviewed by Amazon

454 views

0 comments

0 upvotes

SDE - Intern

1 rounds | 3 problems

Interviewed by Amazon

824 views

0 comments

0 upvotes

Companies with similar interview experiences

SDE - Intern

4 rounds | 7 problems

Interviewed by Microsoft

12620 views

1 comments

0 upvotes

SDE - Intern

3 rounds | 6 problems

Interviewed by Microsoft

7476 views

0 comments

0 upvotes

SDE - Intern

2 rounds | 3 problems

Interviewed by Google

5326 views

1 comments

0 upvotes