i
Amazon
Proud winner of ABECA 2025 - AmbitionBox Employee Choice Awards
Filter interviews by
Use a hashmap to separate prime and non-prime numbers in an array of strings.
Iterate through the array and convert each string to an integer.
Use a hashmap to store prime and non-prime numbers based on their divisibility.
Convert the hashmap back to separate arrays for prime and non-prime numbers.
Use two separate arrays to store prime and non-prime numbers from the input array.
Iterate through the input array and check if each element is prime or not.
Store prime numbers in one array and non-prime numbers in another array.
Maintain the order of elements in the input array while separating prime and non-prime numbers.
Count number of flips required to balance parentheses in a string
Iterate through the string and keep track of open and close brackets
If a close bracket is encountered without a corresponding open bracket, increment flip count
Return the total number of flips required to balance the parentheses
Calculate the maximum absolute difference between the sums of any two levels in a binary tree.
Traverse the binary tree level by level and calculate the sum of nodes at each level.
Keep track of the maximum absolute difference between the sums of any two levels encountered so far.
Return the maximum absolute difference found.
What people are saying about Amazon
Yes, we can use Breadth First Search (BFS) algorithm to determine if we can reach index 0 with the given operations.
Use BFS algorithm to explore all possible paths starting from index 0.
Keep track of visited indices to avoid infinite loops.
If we reach an index with value 0, return true; otherwise, return false.
Separate prime numbers from non-prime numbers in a linked list while preserving their order.
Iterate through the linked list and separate prime numbers from non-prime numbers
Create two separate linked lists for prime and non-prime numbers
Maintain the order of numbers while separating them
Example: Input: 1 -> 2 -> 3 -> 4 -> 5, Output: Prime: 2 -> 3 -> 5, Non-prime: 1 -> 4
JSP servlets were used for dynamic web page generation and server-side processing.
Used for creating dynamic web pages by embedding Java code in HTML
Facilitates server-side processing of user requests
Enables separation of presentation and business logic
Provides scalability and reusability of code
Example: Used JSP servlets to generate personalized user profiles on a website
Use a priority queue to efficiently find the k nearest points to a given robot's position.
Define the robot's position as a point (x, y).
Calculate the distance from each point to the robot using Euclidean distance.
Use a max-heap (priority queue) to keep track of the k nearest points.
If the heap exceeds size k, remove the farthest point.
Return the points in the heap as the k nearest points.
Find the first level in a complete binary tree where the height difference between left and right subtrees is more than 1.
Traverse the binary tree level by level using breadth-first search
For each level, calculate the height difference between the left and right subtrees
Return the level number when the height difference is more than 1
The number of binary strings of length N without consecutive 1s.
Use dynamic programming to solve the problem.
Create an array to store the number of valid strings for each length.
Initialize the array with base cases.
Iterate through the array and calculate the number of valid strings for each length.
Return the value at the Nth index of the array.
I appeared for an interview before Jul 2024, where I was asked the following questions.
General DSA questions
Two medium-hard leetcode questions
I applied via Referral and was interviewed before Jun 2023. There were 3 interview rounds.
Calculate the maximum absolute difference between the sums of any two levels in a binary tree.
Traverse the binary tree level by level and calculate the sum of nodes at each level.
Keep track of the maximum absolute difference between the sums of any two levels encountered so far.
Return the maximum absolute difference found.
Yes, we can use Breadth First Search (BFS) algorithm to determine if we can reach index 0 with the given operations.
Use BFS algorithm to explore all possible paths starting from index 0.
Keep track of visited indices to avoid infinite loops.
If we reach an index with value 0, return true; otherwise, return false.
Use two separate arrays to store prime and non-prime numbers from the input array.
Iterate through the input array and check if each element is prime or not.
Store prime numbers in one array and non-prime numbers in another array.
Maintain the order of elements in the input array while separating prime and non-prime numbers.
Use a hashmap to separate prime and non-prime numbers in an array of strings.
Iterate through the array and convert each string to an integer.
Use a hashmap to store prime and non-prime numbers based on their divisibility.
Convert the hashmap back to separate arrays for prime and non-prime numbers.
Separate prime numbers from non-prime numbers in a linked list while preserving their order.
Iterate through the linked list and separate prime numbers from non-prime numbers
Create two separate linked lists for prime and non-prime numbers
Maintain the order of numbers while separating them
Example: Input: 1 -> 2 -> 3 -> 4 -> 5, Output: Prime: 2 -> 3 -> 5, Non-prime: 1 -> 4
Count number of flips required to balance parentheses in a string
Iterate through the string and keep track of open and close brackets
If a close bracket is encountered without a corresponding open bracket, increment flip count
Return the total number of flips required to balance the parentheses
I applied via LinkedIn and was interviewed before Sep 2022. There were 3 interview rounds.
2 questions medium difficulty
JSP servlets were used for dynamic web page generation and server-side processing.
Used for creating dynamic web pages by embedding Java code in HTML
Facilitates server-side processing of user requests
Enables separation of presentation and business logic
Provides scalability and reusability of code
Example: Used JSP servlets to generate personalized user profiles on a website
I applied via Amazon websi and was interviewed in Aug 2020. There was 1 interview round.
DFS based question to find number of rotten tomatoes in an array of strings.
Implement DFS to traverse the array of strings
Check each element for rotten tomatoes
Keep track of the count of rotten tomatoes
Use a priority queue to efficiently find the k nearest points to a given robot's position.
Define the robot's position as a point (x, y).
Calculate the distance from each point to the robot using Euclidean distance.
Use a max-heap (priority queue) to keep track of the k nearest points.
If the heap exceeds size k, remove the farthest point.
Return the points in the heap as the k nearest points.
I applied via Naukri.com and was interviewed in Mar 2019. There were 5 interview rounds.
Find the maximum value in each sliding window of size k in an array.
Use a deque to store indices of array elements.
Maintain the deque in decreasing order of values.
Remove indices that are out of the current window.
The front of the deque always contains the index of the maximum element for the current window.
Example: For array [1,3,-1,-3,5,3,6,7] and k=3, the output is [3,3,5,5,6,7].
The number of binary strings of length N without consecutive 1s.
Use dynamic programming to solve the problem.
Create an array to store the number of valid strings for each length.
Initialize the array with base cases.
Iterate through the array and calculate the number of valid strings for each length.
Return the value at the Nth index of the array.
Find the next lexicographical permutation of a sequence of numbers.
Identify the longest non-increasing suffix.
Find the pivot just before the suffix.
Swap the pivot with the smallest number in the suffix that is larger than the pivot.
Reverse the suffix to get the next permutation.
Find the first level in a complete binary tree where the height difference between left and right subtrees is more than 1.
Traverse the binary tree level by level using breadth-first search
For each level, calculate the height difference between the left and right subtrees
Return the level number when the height difference is more than 1
I appeared for an interview before Dec 2020.
Round duration - 90 minutes
Round difficulty - Hard
This was an online coding round where we were supposed to solve 2 questions under 90 minutes . Both the questions in my set were related to Graphs and were quite tricky and heavy to implement.
Given a directed graph with a specified number of vertices V
and edges E
, your task is to calculate the total number of distinct paths from a given source node S
to all ot...
Calculate the total number of distinct paths from a given source node to all other nodes in a directed graph.
Use dynamic programming to keep track of the number of paths from the source node to each node in the graph.
Consider using modular arithmetic to handle large numbers and prevent overflow.
Start by initializing the number of paths from the source node to itself as 1.
Iterate through the edges of the graph and updat...
You are provided with a number of courses 'N', some of which have prerequisites. There is a matrix named 'PREREQUISITES' of size 'M' x 2. This matrix indicates that fo...
Given courses with prerequisites, determine a valid order to complete all courses.
Use topological sorting to find a valid order of courses.
Create a graph with courses as nodes and prerequisites as edges.
Start with courses that have no prerequisites and remove them from the graph.
Continue this process until all courses are taken or there are no valid courses left.
If there is a cycle in the graph, it is impossible to com...
Round duration - 60 Minutes
Round difficulty - Medium
This was a Data Structures and Algorithms round with some standard questions . I was expected to come up with an
efficient approach and code it as well .
You are provided with 'N' intervals, each containing two integers denoting the start time and end time of the interval.
Your task is to merge all overlapping intervals a...
Merge overlapping intervals and return sorted list of merged intervals.
Sort the intervals based on start times.
Iterate through intervals and merge overlapping intervals.
Return the merged intervals in sorted order.
Given a 2-dimensional binary matrix called Mat
of size N x M that consists solely of 0s and 1s, find the length of the longest path from a specified source cell to a destina...
Find the length of the longest path from a source cell to a destination cell in a binary matrix.
Use depth-first search (DFS) to explore all possible paths from source to destination.
Keep track of visited cells to avoid revisiting them.
Return the length of the longest path found, or -1 if no path exists.
Round duration - 50 Minutes
Round difficulty - Medium
This was also a DSA round where I was asked to code only one of the questions but I eventually ended up coding both
as I had some spare time and explained my approches very smoothly to the interviewer . This round went preety well .
Given an array of integers with 'N' elements, determine the length of the longest subsequence where each element is greater than the previous element. This...
Find the length of the longest strictly increasing subsequence in an array of integers.
Use dynamic programming to solve this problem efficiently.
Initialize an array to store the length of the longest increasing subsequence ending at each index.
Iterate through the array and update the length of the longest increasing subsequence for each element.
Return the maximum value in the array as the result.
Given a rotated sorted array ARR
of size 'N' and an integer 'K', determine the index at which 'K' is present in the array.
1. If 'K' is not present...
Given a rotated sorted array, find the index of a given integer 'K'.
Use binary search to find the pivot point where the array is rotated.
Then perform binary search on the appropriate half of the array to find 'K'.
Handle cases where 'K' is not present in the array by returning -1.
Round duration - 50 Minutes
Round difficulty - Medium
This was also a DSA round with 2 questions of Medium to Hard difficulty . I was expected to follow some clean code and OOPS principles to write the code in this round .
Given an array of integers ARR
and an integer K
, determine the rank of the element ARR[K]
.
The rank of any element in ARR
is defined as the number of elem...
Given an array and an index, find the number of elements smaller than the element at that index appearing before it in the array.
Iterate through the array up to index K and count the number of elements smaller than ARR[K].
Return the count as the rank of ARR[K].
Handle edge cases like empty array or invalid index K.
Design a data structure for a Least Recently Used (LRU) cache that supports the following operations:
1. get(key)
- Return the value of the key if it exists in the cache; otherw...
Design a Least Recently Used (LRU) cache data structure that supports get and put operations with capacity constraint.
Implement a doubly linked list to maintain the order of recently used keys.
Use a hashmap to store key-value pairs for quick access.
Update the order of keys in the linked list on get and put operations.
Evict the least recently used key when the cache reaches its capacity.
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.
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.
I applied via Naukri.com and was interviewed before Nov 2020. There were 3 interview rounds.
Some of the top questions asked at the Amazon Software Development Engineer interview for experienced candidates -
The duration of Amazon Software Development Engineer interview process can vary, but typically it takes about less than 2 weeks to complete.
based on 6 interview experiences
Difficulty level
Duration
based on 140 reviews
Rating in categories
Customer Service Associate
4.2k
salaries
| ₹1.8 L/yr - ₹5 L/yr |
Transaction Risk Investigator
3.1k
salaries
| ₹2.4 L/yr - ₹6.5 L/yr |
Associate
3.1k
salaries
| ₹2 L/yr - ₹5.5 L/yr |
Senior Associate
2.6k
salaries
| ₹4 L/yr - ₹9 L/yr |
Software Developer
2.4k
salaries
| ₹23.7 L/yr - ₹44 L/yr |
Flipkart
TCS
Netflix