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

SDE - 1

Amazon
upvote
share-icon
4 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 Months
Topics: Data Structures and Algorithms, Operating System, Database Management System, Object-Oriented Programming System
Tip
Tip

Tip 1 : Do lot of hard work and practice of Data Structures and Algorithms based questions. 
Tip 2 : I personally recommend you Coding Ninjas and Geeks For Geeks for interview preparation.

Application process
Where: Other
Eligibility: 7 cgpa throughout
Resume Tip
Resume tip

Tip 1 : Make your resume short and try to make it of one page only.
Tip 2 : Do mention all your skills which you are confident of in your resume.

Interview rounds

01
Round
Hard
Online Coding Interview
Duration60 minutes
Interview date4 Jan 2022
Coding problem1

This is purely online coding test . gave us a 3 coding questions. I only remember 1.

1. Find K'th Character of Decrypted String

Moderate
33m average time
0/80
Asked in companies
OptumAtlassianAdobe

You have been given an Encrypted String where repetitions of substrings are represented as substring followed by the count of substrings.

Example: String "aabbbcdcdcd" will be encrypted as "a2b3cd3".

You need to find the 'K'th character of Decrypted String. Decrypted String would have 1-based indexing.

Note :

Input string will always be lowercase characters without any spaces.

If the count of a substring is 1 then also it will be followed by Integer '1'.
Example: "aabcdee" will be Encrypted as "a2bcd1e2"
This means it's guaranteed that each substring is followed by some Integer.

Also, the frequency of encrypted substring can be of more than one digit. For example, in "ab12c3", ab is repeated 12 times. No leading 0 is present in the frequency of substring.

The frequency of a repeated substring can also be in parts.
Example: "aaaabbbb" can also have "a2a2b3b1" as Encrypted String.
Problem approach

I simply decrypt the string by reading substring and their frequency and append current substring to the decrypted string and after the end of traversal of given string our answer will be kth element of the decrypted string.

Try solving now
02
Round
Hard
Video Call
Duration50 minutes
Interview date8 Jan 2022
Coding problem1

This is First purely technical round based on data Structures and Algorithms

1. Count Positive - Negative Pairs

Easy
22m average time
0/40
Asked in companies
AmazonAtlassianAmdocs

You have been given an array/list(ARR) of positive and negative integers. Print the number of pairs where:

arr[i] = -arr[j] and i != j
Note:
Given array/list can contain duplicate elements and will not contain '0'.

(arr[i],arr[j]) and (arr[j],arr[i]) are considered same.
Problem approach

I asked for some clarifications whether I should print all distinct x‘s or if I should print an x if a pair of +x and -x is encountered. The first approach I told was to use a map and I was keeping a flag for +x and -x if it’s found once. Later he asked me to print all pairs, so I stored the frequencies of all the elements in the map and iterated through the negative elements and for each element x , I would print x min(count[-x],count[+x]) times. He said he can’t afford that much space and he wanted me to optimise space further. So I told him a 2 pointer approach where I sort the array once and then keep two pointers to the start and end. I would move the start pointer forward if the sum is less than 0 and I’ll move the end pointer backward if the sum is greater than 0.

Try solving now
03
Round
Medium
Video Call
Duration50 minutes
Interview date12 Jan 2022
Coding problem1

This is Again Back to back technical Round based purely on Data Structures

1. Common Digit Longest Subsequence

Moderate
31m average time
0/80
Asked in companies
OptumLinkedInAmazon

You have been given an array of 'N' Integers. Find the length of the longest subsequence such that each adjacent element of the subsequence has at least one digit in common.

Note :
A sequence 'A' is a subsequence of a sequence 'B' if 'A' can be obtained from 'B' by deletion of several (possibly, zero) elements. For example, [3,1] is a subsequence of [3,2,1] and [4,3,1], but not a subsequence of [1,3,3,7] and [3,10,4].
Problem approach

I initially tried a 2D DP solution where dp[i][j] indicates the length of the longest sequence with ending at i containing j as a digit. It’s a N X 10 DP matrix. The interviewer asked me why I needed a 2D DP solution and I struggled to convince him. I wrote the code for it. It wasn’t completely correct. I was missing something. After thinking for a while I narrowed down to a solution containing only 10 elements dp[0], dp[1], dp[2].. dp[9] which is updated every time I see a new number. I take a number, I go through all digits in the number and find value = 1 + max(dp[d] for all digits d in the number). Set this value to dp[d] for all digits in the number.

Try solving now
04
Round
Medium
Face to Face
Duration30 Minutes
Interview date16 Jan 2022
Coding problem1

This is final round based on technical and HR

1. Sort 0 1 2

Easy
22m average time
0/40
Asked in companies
Expedia GroupWalmartHCL Technologies

You have been given an integer array/list(ARR) of size 'N'. It only contains 0s, 1s and 2s. Write a solution to sort this array/list.

Note :
Try to solve the problem in 'Single Scan'. ' Single Scan' refers to iterating over the array/list just once or to put it in other words, you will be visiting each element in the array/list just once.
Problem approach

I solved this question using three-pointers and this problem was a variation of dutch national flag problem. The interviewer was satisfied by my approach as this was the most optimal approach.

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
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
1593 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