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

SDE - 1

Amazon
upvote
share-icon
3 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 2 Months
Topics: Data Structures, Algorithms, OOPS, System Design, Algorithms, Dynamic Programming, arrays, graph, Trees
Tip
Tip

Tip 1 : Never give up on coding contests
Tip 2 : Consistency in programming is key to success

Application process
Where: Campus
Eligibility: 7 CGPA
Resume Tip
Resume tip

Tip 1 : Bold the numbers (accuracy,percentage) etc in resume
Tip 2 : Highlight action verbs in description of your project

Interview rounds

01
Round
Easy
Online Coding Interview
Duration60 Minutes
Interview date9 Feb 2022
Coding problem2

It was in afternoon. Online test with video and audio on. Interviewer was interactive

1. Implement Atoi Function

Hard
10m average time
90% success
0/120
Asked in companies
AmazonAdobeMorgan Stanley

You are given a string ‘s’ of length 'n'.


Implement the atoi(string s) function, which converts a given string into a 32-bit signed integer, following similar principles as the atoi function in C/C++.


Here's the step-by-step algorithm for myAtoi(string s):


1. Discard any leading whitespaces.


2. If the next character (if not at the end of the string) is '-' or '+', consider it to determine the sign of the result. If neither is present, assume the result is positive.


3. Read and accumulate digits until a non-digit character is encountered or the end of the input is reached.


4. Convert the collected digits into an integer (e.g., "123" becomes 123, "0032" becomes 32). If no digits were read, the integer is 0. Adjust the sign as needed (as determined in step 2).


5. If the integer falls outside the range of a 32-bit signed integer [-2^31, 2^31 - 1], constrain it to stay within the range. For instance, if the integer is less than -2^31, set it to -2^31; if it's greater than 2^31 - 1, set it to 2^31 - 1.


6. Return the resulting integer.


Note :
1. Only the space character ' ' is treated as a whitespace.

2. All characters other than leading whitespace or digits are considered.


Example:
Input: 45rohit12

Output: 45

Explanation: 
Leading Whitespace: Leading whitespace characters (" ") are ignored.

Numeric Portion: The numeric portion starts with the digit "4".

Reading Numeric Characters: The algorithm reads "4" and "5" to form "45".

End of Numeric Portion: The numeric portion ends at "r", non-numeric characters are skipped.

Parsing Result: "45" is parsed into the integer value 45, the final result.
Try solving now

2. Peeking Iterator

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

Implement the given PeekingIterator class consisting of four functions:

Peeking Iterator (int arr[]): Initialize the object with the given array element.

int next(): Returns the next element and moves the pointer to the next element.

bool hasNext(): Return true if there is still an element in the array that otherwise returns false.

int peek(): Return the next element in the array but don’t move the pointer to the next element. 
You will be given ‘Q’ queries consisting of 'next', 'hasNext', and 'peek' operations. In each query input is of the following type:
0 ‘array/list’ - Initialize the object with the given array element.

1 - Return the next element and move the pointer to the next element.

2 - Return true if there are elements in the array, otherwise return false. 

3 - Perform a peek operation in the array.
For Example:
0 3 7 9 10
1
2 
3

Here we have 4 queries:
Firstly the query is of type 0. Sp, an object will be created with the list [7,9,10], and the pointer will be at 7.

Then the next query is 1 so we will return 7 and the pointer will move to 9.

Then the next query is 2 and there are elements in the array so we will return 'True'.

The last query is 3. So, we will just return 9 by not moving the pointer ahead.
Note:
Only the first query will be of type 0.

You can't directly access the array, instead, you will be given access to a separate iterator class.
Try solving now
02
Round
Hard
Face to Face
Duration60 minutes
Interview date18 Feb 2022
Coding problem1

It was in afternnon , occured online. Interviewer was interactive

1. N Queue Using Array

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

You will be given ‘N’ queries. You need to implement ‘N’ queues using an array according to those queries. Each query will belong to one of these two types:

1 ‘X’ N: Enqueue element ‘X’  into the end of the nth queue. Returns true if the element is enqueued, otherwise false.

2 N: Dequeue the element at the front of the nth queue. Returns -1 if the queue is empty, otherwise, returns the dequeued element.
Note:
Please note that Enqueue means adding an element to the end of the queue, while Dequeue means removing the element from the front of the queue.
Try solving now
03
Round
Easy
HR Round
Duration30 minutes
Interview date20 Feb 2022
Coding problem1

It was in afternoon. Online test with video and audio on. Interviewer was interactive

1. Basic HR Questions

Tell me how you will handle it if suddenly the priorities of a project were changed? 

What is your biggest achievement so far? 

How would you rate yourself on a scale of 1 to 10? 

What are your greatest strengths and weaknesses?

Problem approach

Tip 1 : Be honest with answers
Tip 2 : Be interactive with interviewer

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