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

SDE - 1

Amazon
upvote
share-icon
2 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Data Structures, Algorithms, Graphs, Dynamic Programming, OOPS, Operating System, Database Management, C++,Computer Networks.
Tip
Tip

Tip 1 : You must have a grip over Data Structures and algorithms. Your concepts must be crystal clear. Pick one coding platform and try to practice at least 7-10 coding questions everyday. 
Tip 2 : After attempting any coding problem, analyze its time and space complexity. See, if you can further optimize your solution. You can always check the editorials and compare your solution with it.
Tip 3 : Apart from coding questions keep studying concepts of Operating Systems, databases and object oriented programming. You can always refer to Coding Ninjas articles for it. Also, Coding Ninja's Data Structures and algorithms course in C++ helped me a lot in improving my OOPS concepts specifically.

Application process
Where: Campus
Eligibility: Candidate must be female
Resume Tip
Resume tip

Tip 1 : You do not need to have a long list of projects on your resume. One good project with proper knowledge of it will do good. Similarly, do not list down several number of skills. Few skills but roper knowledge of them are enough.
Tip 2 : Do not fake anything on your resume. The interviewer gets to know about it by asking questions. If you aren't able to answer, it leaves a negative impact.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration180 minutes
Interview date24 May 2020
Coding problem2

The online test consisted of 2 coding questions, 30 aptitude MCQs, 30 behavioral MCQs and 10 code snippets to debug. The coding questions were of medium level, aptitude MCQs were easy and the code snippets to debug was also of easy level. Each section had a time constraint.

1. Merge Two Sorted Linked Lists

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

You are given two sorted linked lists. You have to merge them to produce a combined sorted linked list. You need to return the head of the final linked list.

Note:

The given linked lists may or may not be null.

For example:

If the first list is: 1 -> 4 -> 5 -> NULL and the second list is: 2 -> 3 -> 5 -> NULL

The final list would be: 1 -> 2 -> 3 -> 4 -> 5 -> 5 -> NULL
Problem approach

I provided a solution with O(n+m) Time complexity and O(1) Space complexity.
1. Before starting the loop, pick a list l1, a "least" list, with the least first element, another one l2 will be a "bigger" list.
2. You run through the "least" list l1 and once its element is bigger than l2, exchange them and continue running through l1.
3. After the loop, whatever is left in l2 is bigger than anything in l1, append it to l1.

Try solving now

2. Minimum Path Sum

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

Ninjaland is a country in the shape of a 2-Dimensional grid 'GRID', with 'N' rows and 'M' columns. Each point in the grid has some cost associated with it.


Find a path from top left i.e. (0, 0) to the bottom right i.e. ('N' - 1, 'M' - 1) which minimizes the sum of the cost of all the numbers along the path. You need to tell the minimum sum of that path.


Note:
You can only move down or right at any point in time.
Problem approach

I applied Dynamic Programming to this question,
As we can move either right or down , we must update the grid[i][0] as well as grid[0][j] values first and finally update the grid values by adding the current grid[i][j] with the minimum value : min(grid[i-1][j],grid[i][j-1]). The bottom right element will be the answer then.

Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date26 Jun 2020
Coding problem4

My interview was at 9:00 am. The interview was conducted on Amazon Chime and my webcam was on. The interviewer also asked me to write the code on a document which can be edited by both me and the interviewer. The difficulty of the questions was of medium level. I was asked 3 coding questions along with 2 questions related to OOPS at the end. The interview ended with the discussion of one of my projects. The interviewer was good and also gave me hints wherever required.

1. Palindrome Partitioning

Moderate
25m average time
75% success
0/80
Asked in companies
CultfitDunzoQuikr

You are given a string 'S'. Your task is to partition 'S' such that every substring of the partition is a palindrome. You need to return all possible palindrome partitioning of 'S'.

Note: A substring is a contiguous segment of a string.

For Example:
For a given string “BaaB”
3 possible palindrome partitioning of the given string are:
{“B”, “a”, “a”, “B”}
{“B”, “aa”, “B”}
{“BaaB”}
Every substring of all the above partitions of “BaaB” is a palindrome.
Problem approach

I used the Backtracking algorithm along with Dynamic Programming.
2 conditions to be kept in mind are:
1. The characters at start and end indexes are equal.
2. The substring starting at index start+1 and ending at index end−1 is a palindrome.
Let N be the length of the string. To determine if a substring starting at index start and ending at index end is a palindrome or not, I used a 2 Dimensional array dp of size N⋅N where,
dp[start][end]=true , if the substring beginning at index start and ending at index end is a palindrome.
Otherwise, dp[start][end] ==false.
Also, update the dp array, if you find that the current string is a palindrome.

Try solving now

2. Longest Increasing Subsequence

Moderate
30m average time
65% success
0/80
Asked in companies
IBMVisaOYO

For a given array with N elements, you need to find the length of the longest subsequence from the array such that all the elements of the subsequence are sorted in strictly increasing order.

Strictly Increasing Sequence is when each term in the sequence is larger than the preceding term.

For example:
[1, 2, 3, 4] is a strictly increasing array, while [2, 1, 4, 3] is not.
Problem approach

I used Dynamic Programming for this question.
1. Create a dp array of size N initialized with 0.
2. dp[i] represents the length of the longest increasing subsequence( including the i th element).
3. To find out dp[i], append the current element(nums[i]) in every possible increasing subsequences upto the (i−1) th index(including the (i−1) th index).
4. Finally determine dp[i] using:

dp[i] = max(dp[j])+1,∀0≤j num[j]

At the end, the maximum out of all the dp[i]'s to determine the final result.
LIS length=max(dp[i]),∀0≤i<n

Try solving now

3. Find Missing Number In String

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

You had a sequence of consecutive nonnegative integers. You appended all integers at the end of each other to form a string ‘S’ without any separators. While appending each integer in a string, you forgot to append exactly one integer from the sequence. Now all the integers from a string and you don’t know which integer you have missed.

For example sequence 11, 12, 13 may form a string (without any separators) “1113” if you miss 12.

Your task is to find the missing number in the string such that it is possible to obtain a sequence of consecutive non-negative integers from the given string. If more than one missing integer is present or all the integers are already present or if the string is not valid then the answer will be -1 for all such cases.

Note:
1. The string consists of only digits 0 to 9.
2. The numbers will have no more than six digits. 
Problem approach

1. Try all lengths from 1 to 6.
2. For every length we try, check if the current length satisfies the property of all consecutive numbers and one missing. 3. The number of digits may change as we increment numbers. For example when we move to 100 from 99. To handle this situation, find the number of digits using log base 10.

Try solving now

4. DBMS

Tell the ACID properties in DBMS.

Problem approach

Tip 1 : Be clear with your concepts of operating systems and databases. Don't use those technical terms which you aren't clear with.
Tip 2 : Try to communicate clearly with the interviewer. Explain your solution clearly.

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