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

SDE - 1

Amazon
upvote
share-icon
2 rounds | 2 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 2 months
Topics: Data Structures, Algorithms, Java, JavaScript, OOPS
Tip
Tip

Tip 1 : Do one question from leet code daily
Tip 2 : If you have less time kindly go through coding questions
Tip 3 : Revise all the frameworks concepts that are there in your resume

Application process
Where: Referral
Eligibility: 0-3 years of Experience, proficient in any one programming language
Resume Tip
Resume tip

Tip 1 : Your resume should not exceed more than one page
Tip 2 : Add all the links for your work and try to show data points in your resume. (For reg: Worked on a feature that has increase user base by 33%)

Interview rounds

01
Round
Hard
Online Coding Test
Duration60 minutes
Interview date16 Sep 2021
Coding problem1

The test link was provided you can take the test as per your own convenience but it had to completed in a week's time.

1. Find K Closest Elements

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

You are given a sorted array 'A' of length 'N', two integers 'K' and 'X'. Your task is to print 'K' integers closest to 'X', if two integers are at the same distance return the smaller one.

The output should also be in sorted order

Note:
An integer 'a' is closer to 'X' than an integer 'b' if: 
|a - X| < |b - X|  or (  |a - X| == |b - X| and a < b )
For Example:
if X = 4,  3 is closer to 'X' than 9, as |3-4| < |9-4|  i.e., 1 < 5   and if X = 4, 2 and 6 are equally close to it, as |2-4| == |6-4| = 2, but we say 2 is closer to 4 than 6, as 2 is smaller.
Problem approach

I used two pointers
Two pointer solution
private int[][] primeAirTime(int[][] in, int[][] out, int target)
{
// base checks
Arrays.sort(in, (a,b) -> a[1]-b[1]);
Arrays.sort(out, (a,b) -> a[1]-b[1]);
int low = 0, high = out.length-1;
int ans = 0;
List list = new ArrayList<>();
while(low < in.length && high >= 0)
{
int sum = in[low][1] + out[high][1];
if(sum <= target)
{
if(sum > ans)
{
ans = sum;
list = new ArrayList<>();
}
list.add(new int[]{in[low][0], out[high][0]});
low++;
}
else
{
high--;
}
}
return list.toArray(new int[list.size()][]);
}

Try solving now
02
Round
Medium
Video Call
Duration30 minutes
Interview date23 Sep 2022
Coding problem1

It was a half an hour coding round where the interviewer asked me a coding question and asked me to solve it

1. Reverse Alternate K nodes

Easy
10m average time
90% success
0/40
Asked in companies
AdobeIntuitSalesforce

You are given a Singly Linked List of integers and a positive integer 'K'. Modify the linked list by reversing every alternate 'K' nodes of the linked list.

A singly linked list is a type of linked list that is unidirectional, that is, it can be traversed in only one direction from head to the last node (tail).
Note:
If the number of nodes in the list or in the last group is less than 'K', just reverse the remaining nodes. 
Example:
Linked list: 5 6 7 8 9 10 11 12
K: 3 

Output: 7 6 5 8 9 10 12 11

We reverse the first 'K' (3) nodes and then skip the next 'K'(3) nodes. Now, since the number of nodes remaining in the list (2) is less than 'K', we just reverse the remaining nodes (11 and 12). 
Note:
You need to reverse the first 'K' nodes and then skip the 'K' nodes and so on. 5 6 7 10 9 8 11 12 is not the correct answer for the given linked list. 
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
1592 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
58237 views
5 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Samsung
12648 views
2 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Microsoft
5983 views
5 comments
0 upvotes