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: 7 months
Topics: Data structure and algorithmoperating systemdbmsoopscomputer networkweb development
Tip
Tip

Tip 1 : Be very clear with your project explanation.
Tip 2 : Also try to cover all the cs core subjects explanation clearly.

Application process
Where: Campus
Eligibility: above 6.5 CGPA
Resume Tip
Resume tip

Tip 1 : Make it clean with appropriate knowledge.
Tip 2 : Provide true information and avoid telling lie in which You are not sure.

Interview rounds

01
Round
Medium
Video Call
Duration45minutes
Interview date16 Dec 2021
Coding problem1

It was morning time and from 9:00 am . It happened via the google meet online process and it was very smooth onboarding . Interviewer was very friendly kind of nature .

1. Add Two Numbers As Linked Lists ll

Moderate
10m average time
80% success
0/80
Asked in companies
QuikrMicrosoftAdobe

You have been given two singly Linked Lists, where each of them represents a positive number without any leading zeros.

Your task is to add these two numbers and print the summation in the form of a linked list.

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

The two numbers represented by these two lists are 12345 and 45, respectively. So, adding these two numbers gives 12390. 

So, the linked list representation of this number is 1 -> 2 -> 3 -> 9 -> 0 -> NULL.
Problem approach

PROGRAM:

class Solution
{
public:
//Function to add two numbers represented by linked list.
Node*reverse(struct Node*head){
Node*curr=head;
Node*prev=NULL;
Node*nxt;
while(curr!=NULL){
nxt=curr->next;
curr->next=prev;
prev=curr;
curr=nxt;
}
return prev;
}
public:
struct Node* addTwoLists(struct Node* first, struct Node* second)
{
// code here
first=reverse(first);
second=reverse(second);
int c=0;
int s=0;
Node*temp;
Node*cur;
Node*res=NULL;


while(first!=NULL||second!=NULL){
s=c+(first?first->data:0)+(second?second->data:0);
if(s>9){
c=1;
}
else{
c=0;
}
s=s%10;
temp=new Node(s);
if(res==NULL)res=temp;
else{
cur->next=temp;
}
cur=temp;
if(first)first=first->next;
if(second)second=second->next;
}
if(c!=0){
temp=new Node(c);
cur->next=temp;
cur=temp;
}
res=reverse(res);
return res;
}
};

Try solving now
02
Round
Medium
Video Call
Duration45 minutes
Interview date16 Dec 2021
Coding problem1

It was again the morning session and the interviewer was very supportive in nature and gave me the hint too to think the approach and finally i came up the solution which he was expecting.
Also the i felt from amazon all the interviewer is very comfortable and suppportive.

1. Flatten Linked List

Moderate
0/80
Asked in companies
DunzoAmazonExpedia Group

You are given a Multilevel Linked List of integers, where in addition to the next pointer each node has a child pointer, which may or may not point to a separate list. These child lists may have one or more children of their own, and so on, to produce a multilevel data structure, as shown in the below figure. You are given the head of the first level of the list. Flatten the list so that all the nodes appear in a single-level linked list. You need to flatten the list in a way that all nodes at first level should come first, then nodes of the second level, and so on.

example

                FIGURE 1

Input for the above list is:
10 5 12 7 11 -1 4 20 13 -1 -1 -1 17 6 -1 -1 -1  2 -1 16 -1 9 8 -1 -1 -1 3 -1 19 15 -1 -1 -1 -1 -1
Problem approach

PROGRAM:

Node*merge(Node*a,Node*b){//a=root b=root ka right wala
if(a==NULL)return b;
if(b==NULL)return a;
Node*res;
if(a->datadata)
{
res=a;
res->bottom=merge(a->bottom,b);
}
else{
res=b;
res->bottom=merge(a,b->bottom);
}
res->next=NULL;
return res;
}
Node *flatten(Node *root)
{
if(root==NULL || root->next==NULL)return root;
return merge(root,flatten(root->next));
}

Try solving now
03
Round
Easy
Video Call
Duration25 minutes
Interview date17 Dec 2021
Coding problem2

It was late evening and happened in a very smooth way.

1. OS based question

Ques: What is thread in OS?(try to give it with explanation).

Problem approach

Ans: Thread is a path of execution that is composed of a program counter, thread id, stack, and set of registers within the process. It is a basic unit of CPU utilization that makes communication more effective and efficient, enables utilization of multiprocessor architectures to a greater scale and greater efficiency, and reduces the time required in context switching. It simply provides a way to improve and increase the performance of applications through parallelism. Threads are sometimes called lightweight processes because they have their own stack but can access shared data.

Multiple threads running in a process share: Address space, Heap, Static data, Code segments, File descriptors, Global variables, Child processes, Pending alarms, Signals, and signal handlers.
 

2. OS based Question

ques:What do you mean by FCFS?(give answer with real life example)
 

Problem approach

Ans: FCFS (First Come First Serve) is a type of OS scheduling algorithm that executes processes in the same order in which processes arrive. In simple words, the process that arrives first will be executed first. It is non-preemptive in nature. FCFS scheduling may cause the problem of starvation if the burst time of the first process is the longest among all the jobs. Burst time here means the time that is required in milliseconds by the process for its execution. It is also considered the easiest and simplest OS scheduling algorithm as compared to others. Implementation of FCFS is generally managed with help of the FIFO (First In First Out) queue

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
12649 views
2 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Microsoft
5983 views
5 comments
0 upvotes