i
Amazon
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
Clear (1)
I was interviewed in Nov 2020.
Round duration - 150 minutes
Round difficulty - Medium
The round began at 3:00 PM. It was an online coding round with four sections. We were not allowed to shuffle between the sections. The sections were :-
1. Logical Reasoning and Verbal Ability for around 35 minutes
2. Debugging for 15 minutes
3. Coding for 50 minutes
4. Behavorial (like a pscycometric test) for 50 minutes.
Given an array of integers ARR
of length N
and an integer Target
, your task is to return all pairs of elements such that they add up to the Target
.
The first line ...
Given an array of integers and a target, find all pairs of elements that add up to the target.
Iterate through the array and for each element, check if the complement (target - current element) exists in a hash set.
If the complement exists, add the pair to the result. If not, add the current element to the hash set.
Handle cases where the same element is used twice in a pair.
Return (-1, -1) if no pair is found.
You are provided with two sorted linked lists. Your task is to merge them into a single sorted linked list and return the head of the combined linked list.
...Merge two sorted linked lists into a single sorted linked list without using additional space.
Create a dummy node to start the merged list
Compare the values of the two linked lists and add the smaller value to the merged list
Move the pointer of the merged list and the pointer of the smaller value list
Continue this process until one of the lists is fully traversed
Append the remaining elements of the other list to the me
Round duration - 60 minutes
Round difficulty - Hard
The round began at 1:00 PM. It was a video call by the technical expert of the company. It was a DS&Algo round. The interviewer was friendly and helped me walk through the problem set. Overall a very lively interaction with quality questions.
You are provided with an unsorted array/list ARR
of N
integers. Your task is to determine the length of the longest consecutive sequence present in the array...
Find the length of the longest consecutive sequence in an unsorted array.
Iterate through the array and store all elements in a set for constant time lookup.
For each element, check if it is the start of a sequence by looking for previous consecutive elements in the set.
Update the length of the current consecutive sequence and track the maximum length found so far.
Return the maximum length as the result.
Given a Binary Search Tree (BST) and a target value, determine if there exists a pair of node values in the BST whose sum equals the target value.
4 2...
Given a BST and a target value, find if there exists a pair of node values in the BST whose sum equals the target.
Traverse the BST in-order to get a sorted array of node values.
Use two pointers approach to find if there exists a pair summing up to the target value.
Consider edge cases like negative numbers and duplicates in the BST.
Round duration - 65 minutes
Round difficulty - Hard
The round was scheduled in the evening on the same day at 6:00 PM. The interviewer was different this time. The overall environment of the interview was good. I felt comfortable and things were more on a smoother pace in this interview.
You are given 'N' ropes, each of varying lengths. The task is to connect all ropes into one single rope. The cost of connecting two ropes is the sum of their lengths. Yo...
Given 'N' ropes of varying lengths, find the minimum cost to connect all ropes into one single rope.
Sort the lengths of ropes in ascending order.
Keep connecting the two shortest ropes at each step.
Add the cost of connecting the two ropes to the total cost.
Repeat until all ropes are connected.
Return the total cost as the minimum cost to connect all ropes.
Determine the zigzag level order traversal of a given binary tree's nodes. Zigzag traversal alternates the direction at each level, starting from left to rig...
Zigzag level order traversal of a binary tree alternating directions at each level.
Use a queue to perform level order traversal of the binary tree.
Maintain a flag to alternate the direction of traversal at each level.
Store nodes at each level in separate lists and reverse the list if traversal direction is right to left.
Tip 1 : Practice standard Data Structures Questions
Tip 2 : Should have command over the topics on your resume.
Tip 3 : Knowledge of the latest technology domains
Tip 1 : Having good projects with proper knowledge about them
Tip 2 : Relevant skill set as demanded by the company for the job description.
I was interviewed in Nov 2020.
Round duration - 145 Minutes
Round difficulty - Easy
the online round was conducted around 5 pm. Round 1 was the initial online round. It was made up of 4 sections - a code debugging section (20 minutes), a coding test (70 minutes), a workstyles assessment (20 minutes) and a reasoning ability section (35 minutes). For me the level of this online test was way below standard. Code debugging and aptitude part were very very easy. The coding questions that I got were also easy but there were a couple of good questions that other students got. But overall, the level was easy. I think the selection was made totally based on the workstyle assessment. Amazon focuses largely on its 14 leadership principles. Make sure to incorporate these principles in your answers. Again, do not start lying blatantly. Make smart and well thought out lies.
Given two binary trees, T and S, determine whether S is a subtree of T. The tree S should have the same structure and node values as a subtree of T.
Given two binary trees T and S, determine if S is a subtree of T with the same structure and node values.
Traverse both trees and check if S is a subtree of T at each node
Use recursion to compare subtrees
Handle edge cases like empty trees or null nodes
You are given an N * N matrix of integers where each row and each column is sorted in increasing order. Your task is to find the positi...
Given a sorted N * N matrix, find the position of a target integer 'X'.
Iterate over rows and columns to search for the target integer 'X'.
Utilize the sorted nature of the matrix to optimize the search process.
Return the position of 'X' if found, else return '-1 -1'.
Round duration - 120 minutes
Round difficulty - Easy
This was the first technical interview. This is where it started to feel like Amazon. At first the interviewer gave his introduction, then I introduced myself and afterwards we moved to the coding part. He gave me three questions out of which I coded the solution for two and gave the approach for the third one. He was so helpful throughout the entire interview. I was stuck at the first questions and speaking out loud helped me there as he instantly realized what mistake I was making and quickly pointed it out. Out of all the interviews it was my best experience so far. For technical interviews at amazon you will have to prepare everything as they asked questions on almost all data structures. So, I would suggest you to do as much questions on leetcode as possible. Medium level questions would be enough according to me no need to do a lot of high-level questions. But if you are associated with pep coding then just do the class questions sincerely and you are good to go. Also, one thing I would like to add is to make sure that the variable names that you use are meaningful. Both my interviewers were very satisfied with my code and one of them even thanked me for writing clean code.
You are provided with an array A
containing N
integers. Your task is to determine the maximum element in every contiguous subarray of size K
as you move from left to rig...
Find maximum element in every contiguous subarray of size K in an array.
Iterate through the array and maintain a deque to store the indices of elements in decreasing order.
Remove indices from the deque that are outside the current window of size K.
The front of the deque will always have the index of the maximum element in the current window.
You are given an array/list CHOCOLATES
of size 'N', where each element represents the number of chocolates in a packet. Your task is to distribute these chocolates among 'M'...
Distribute chocolates among students to minimize difference between largest and smallest packets.
Sort the array of chocolates packets.
Use sliding window technique to find the minimum difference between packets distributed to students.
Return the minimum difference as the output.
Given a string 'STR' composed of lowercase English letters, identify the character that repeats first in terms of its initial occurrence.
STR =...
Find the first repeated character in a given string of lowercase English letters.
Iterate through the string and keep track of characters seen so far.
Return the first character that repeats, not just the first repeating character.
If no repeating character is found, return '%'.
Round duration - 90 Minutes
Round difficulty - Medium
This was the second technical round. In this round the emphasis was on time and space complexities. Luckily, I again got a very friendly interviewer who helped me a lot during the interview. The interview started with the introductions then we discussed about one of my projects. I was given only one question to solve which I did with the help of interviewer. There is not much difference between the technical round except the slightly greater emphasis on complexities in the second round.
Given a 'Snake and Ladder' board with N rows and N columns, where positions are numbered from 1 to (N*N) starting from the bottom left, alternating direction each row, f...
Find the minimum number of dice throws required to reach the last cell on a 'Snake and Ladder' board.
Use Breadth First Search (BFS) algorithm to find the shortest path on the board.
Keep track of visited cells and the number of dice throws required to reach each cell.
Consider the presence of snakes and ladders while calculating the next possible moves.
Return -1 if the last cell is unreachable.
Tip 1 : I believe for cracking interviews data structures and algorithms is the only thing that needs to be practiced.
Tip 2 : Rather than focusing on the number of questions focus on the quality of questions and different approaches for same question.
Tip 3 : The company wants to measure your problem solving skills not the number of submissions you have made on different platforms.
Tip 1 : Make sure there are no grammatical errors.
Tip 2 : Whatever projects you are listing on your resume, make sure you have in depth knowledge about those projects even if they are borrowed from somewhere else.
I was interviewed in Nov 2020.
Round duration - 90 minutes
Round difficulty - Medium
Timing (6pm - 8pm)
Environment was user friendly
As usual the online round had two coding questions and 20 MCQs. This was a pretty easy round and it’s duration was 90 minutes. The round consisted of questions from various domains like Algorithm, Data Structure, Operating System and Aptitude.
A few days after appearing in this round, I was informed that I have been qualified for the next round.
Given an array composed of N elements, your task is to identify a subsequence with exactly three elements where these elements maintain a strictly increasin...
Identify a subsequence of size 3 with strictly increasing order in an array.
Iterate through the array and keep track of the smallest and second smallest elements encountered so far.
If a third element greater than both is found, return the subsequence.
Handle edge cases where no valid subsequence exists.
Given two arbitrary binary trees, your task is to determine whether these two trees are mirrors of each other.
Two trees are considered mirror of each other if...
Check if two binary trees are mirrors of each other based on specific criteria.
Compare the roots of both trees.
Check if the left subtree of the first tree is the mirror of the right subtree of the second tree.
Verify if the right subtree of the first tree is the mirror of the left subtree of the second tree.
Round duration - 90 minutes
Round difficulty - Medium
Timing (10 am- 11 am)
For this round I had slightly more time than the last, due to the fact that the weekend fell in between.The interviewer was very very cool and helping this time, something which I kept at the last in my list of probable things that can happen during an interview. Duration of this round was around 90 minutes.
This time I had to face three technical questions and one general question on Amazon.
Given a Binary Search Tree of integers, transform it into a Greater Sum Tree where each node's value is replaced with the sum of all node values gr...
Convert a Binary Search Tree to a Greater Sum Tree by replacing each node's value with the sum of all node values greater than the current node's value.
Traverse the BST in reverse inorder (right, root, left) to visit nodes in descending order.
Keep track of the running sum of visited nodes and update each node's value with this sum.
Modify the BST in place without creating a new tree.
Example: For input 11 2 29 1 7 15 40 ...
Help the Ultimate Ninja Ankush by determining how many groups of sizes 2 and 3 can be formed from a given list of integers such that the sum of each group is divisible by 3.
Count the number of groups of sizes 2 and 3 with sum divisible by 3 from a given list of integers.
Iterate through the array and check all possible combinations of 2 and 3 integers.
For each combination, check if the sum is divisible by 3.
Keep track of the valid groups and return the count at the end.
Tip 1 : Do atleast 3 major web dev project
Tip 2 : Practice from interview bit
Tip 1 : Resume should not be more than 1 page
Tip 2 : Be precise
What people are saying about Amazon
I was interviewed in Oct 2020.
Round duration - 75 minutes
Round difficulty - Easy
This online assessment comprised of 30 questions with 2 coding questions and 28 MCQs.
Coding Questions:
It was one of the most common Dynamic Programming problems: Longest decreasing sub-sequence.
It was an easy question that needed us to find out the mean, median and mode in an array.
The MCQs were difficult that required good understanding of Computer fundamentals.
Determine if the third string contains all the characters from both the first and second strings in any order. If so, return "YES"; otherwise, return "NO".
Line ...
Check if the third string contains all characters from the first and second strings in any order.
Create a frequency map for characters in the first and second strings.
Check if the frequency of characters in the third string matches the frequency map of the first and second strings.
Return 'YES' if all characters are present in the third string, otherwise return 'NO'.
Given a string S
of length N
and an integer K
, find the length of the longest substring that contains at most K
distinct characters.
The first...
Find the length of the longest substring with at most K distinct characters in a given string.
Use a sliding window approach to keep track of the characters and their counts within the window.
Maintain a hashmap to store the characters and their frequencies.
Update the window size and characters count as you iterate through the string.
Return the maximum window size encountered for each test case.
Round duration - 35 minutes
Round difficulty - Easy
It was a telephonic call that lasted for about half an hour.
You are provided with a string STR
of length N
. The goal is to identify the longest palindromic substring within this string. In cases where multiple palind...
Given a string, find the longest palindromic substring, prioritizing the one with the smallest start index.
Iterate through each character in the string and expand around it to find palindromes
Keep track of the longest palindrome found so far
Return the longest palindromic substring with the smallest start index
Round duration - 40 minutes
Round difficulty - Medium
The round was a video call and I was asked to share my screen to avoid any cheating cases.
You are given a non-empty grid that consists of only 0s and 1s. Your task is to determine the number of islands in this grid.
An island is defined as a group of 1s (re...
The task is to determine the number of islands in a grid of 0s and 1s connected horizontally, vertically, or diagonally.
Iterate through the grid and perform depth-first search (DFS) to find connected 1s forming islands.
Mark visited cells to avoid counting the same island multiple times.
Count the number of islands found during DFS traversal.
Handle edge cases like out of bounds indices and already visited cells.
Example: ...
Tip 1 : Do atleast 3 major web dev project
Tip 2 : Practice from interview bit
Tip 1 : Keep it short, one or two page max.
Tip 2 : Attach competitive profiles url.
Amazon interview questions for designations
I was interviewed in Oct 2020.
Round duration - 135 minutes
Round difficulty - Medium
Round 1- The online round had 4 sections:
1) Code Debugging Section: 7 questions to be debugged in 20 minutes (C/C++/Java)
2) Coding questions: There were 2 coding questions
3) Workstyle and Behavioural assessment: 20 minutes
4) Reasoning Ability: 35 minutes (easy-medium)(Aptitude and Logical Reasoning Questions)
Determine if the second string STR2
can be constructed using characters from the first string STR1
. Both strings may include any characters.
The first line contains an i...
Check if second string can be formed using characters from the first string.
Iterate through each character in STR2 and check if it exists in STR1.
Use a hashmap to store the frequency of characters in STR1 for efficient lookup.
Return 'YES' if all characters in STR2 are found in STR1, otherwise return 'NO'.
You are given an N * N matrix of integers where each row and each column is sorted in increasing order. Your task is to find the positi...
Given a sorted N * N matrix, find the position of a target integer 'X'.
Iterate over rows and columns to search for the target integer 'X'.
Utilize the sorted nature of the matrix to optimize the search process.
Return the position of 'X' if found, else return '-1 -1'.
Round duration - 75 minutes
Round difficulty - Medium
It was a technical round. The interviewer mainly focused on Data Structures and Algorithms and asked me a few questions on operating systems.
Given an array ARR
of size N
and an integer K
, determine the number of distinct elements in every K-sized window of the array. A 'K' sized window is defi...
Implement a function to count distinct elements in every K-sized window of an array.
Use a sliding window approach to keep track of distinct elements in each window
Use a hashmap to store the frequency of elements in the current window
Update the hashmap as you slide the window to the right and maintain the count of distinct elements
Return the count of distinct elements for each window as an array
You are provided with two sorted linked lists. Your task is to merge them into a single sorted linked list and return the head of the combined linked list.
...Merge two sorted linked lists into a single sorted linked list with linear time complexity and constant space usage.
Create a dummy node to start the merged list
Compare the nodes of the two lists and link them accordingly
Move the pointer to the next node in the merged list
Handle cases where one list is empty or both lists are empty
Return the head of the merged list
Tip 1 : Practice Atleast 300 Problems from LeetCode and GeeksforGeeks(GFG).
Tip 2 : Don't ignore subjects like Operating Systems, Computer Networks, and Database Management Systems.
Tip 3 : Be well prepared with your projects.
Tip 1 : Mention all the projects in your resume.
Tip 2 : Make Sure that your resume is simple and also try to fit all the information in only one page.
Get interview-ready with Top Amazon Interview Questions
I was interviewed in Sep 2020.
Round duration - 145 minutes
Round difficulty - Easy
The online assessment consisted of four components, a code debugging section (20 minutes), a coding test (70 minutes), a workstyles assessment (20 minutes) and a reasoning ability section (35 minutes). Code debugging questions were pretty simple and straightforward. The coding test consisted of 2 questions, first was similar to two Sum problem. Second question was similar to find the critical edges in a graph. The workstyles assessment section contained certain behavioural questions.
Reasoning ability section consisted of aptitude questions. This round was basically to check the problem solving skills of the candidate.
Given an array of integers ARR
of length N
and an integer Target
, your task is to return all pairs of elements such that they add up to the Target
.
The first line ...
Given an array of integers and a target, find all pairs of elements that add up to the target.
Iterate through the array and for each element, check if the difference between the target and the element exists in a hash set.
If it exists, then print the pair (element, target-element), else add the element to the hash set.
If no pair is found, print (-1, -1).
In an undirected graph consisting of V
vertices and E
edges, your task is to identify all the bridges within the graph. A bridge is an edge which, when removed, result...
Identify bridges in an undirected graph by finding edges that, when removed, increase the number of connected components.
Use depth-first search (DFS) to find bridges in the graph.
Keep track of discovery time and low time for each vertex during DFS.
An edge (u, v) is a bridge if low[v] > disc[u].
Sort and print the bridge pairs in ascending order of vertices.
Example: If the input graph has vertices 0, 1, 2, 3, 4 and ed...
Round duration - 60 minutes
Round difficulty - Medium
I was asked two coding questions. First question was related to binary tree and second question was to implement LRU cache.
I had to code both questions. The interviewer asked me the time and space complexity for both the questions.
Given a circular array ARR
of size N
consisting of positive and negative integers, determine if there is a cycle present in the array. You can make movements based on...
Determine if a circular array has a cycle present, following specific movement rules.
Iterate through the array and check for cycles following the given movement rules.
Keep track of visited indices to detect cycles.
Handle both clockwise and counterclockwise movements separately.
Return 'True' if a cycle is found, 'False' otherwise.
Design and implement a Least Recently Used (LRU) cache data structure, which supports the following operations:
get(key)
- Return the value of the key if it exists in the cach...Implement a Least Recently Used (LRU) cache data structure with get and put operations.
Use a combination of a hashmap and a doubly linked list to efficiently implement the LRU cache.
Keep track of the least recently used item and update it accordingly when inserting new items.
Ensure to handle the capacity constraint by evicting the least recently used item when the cache is full.
For get operation, return the value of th
Round duration - 60 minutes
Round difficulty - Medium
I was asked two coding questions and some conceptual questions about priority heap data structure. I was able to code the optimized approach for the first question. But second question was a little tricky for me as I had never heard it before. But I explained my approach confidently. The interviewer also helped me and finally I was able to code it.
Given 'N' ropes, each having different lengths, your task is to connect these ropes into one single rope. The cost to connect two particular ropes is equal to the sum of th...
Connect ropes with different lengths into one single rope with minimum cost by merging the smallest ropes first.
Sort the lengths of ropes in ascending order.
Merge the two smallest ropes at each step to minimize cost.
Keep track of the total cost as you merge the ropes.
Repeat the merging process until all ropes are connected.
Return the total cost as the minimum cost to connect all ropes.
Given a positive integer N
, you are required to generate a list of integers of size 2N
such that it contains all the integers from 1 to N
, both included, twice. These in...
Generate Langford pairing for given N, return 'Valid' if correct, 'Invalid' if not.
Generate a list of integers of size 2N with all integers from 1 to N twice.
Arrange integers according to Langford pairing rules.
Return 'Valid' if pairing is correct, 'Invalid' if not.
If no valid pairing possible, return list with only -1 element.
Tip 1 : Be very clear with the basics of each topic.
Tip 2 : Be thorough with the projects mentioned in the resume.
Tip 1 : Don't lie on your resume.
Tip 2 : The number of projects on the resume does not matter, what matters is that you must be thorough with your projects.
I was interviewed in Oct 2020.
Round duration - 75 minutes
Round difficulty - Hard
This round was scheduled in the evening hours and all the participants were required to fill a form which was shared 15 minutes prior to the start of the online coding round. This form was filled out probably for the security reasons and to ensure that no one disinterested participant gives the test.
You are provided with a string STR
of length N
. The goal is to identify the longest palindromic substring within this string. In cases where multiple palind...
Given a string, find the longest palindromic substring, prioritizing the one with the smallest start index.
Iterate through the string and expand around each character to find palindromes
Keep track of the longest palindrome found so far
Return the longest palindrome with the smallest start index
Given a string STR
consisting only of lowercase letters, your task is to modify the string by replacing the minimum characters such that the string doesn’t con...
The task is to modify a string by replacing minimum characters to remove all palindromic substrings.
Identify palindromic substrings in the given string
Replace characters in the string to remove palindromic substrings
Count the minimum number of characters replaced
Tip 1 : Have a good command over dsa.
Tip 2 : Practice regularly on Geeksforgeeks and coding ninjas.
Tip 1 : Mention link to your coding profiles
Tip 2 : Resume should not be more than one page
I was interviewed in Oct 2020.
Round duration - 120 Minutes
Round difficulty - Medium
Round started at 6pm in the evening and had 4 sections.
Given a matrix 'MAT'
of size 'N' * 'M'
, where 'N'
is the number of rows and 'M'
is the number of columns. A cell with value '0'
represents it is initially on fire (at t...
Given a matrix representing cells on fire or safe, determine if a person can reach an escape cell without stepping on fire.
Check if the person can move to adjacent safe cells without stepping on fire
If the person can reach an escape cell, return the time taken; otherwise, return -1
Consider the constraints and note that escape cells are on matrix boundaries
You are given an N * N matrix of integers where each row and each column is sorted in increasing order. Your task is to find the positi...
Given a sorted N * N matrix, find the position of a target integer 'X'.
Iterate over each row and column to search for the target integer 'X'.
Utilize the sorted nature of the matrix to optimize the search process.
Return the position of 'X' if found, else return '-1 -1'.
Round duration - 78 minutes
Round difficulty - Medium
The round started at 11 am and was conducted on amazon chime, They provided me a link to live sheet where I had to write all the code. Interviewer was very good at conducting a smooth interview and provided me small hints as I got stuck at some points.
Nobita wants to impress Shizuka by correctly guessing her lucky number. Shizuka provides a sorted list where every number appears twice, except for her lucky number, which a...
Find the unique element in a sorted array where all other elements appear twice.
Iterate through the array and XOR all elements to find the unique element.
Use a hash set to keep track of elements and find the unique one.
Sort the array and check adjacent elements to find the unique one.
Given a binary tree of integers, return the level order traversal of the binary tree.
The first line contains an integer 'T', representing the number of te...
Level order traversal of a binary tree is returned for each test case.
Implement a function to perform level order traversal of a binary tree
Use a queue data structure to keep track of nodes at each level
Print the node values in level order traversal
Round duration - 60 Minutes
Round difficulty - Medium
The round started at 4pm and was conducted on amazon chime, They provided me a link to live sheet where I had to write all the code.
You are provided with an array of integers 'ARR' consisting of 'N' elements. Each integer is within the range [1, N-1], and the array contains exactly one duplica...
Identify the duplicate element in an array of integers.
Iterate through the array and keep track of the frequency of each element using a hashmap.
Return the element with a frequency greater than 1 as the duplicate.
Time complexity can be optimized to O(N) using Floyd's Tortoise and Hare algorithm.
Example: For input [3, 1, 3, 4, 2], the output should be 3.
Tip 1 : Complete all previously asked questions before sitting in the Interview, also try to find recently asked questions by the company in other colleges.
Tip 2 : Practice Consistently as it requires a lot of patience to develop good thinking abilities
Tip 3 : Give not more than a hour to a question and solve questions with diverse concepts.
Tip 1 : Be concise, donot explain working of your projects there just give name and a line of description about projects.
Tip 2 : Only write what you know in the resume, false resume leads to unexpected questions.
I was interviewed in Sep 2020.
Round duration - 90 Minutes
Round difficulty - Medium
This round consisted of 20 MCQs and 2 coding problems. All the MCQs were from OOPs, DBMS & Algo, and aptitude. I solved all the questions in the given time. First coding question was of dynamic programming and second was of arrays. 20 students got shortlisted out of 134.
You are given a long type array/list ARR
of size N
, representing an elevation map. The value ARR[i]
denotes the elevation of the ith
bar. Your task is to determine th...
Calculate the total amount of rainwater that can be trapped between given elevations in an array.
Iterate through the array and calculate the maximum height on the left and right of each bar.
Calculate the amount of water that can be trapped at each bar by taking the minimum of the maximum heights on the left and right.
Sum up the trapped water at each bar to get the total trapped water for the entire array.
Given a sorted array that has been rotated clockwise by an unknown amount, you need to answer Q
queries. Each query is represented by an integer Q[i]
, and you must ...
Search for integers in a rotated sorted array efficiently.
Use binary search to efficiently search for each query in the rotated sorted array.
Keep track of the mid element and adjust the search based on the rotation.
Return the index of the query if found, else return -1.
Round duration - 60 Minutes
Round difficulty - Easy
The interviewer was really nice and supportive. After a short introduction, we went on to problem solving. He started with a easy question (as a warm up, I think). I coded and explained it in ~5 minutes. Then, he asked me another question, it would probably be medium level. I came up with a greedy solution using priority queue, explained, coded and tested it. We had some time left, so he asked me a follow up question. I was able to answer it, but I had no time left to code it. After that, I had a few minutes to ask any questions.
Given an array of N
non-empty words and an integer K
, return the K
most frequent words sorted by their frequency from highest to lowest.
N = 6, K...
Return the K most frequent words from an array of words sorted by frequency.
Use a hashmap to store word frequencies.
Use a priority queue to keep track of the K most frequent words.
Sort the words in the priority queue based on frequency and lexicographical order.
Return the K most frequent words from the priority queue.
Tip 1 : Practice as many questions as you can.
Tip 2 : OOPs concepts are really important.
Tip 3 : Write atleast 2 good projects on resume.
Tip 1 : Only write what you know. They can easily catch lies.
Tip 2 : 1 page resume is good. Don't include more than one page is you are fresher.
I was interviewed in Sep 2020.
Round duration - 215 minutes
Round difficulty - Medium
* Debugging(C, C++, Java, Python) [Time given was quite enough.]
* Coding(Any programming language was allowed. 2 coding questions medium to difficult level 70 mins)
* Psychometric test based on Leadership principle — Don’t take it for granted. I would suggest to pay attention while
answering to this as well.
* Aptitude and Logical reasoning (Good enough time was given.)
You are given an integer 'N'. Your task is to print a specific pattern for the given number of rows 'N'.
The first line contains a single integer ‘T’ repres...
Print a specific pattern of '1's for a given number of rows 'N'.
Read the number of test cases 'T'
For each test case, read the number of rows 'N'
Print '1' repeated i times for each line i from 1 to N
Given an array of integers ARR
of length N
and an integer Target
, your task is to return all pairs of elements such that they add up to the Target
.
The first line ...
Given an array of integers and a target, find all pairs of elements that add up to the target.
Iterate through the array and for each element, check if the complement (target - current element) exists in a hash set.
If the complement exists, add the pair to the result. Otherwise, add the current element to the hash set.
Handle cases where the same element is used twice in a pair.
Return (-1, -1) if no pair is found.
Round duration - 60 minutes
Round difficulty - Medium
(Time — 5.30 p.m.): I introduced myself. My interviewer told me that he would divide the interview into three phases.
Phase 1- Introduction and questions on life instances where I proved my efficiency. (barely 10 minutes, I answered well.)
Phase 2- Data Structures’ Understanding and questions related to it. (Hashing concept and complete conceptual details about it. Internal working, collisions, how to avoid them etc.) (15 minutes, He was satisfied with my answers. Don’t just answer. Explain !)
Given a string Str
consisting of N
lowercase Latin letters, you need to determine the longest substring without repeating characters.
A substring is defined as ...
Given a string, find the longest substring without repeating characters.
Use a sliding window approach to keep track of the longest substring without repeating characters.
Use a hashmap to store the index of each character as it appears in the string.
Update the start index of the window when a repeating character is found.
Keep track of the longest substring length and its starting index.
Return the substring starting from...
Round duration - 70 minutes
Round difficulty - Hard
(Time — 7.00 p.m.): I introduced myself. The interviewer directly jumped onto the questions. He asked me two questions. The first question he asked me was: Coding Question
Given a string S
of length N
and an integer K
, find the length of the longest substring that contains at most K
distinct characters.
The first...
Find the length of the longest substring with at most K distinct characters in a given string.
Use a sliding window approach to keep track of the characters and their counts within the window.
Maintain a hashmap to store the characters and their frequencies.
Update the window size and characters count as you iterate through the string.
Return the maximum window size encountered for each test case.
Given a positive integer N
, compute the total number of '1's in the binary representation of all numbers from 1 to N. Return this count modulo 1e9+7 because the result can...
Count the total number of set bits in the binary representation of numbers from 1 to N modulo 1e9+7.
Use bitwise operations to count the set bits in each number from 1 to N.
Consider using dynamic programming to optimize the solution.
Remember to return the count modulo 1e9+7 to handle large results.
Tip 1 : Focus on medium and hard questions. Solving a lot of easy questions doesn't help.
Tip 2 : Start with the basics if you have lost touch with competitive coding. Don't directly jump to interview questions.
Tip 3 : Create a timetable and set goals. Keep aside 3-4 hours for studying. Consistency is the key.
Tip 1 : Keep it clean and simple.
Tip 2 : You should have good projects to showcase
Some of the top questions asked at the Amazon Software Developer Intern interview -
The duration of Amazon Software Developer Intern interview process can vary, but typically it takes about less than 2 weeks to complete.
based on 40 interviews
3 Interview rounds
based on 91 reviews
Rating in categories
Customer Service Associate
4.2k
salaries
| ₹0 L/yr - ₹0 L/yr |
Transaction Risk Investigator
3.1k
salaries
| ₹0 L/yr - ₹0 L/yr |
Associate
2.8k
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Associate
2.5k
salaries
| ₹0 L/yr - ₹0 L/yr |
Program Manager
2.1k
salaries
| ₹0 L/yr - ₹0 L/yr |
Flipkart
TCS
Netflix