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
Journey
I was unaware of this coding stuff till my school life. I got to know about the field of computer science in my class 11th. I found it intresting and decided that I will pursue my career in the field of computer science. I took admission in B.Tech CSE and learned the various concepts like DSA and all.
Application story
I was practising DSA on a regular day when I saw a small advertisement kind of on Hackerearth. I opened it and I got to find that company is looking for some fresher graduates to serve as SDE-1. I applied to it and after the selection process, I was selected.
Why selected/rejected for the role?
I was giving correct explanation for my solutions in the coding round. I also built the optimal solution starting from the brute force algorithm which also added to my points.
Preparation
Duration: 12 months
Topics: Data Structures, OOPS, DBMS, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Participate in live contests on websites like CodeStudio as much as possible.
Tip 2 : Practice previous interview questions from CodeStudio.
Tip 3 : Revise Computer Science subjects like DBMS, OOPS thoroughly.

Application process
Where: Hackerearth
Eligibility: Above 6 CGPA
Resume Tip
Resume tip

Tip 1 : Try to list only those projects in your resume regarding which you're comfortable talking in depth.
Tip 2 : Always be honest about whatever you mention in your resume.
Tip 3 : Keep it 1 pager.
Tip 4 : Don't add your picture in the resume, instead use that space to put something more useful.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date3 Jul 2020
Coding problem1

1. Pythagorean Triplets

Moderate
35m average time
70% success
0/80
Asked in companies
AmazonOYOErnst & Young (EY)

You are given an array of n integers (a1, a2,....,an), you need to find if the array contains a pythagorean triplet or not.

An array is said to have a pythagorean triplet if there exists three integers x,y and z in the array such that x^2 + y^2 = z^2.

Note
1. The integers x,y and z might not be distinct , but they should be present at different locations in the array i.e if a[i] = x, a[j] = y and a[k] = z, then i,j and k should be pairwise distinct.
2. The integers a,b and c can be present in any order in the given array.
Problem approach

1. Sorted the array.
2. Took all the pairs and performed binary Search / Put all the pair sum in a Hashmap and checked each index individually for that sum.

Try solving now
02
Round
Medium
Face to Face
Duration60 minutes
Interview date10 Jul 2020
Coding problem2

1. Number Of Pairs With Given Sum

Moderate
39m average time
60% success
0/80
Asked in companies
Goldman SachsAmazonSamsung

You have been given an integer array/list(arr) and a number 'Sum'. Find and return the total number of pairs in the array/list which when added, results equal to the 'Sum'.

Note:
Given array/list can contain duplicate elements.

(arr[i],arr[j]) and (arr[j],arr[i]) are considered same.
Try solving now

2. Optimal Ordering Of Tasks

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

For eg - Wear Socks then Wear Shoes Brush before Wear Socks 

Output - Brush Wear Socks Wear Shoes

Try solving now
03
Round
Medium
Face to Face
Duration60 minutes
Interview date10 Jul 2020
Coding problem2

1. Next smaller Palindrome

Easy
10m average time
85% success
0/40
Asked in companies
AmazonDeutsche BankSprinklr

You are given a number 'N' in the form of a string 'S', which is a palindrome. You need to find the greatest number strictly less than 'N' which is also a palindrome.

Note:
1. A palindrome is a word, number, phrase, or another sequence of characters that reads the same backward as forward, such as madam, racecar, 1234321, etc.
2. The numerical value of the given string S will be greater than 0.
3. A single-digit number is also considered a palindrome.
4. The answer number should not contain any leading zeros, except for the case when the answer is 0.
5. Note that the length of the string is nothing but the number of digits in N.
Try solving now

2. Kth Largest Element In A Stream

Moderate
30m average time
65% success
0/80
Asked in companies
Wells FargoGoldman SachsPhonePe

You will be given a stream of numbers, and you need to find the 'kth' largest number in the stream at any given time.


As the stream of numbers can not be given during compile time, so you need to design a data structure which can accept infinite numbers and can return the 'kth' largest number at any given time.


The stream of numbers is nothing but a large collection of numbers from which integers are read at runtime, such as the user will never know the upper limit on the number of integers that will be read.


The implemented data structure must support the following operations:

1. add(DATA) :
   This function should take one argument of type and store it in its pool and returns the 'kth' largest number from the current pool of integers.

You will be given 'q' queries:

val - For this query, insert the integer into your current pool of integers and return the 'kth' largest integer from the existing pool of integers.
Note
 1. The maximum number of integers that will be given will always be under memory limits.

 2. You will also be given an initial pool of integers whose size equals k.

 3. The maximum number of queries will be less than 10^5.

 4. The 'kth' largest element is not the 'kth' distinct element but the 'kth' largest element in the sorted order.

 5. There will be at least one query of type 2.
Try solving now
04
Round
Medium
Face to Face
Duration60 minutes
Interview date10 Jul 2020
Coding problem2

1. Trapping Rain Water

Moderate
15m average time
80% success
0/80
Asked in companies
HCL TechnologiesCiti BankAtlassian

You have been given a long type array/list 'arr’ of size 'n’.


It represents an elevation map wherein 'arr[i]’ denotes the elevation of the 'ith' bar.



Note :
The width of each bar is the same and is equal to 1.
Example:
Input: ‘n’ = 6, ‘arr’ = [3, 0, 0, 2, 0, 4].

Output: 10

Explanation: Refer to the image for better comprehension:

Alt Text

Note :
You don't need to print anything. It has already been taken care of. Just implement the given function.
Try solving now

2. Number of Atoms

Moderate
50m average time
0/80
Asked in company
Amazon

Given a string, representing a chemical formula, return the count of each atom.

An atomic element always starts with an uppercase character, then zero or more lowercase letters follow, representing the name.

One or more digits representing that element's count may follow if the count is greater than 1. If the count is 1, no digits will follow. For example, H2O and H2O2 are possible, but H1O2 is impossible.

Two formulas can be concatenated together to produce another formula. For example, H2O2He3Mg4 is also a formula.

A formula placed in parentheses, and a count (optionally added) is also a formula. For example, (H2O2) and (H2O2)3 are formulas.

Given a formula, return the count of all elements as a string in the following form: the first name (in sorted order), followed by its count (if that count is more than 1), followed by the second name (in sorted order), followed by its count (if that count is more than 1), and so on.

Note :
The given formula consists of English alphabets, digits, ‘(‘ and ’)’.

The given formula is always valid. 
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
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