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

Software Developer

Amazon
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data Structures, Algorithms, System Design, Aptitude, OOPS
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
Face to Face
Duration60 minutes
Interview date6 May 2015
Coding problem2

Technical Interview round with questions on DSA.

1. Stock Buy and Sell

Moderate
20m average time
80% success
0/80
Asked in companies
HCL TechnologiesGoldman SachsMakeMyTrip

You are given an array(PRICES) of stock prices for N consecutive days. Your task is to find the maximum profit that you can make by completing as many transactions as you like, where a transaction denotes buying one and selling one share of the stock.

Note:

You must sell the stock before you buy it again.
Problem approach

The idea is to traverse the given list of prices and find a local minimum of every increasing sequence. We can gain maximum profit if we buy the shares at the starting of every increasing sequence (local minimum) and sell them at the end of the increasing sequence (local maximum). 


Steps :
1. Find the local minima and store it as starting index. If not exists, return.


2. Find the local maxima. and store it as an ending index. If we reach the end, set the end as the ending index.


3. Update the solution and Increment count of buy-sell pairs. 


4. Repeat the above steps till the end is not reached.

Try solving now

2. Balanced Parantheses

Easy
10m average time
80% success
0/40
Asked in companies
AmazonIntuitOracle

You're given a string 'S' consisting of "{", "}", "(", ")", "[" and "]" .


Return true if the given string 'S' is balanced, else return false.


For example:
'S' = "{}()".

There is always an opening brace before a closing brace i.e. '{' before '}', '(' before ').
So the 'S' is Balanced.
Problem approach

A stack can be used to solve this question. 
We traverse the given string s and if we :
1. See open bracket we put it to stack.
2. See closed bracket, then it must be equal to bracket in the top of our stack, so we check it and if it is true, we remove this pair of brackets.
3. In the end, if and only if we have empty stack, we have valid string.


Complexity: Time complexity is O(n) : we put and pop each element of string from our stack only once. Space complexity is O(n).

Try solving now
02
Round
Medium
Face to Face
Duration50 minutes
Interview date6 May 2015
Coding problem2

Technical interview round with DSA based questions.

1. Minimum number of jumps to reach end

Moderate
15m average time
85% success
0/80
Asked in companies
Deutsche BankGoldman SachsAmazon

You have been given an array 'ARR' of ‘N’ integers. You have to return the minimum number of jumps needed to reach the last index of the array i.e ‘N - 1’.


From index ‘i’, we can jump to an index ‘i + k’ such that 1<= ‘k’ <= ARR[i] .


'ARR[i]' represents the maximum distance you can jump from the current index.


If it is not possible to reach the last index, return -1.


Note:
Consider 0-based indexing.
Example:
Consider the array 1, 2, 3, 4, 5, 6 
We can Jump from index 0 to index 1
Then we jump from index 1 to index 2
Then finally make a jump of 3 to reach index N-1

There is also another path where
We can Jump from index 0 to index 1
Then we jump from index 1 to index 3
Then finally make a jump of 2 to reach index N-1

So multiple paths may exist but we need to return the minimum number of jumps in a path to end which here is 3.
Problem approach

Approach 1 : Naive Recursive Approach

A naive approach is to start from the first element and recursively call for all the elements reachable from first element. The minimum number of jumps to reach end from first can be calculated using minimum number of jumps needed to reach end from the elements reachable from first.

minJumps(start, end) = Min ( minJumps(k, end) ) for all k reachable from start

TC : O(n^n)
SC:O(n)

Approach 2 : Dynamic Programming - Tabulation

We can solve this iteratively as well. For this, we start from the last index. We need 0 jumps from nums[n-1] to reach the end. We store this as dp[n - 1] = 0 and then iteratively solve this for each previous index till the 0th index. Here dp[i] denotes minimum jumps required from current index to reach till the end.

1) For each index, we explore all the possible jump sizes available with us.
2) The minimum jumps required to reach the end from the current index would be - min(dp[jumpLen]), where 1 <= jumpLen <= nums[currentPostion]

TC : O(n^2)
SC : O(n)

Approach 3 : Most optimal - Greedy-BFS

We can iterate over all indices maintaining the furthest reachable position from current index - maxReachable and currently furthest reached position - lastJumpedPos. Everytime we will try to update lastJumpedPos to furthest possible reachable index - maxReachable.

Updating the lastJumpedPos separately from maxReachable allows us to maintain track of minimum jumps required. Each time lastJumpedPos is updated, jumps will also be updated and store the minimum jumps required to reach lastJumpedPos (On the contrary, updating jumps with maxReachable won't give the optimal (minimum possible) value of jumps required).

We will just return it as soon as lastJumpedPos reaches(or exceeds) last index.

TC : O(n)
SC: O(1)

Try solving now
Easy
15m average time
85% success
0/40
Asked in companies
AmazonFactSetNagarro Software

You have been given a matrix of ‘N’ rows and ‘M’ columns filled up with integers where every row is sorted in non-decreasing order. Your task is to return all the elements of the given matrix in non-decreasing order.

Problem approach

The basic idea of this approach is to store the elements of the matrix in an array/list and then sort the elements. Steps are as follows:

1. Create an auxiliary array/list of N*M length.

2. Traverse the matrix and insert all the elements in that array/list.

3. Sort that list/array in non-decreasing order.

Try solving now
03
Round
Easy
HR Round
Duration30 minutes
Interview date6 May 2015
Coding problem1

This was a typical managerial round.

1. Basic HR Questions

Q.1. Tell me about yourself
Q.2. Negative and positive things in you
Q.3. How will you resolve conflicts with your manager
Q.4. How will you resolve conflicts with your team mates

Problem approach

Tip 1 : The cross questioning can go intense some time, think before you speak.

Tip 2 : Be open minded and answer whatever you are thinking, in these rounds I feel it is important to have opinion.

Tip 3 : Context of questions can be switched, pay attention to the details. It is okay to ask questions in these round, like what are the projects currently the company is investing, which team you are mentoring. How all is the work environment etc.

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
Software Developer
2 rounds | 4 problems
Interviewed by Amazon
1117 views
0 comments
0 upvotes
company logo
Software Developer
4 rounds | 6 problems
Interviewed by Amazon
1082 views
0 comments
0 upvotes
company logo
Software Developer
2 rounds | 4 problems
Interviewed by Amazon
1033 views
0 comments
0 upvotes
company logo
Software Developer
3 rounds | 6 problems
Interviewed by Amazon
970 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Software Developer
5 rounds | 14 problems
Interviewed by Microsoft
4029 views
1 comments
0 upvotes
company logo
Software Developer
6 rounds | 12 problems
Interviewed by SAP Labs
2912 views
0 comments
0 upvotes
company logo
Software Developer
4 rounds | 6 problems
Interviewed by SAP Labs
1075 views
0 comments
0 upvotes