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

SDE - 1

Amazon
upvote
share-icon
4 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Data Structures, Algorithms, System Design, Aptitude, OOPS, SQL
Tip
Tip

Tip 1 : Must do Previously asked Interview as well as Online Test Questions.

Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.

Tip 3 : Do at least 2 good projects and you must know every bit of them.


 

Application process
Where: Campus
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Have at least 2 good projects explained in short with all important points covered.

Tip 2 : Every skill must be mentioned.

Tip 3 : Focus on skills, projects and experiences more.


 

Interview rounds

01
Round
Medium
Online Coding Test
Duration120 minutes
Interview date21 Sep 2020
Coding problem2

1. It was an online coding round
2. It started on 5pm and ended by 7:25 pm
3. There was a coding round, code debugging, aptitude & reasoning and working culture rounds.

1. Course Schedule

Easy
15m average time
85% success
0/40
Asked in companies
UberAppleDunzo

You are a student of Netaji Subhas Institute of Technology. You have to take ‘N’ number of courses labelled from 1 to N to complete your B.Tech Degree.

Some courses may have prerequisites, for example, to take course 1 you have to first take course 2, which is expressed as a pair: [1, 2]. Now, your task is to find is it possible for you to finish all courses.

Note: There are no duplicate pairs in the prerequisites array.

For example-
If N = 2 and prerequisite = [[1, 2]]. Then, there are a total of 2 courses you need to take. To take course 1 you need to finish course 2. So, it is possible to complete all courses. 
Problem approach

Standard question on Topological Sort. Solved using Kahn's Algo

Try solving now

2. Validate BST

Moderate
25m average time
0/80
Asked in companies
FacebookAmazonFreshworks

You have been given a binary tree of integers with N number of nodes. Your task is to check if that input tree is a BST (Binary Search Tree) or not.

A binary search tree (BST) is a binary tree data structure which has the following properties.

• The left subtree of a node contains only nodes with data less than the node’s data.
• The right subtree of a node contains only nodes with data greater than the node’s data.
• Both the left and right subtrees must also be binary search trees.
Example :

BST1

Answer :

Level 1: 

All the nodes in the left subtree of 4 (2, 1, 3) are smaller 
than 4, all the nodes in the right subtree of the 4 (5) are 
larger than 4.

Level 2 :

For node 2:
All the nodes in the left subtree of 2 (1) are smaller than 
2, all the nodes in the right subtree of the 2 (3) are larger than 2.
For node 5:
The left and right subtrees for node 5 are empty.

Level 3:

For node 1:
The left and right subtrees for node 1 are empty.
For node 3:
The left and right subtrees for node 3 are empty.

Because all the nodes follow the property of a binary search tree, the above tree is a binary search tree.
Problem approach

1) Do In-Order Traversal of the given tree and store the result in a temp array. 
2) This method assumes that there are no duplicate values in the tree.
3) Check if the temp array is sorted in ascending order, if it is, then the tree is BST.
Time Complexity: O(n)

Try solving now
02
Round
Medium
Face to Face
Duration60 minutes
Interview date26 Sep 2020
Coding problem2

There was an intro in the start. He asked few questions related to current achievements. Then he made me solve 2 coding problems.

1. Detect and Remove Loop in a Linked List

Moderate
10m average time
90% success
0/80
Asked in companies
IBMDelhiveryQualcomm

Given a singly linked list, you have to detect the loop and remove the loop from the linked list, if present. You have to make changes in the given linked list itself and return the updated linked list.

Expected Complexity: Try doing it in O(n) time complexity and O(1) space complexity. Here, n is the number of nodes in the linked list.

Problem approach

I know this as I have already solved it before.
We can hash the addresses of the linked list nodes in an unordered map and just check if the element already exists in the map. If it exists, we have reached a node which already exists by a cycle, hence we need to make the last node’s next pointer NULL.

Try solving now

2. Rotting Oranges

Moderate
20m average time
78% success
0/80
Asked in companies
Samsung R&D InstituteSalesforceSamsung

You have been given a grid containing some oranges. Each cell of this grid has one of the three integers values:

  • Value 0 - representing an empty cell.
  • Value 1 - representing a fresh orange.
  • Value 2 - representing a rotten orange.
  • Every second, any fresh orange that is adjacent(4-directionally) to a rotten orange becomes rotten.

    Your task is to find out the minimum time after which no cell has a fresh orange. If it's impossible to rot all the fresh oranges then print -1.

    Note:
    1. The grid has 0-based indexing.
    2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.
    
    Problem approach

    Solved using multisource BFS

    Try solving now
    03
    Round
    Easy
    Face to Face
    Duration60 minutes
    Interview date30 Sep 2020
    Coding problem2

    There was an intro in the start. He asked about the types of problems asked in previous round and asked me what kind of difficulties I have faced. Again, I was asked to solve 2 problems.

    1. Boolean Evaluation

    Moderate
    10m average time
    90% success
    0/80
    Asked in companies
    AmazonIntuitUber

    You are given an expression 'exp' in the form of a string where operands will be : (TRUE or FALSE), and operators will be : (AND, OR or XOR).


    Now you have to find the number of ways we can parenthesize the expression such that it will evaluate to TRUE.


    As the answer can be very large, return the output modulo 1000000007.


    Note :

    ‘T’ will represent the operand TRUE.
    ‘F’ will represent the operand FALSE.
    ‘|’ will represent the operator OR.
    ‘&’ will represent the operator AND.
    ‘^’ will represent the operator XOR.
    

    Example :

    Input: 'exp’ = "T|T & F".
    
    Output: 1
    
    Explanation:
    There are total 2  ways to parenthesize this expression:
        (i) (T | T) & (F) = F
        (ii) (T) | (T & F) = T
    Out of 2 ways, one will result in True, so we will return 1.
    
    Problem approach

    Here, we need to draw the recursion tree for the recursive solution. We can be solve it by filling a table in bottom-up manner.

    Try solving now

    2. SQL Question

    Get alternative odd records from the Employees table

    Problem approach
    Select employeeId from (Select rowno, employeeId from employee) where mod(rowno, 2) = 1
    04
    Round
    Medium
    Face to Face
    Duration50 minutes
    Interview date1 Oct 2020
    Coding problem1

    Firstly, I was asked about some managerial questions. Then one system design question was asked.

    1. System Design Question

    Design an Elevator system. And then write an algorithm for that Design such that the user request should be completed in logN time in an N story building with M elevators.

    Here's your problem of the day

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

    Skill covered: Programming

    How do you remove whitespace from the start of a string?

    Choose another skill to practice
    Similar interview experiences
    company logo
    SDE - 1
    3 rounds | 5 problems
    Interviewed by Amazon
    3084 views
    0 comments
    0 upvotes
    company logo
    SDE - 1
    4 rounds | 8 problems
    Interviewed by Amazon
    2294 views
    1 comments
    0 upvotes
    company logo
    SDE - 1
    3 rounds | 6 problems
    Interviewed by Amazon
    1592 views
    0 comments
    0 upvotes
    company logo
    SDE - 1
    4 rounds | 8 problems
    Interviewed by Amazon
    8962 views
    0 comments
    0 upvotes
    Companies with similar interview experiences
    company logo
    SDE - 1
    4 rounds | 5 problems
    Interviewed by Microsoft
    58238 views
    5 comments
    0 upvotes
    company logo
    SDE - 1
    4 rounds | 8 problems
    Interviewed by Samsung
    12649 views
    2 comments
    0 upvotes
    company logo
    SDE - 1
    4 rounds | 8 problems
    Interviewed by Microsoft
    5983 views
    5 comments
    0 upvotes