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

SDE - 1

Amazon
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 2 months
Topics: Array, Strings, Graph, Linked list, DP, Greedy, Trees, Binary search, Two-pointers
Tip
Tip

Tip 1 : Prepare application part of topics like graph other than the general questions.
Tip 2 : Prefer Leetcode for solving questions.
Tip 3 : Practice as many questions as possible from topic arrays.

Application process
Where: Campus
Eligibility: Cgpa above 7
Resume Tip
Resume tip

Tip 1 : Add stuff you really have good knowledge about.
Tip 2 : Use the point-wise format for filling any area (eg: Brief explanation of projects).

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date13 Jan 2020
Coding problem2

1. Count Inversions

Moderate
40m average time
55% success
0/80
Asked in companies
Hewlett Packard EnterpriseBNY MellonGrab

For a given integer array/list 'ARR' of size 'N' containing all distinct values, find the total number of 'Inversions' that may exist.

An inversion is defined for a pair of integers in the array/list when the following two conditions are met.

A pair ('ARR[i]', 'ARR[j]') is said to be an inversion when:

1. 'ARR[i] > 'ARR[j]' 
2. 'i' < 'j'

Where 'i' and 'j' denote the indices ranging from [0, 'N').
Problem approach

I used merge sort.

Try solving now

2. Evaluation of postfix expression

Easy
15m average time
90% success
0/40
Asked in companies
eBayDirectiSlice

An expression is called the postfix expression if the operator appears in the expression after the operands.

Example :

Infix expression: A + B  *  C - D 

Postfix expression:  A B + C D - *

Given a postfix expression, the task is to evaluate the expression. The answer could be very large, output your answer modulo (10^9+7). Also, use modular division when required.

Note:
1. Operators will only include the basic arithmetic operators like '*', '/', '+', and '-'.

2. The operand can contain multiple digits. 

3. The operators and operands will have space as a separator between them.

4. There won’t be any brackets in the postfix expression.
Problem approach

Common question

Try solving now
02
Round
Medium
Video Call
Duration40 minutes
Interview date5 Jul 2020
Coding problem2

1. Rearrange String

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

You are given a string of lowercase characters. Your task is to rearrange (reorder) the string in such a way that no two adjacent characters are the same.

You have to return the rearranged string. If there exists more than one solution you can return any of them.If there is no such string you have to return “NO SOLUTION”. If your returned value is correct the program will print ‘CORRECT’ else ‘INCORRECT’.

For example :

If we are given a string "aabb", then the possible solutions are:

(i) abab
(ii) baba

We can see no two adjacent characters are the same in both strings.

So both (i) and (ii) are valid solutions.
Problem approach

I used a priority queue to solve this question.

 

Try solving now

2. Pair Sum

Easy
15m average time
90% success
0/40
Asked in companies
Media.netExpedia GroupQuikr

You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to return the list of all pairs of elements such that each sum of elements of each pair equals 'S'.

Note:

Each pair should be sorted i.e the first value should be less than or equals to the second value. 

Return the list of pairs sorted in non-decreasing order of their first value. In case if two pairs have the same first value, the pair with a smaller second value should come first.
Problem approach

I solved this question using binary search.

Try solving now
03
Round
Medium
Video Call
Duration40 minutes
Interview date5 Jul 2020
Coding problem2

1. Find Number of Islands

Moderate
34m average time
60% success
0/80
Asked in companies
WalmartShareChatAmazon

You are given a 2-dimensional array/list having N rows and M columns, which is filled with ones(1) and zeroes(0). 1 signifies land, and 0 signifies water.

A cell is said to be connected to another cell, if one cell lies immediately next to the other cell, in any of the eight directions (two vertical, two horizontal, and four diagonals).

A group of connected cells having value 1 is called an island. Your task is to find the number of such islands present in the matrix.

Problem approach

I solved it using DFS.

Try solving now

2. Count triplets in a sorted doubly linked list whose sum is equal to a given value x

Moderate
15m average time
85% success
0/80
Asked in companies
OlaAmazon

You are given a sorted doubly linked list of distinct nodes that means no two nodes present in the list have the same data. You are also given an integer 'X'.Your task is to count the number of triplets in the list that sum up to a given value 'X'.

A doubly linked List (DLL) contains an extra pointer, called the previous pointer, together with the next pointer and data, which are there in the singly linked list such that both forward and backward navigation is possible.

For example, DLL is 1<->2<->3<->4 NULL and the given integer 'X' is 9, then the number of triplets having the sum 9 is only one, and that is (2,3,4).

Note:
1. If no such triplets exist, return zero.
2. At least three elements will always be present in the linked list.
Problem approach

I solved it using the 2 pointer technique.

Try solving now

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
3085 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Amazon
2295 views
1 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Amazon
1593 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Amazon
8963 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
5984 views
5 comments
0 upvotes