i
Amazon
Proud winner of ABECA 2025 - AmbitionBox Employee Choice Awards
Filter interviews by
You are provided with a directory path in Unix-style notation, and your task is to simplify it according to given rules.
In a Unix-style file system:
The task is to simplify a given Unix-style directory path and determine the final destination.
Replace multiple slashes with a single slash
Handle dot (.) by ignoring it
Handle double dot (..) by removing the previous directory from the path
Ensure the simplified path starts with a slash and does not have a trailing slash
Given a sorted array ARR
and a number X
, your task is to determine the count of occurrences of X
within ARR
.
X
is not found in the array, return ...The task is to count the number of occurrences of a given number in a sorted array.
Use binary search to find the first and last occurrence of the given number in the array.
Subtract the indices of the first and last occurrence to get the count.
Handle the case when the number is not found in the array.
You are provided with an integer array ARR
of length 'N'. Your objective is to determine the first missing positive integer using linear time and constant space. Th...
The task is to find the lowest positive integer that does not exist in the given array of integers.
Iterate through the array and mark the positive integers as visited using the array indices.
Iterate through the marked array and return the index of the first unmarked element.
If all positive integers are marked, return the length of the array + 1 as the missing positive integer.
You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to find and return a list of all pairs of elements where each sum of a pair equals 'S'.
...
Given an array and a target sum, find all pairs of elements in the array that add up to the target sum.
Create an empty list to store the pairs
Iterate through the array and for each element, check if there is a complement (target sum minus the current element) in the array
If a complement is found, add the pair (current element, complement) to the list
Sort the list of pairs in non-decreasing order of their first val...
What people are saying about Amazon
Given a sequence of 'N' space-separated non-negative integers A[1], A[2], ..., A[i], ..., A[n], where each number in the sequence represents the height of a line...
Given a sequence of non-negative integers representing the height of lines on a cartesian plane, find two lines that form a container with the maximum area of water.
Use two pointers approach to find the maximum area
Start with the widest container and gradually move the pointers towards each other
Calculate the area at each step and update the maximum area
The area is calculated as the minimum height of the two lines...
You are given a country called 'Ninjaland' with 'N' states, numbered from 1 to 'N'. These states are connected by 'M' bidirectional roads, each with a specified travel cost. The...
The task is to select 'N' - 1 roads in a country with 'N' states, such that the tourist bus can travel to every state at least once at minimum cost.
The problem can be solved using a minimum spanning tree algorithm, such as Kruskal's algorithm or Prim's algorithm.
Create a graph representation of the country using the given roads and their costs.
Apply the minimum spanning tree algorithm to find the minimum cost road...
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; otherwi...
Design a Least Recently Used (LRU) cache data structure that supports get and put operations with capacity constraint.
Use a combination of a doubly linked list and a hashmap to efficiently implement the LRU cache.
Maintain a doubly linked list to keep track of the order of keys based on their recent usage.
Use a hashmap to store key-value pairs for quick access and update operations.
When a key is accessed or updated...
In a network with 'N' system nodes, identified from 0 to N-1, and 'M' connections, determine all critical connections. A connection is critical if its removal disrupts...
Implement a function to find critical connections in a network with system nodes and connections.
Create an adjacency list to represent the network connections.
Use Tarjan's algorithm to find critical connections in the network.
Output the count of critical connections and the pairs of nodes involved.
Handle multiple test cases efficiently.
Ensure that the removal of a critical connection disrupts network connectivity.
Ninja has studied the bitwise operations ‘AND’ and ‘XOR’. He received an assignment that involves these operations and needs help to complete it efficiently before t...
Calculate bitwise 'AND' and 'XOR' of subarrays of size at most K in an array efficiently.
Iterate through all subarrays of size at most K and calculate bitwise 'AND'.
Calculate the 'XOR' of all the bitwise 'AND' results to get the final output.
Optimize the solution to handle large input sizes efficiently.
You are provided with an integer array ARR
of size N
. You need to return an array PRODUCT
such that PRODUCT[i]
equals the product of all the elements of ARR
e...
Return an array of products of all elements in an array except the current element.
Iterate through the array twice to calculate the product of all elements to the left and right of each element.
Use two arrays to store the products of elements to the left and right of each element.
Multiply the corresponding elements from the left and right product arrays to get the final product array.
I applied via LinkedIn and was interviewed in Sep 2024. There were 2 interview rounds.
Easy Questions- Can be done with decent practice
Coding test had 2 medium level coding questions
I applied via Approached by Company and was interviewed in Aug 2024. There were 2 interview rounds.
2 coding questions of easy to medium difficulty
Sliding window problem where you can only pick fruits from two different baskets
Use a sliding window approach to keep track of the maximum number of fruits in two baskets
Keep track of the types of fruits and their counts in the window
Update the window by removing fruits from the beginning and adding fruits from the end
Keep track of the maximum number of fruits seen so far
I applied via Campus Placement and was interviewed in Aug 2024. There were 2 interview rounds.
2 leetcode easy problems, arrays and strings.
Find the smallest substring in a string that contains all characters of another string.
Use two pointers to maintain a sliding window over the string.
Count characters in the target string using a hash map.
Expand the window by moving the right pointer and contract it by moving the left pointer.
Example: For s = 'ADOBECODEBANC' and t = 'ABC', the result is 'BANC'.
Keep track of the minimum length and starting index of valid...
Find the minimum sum of a subarray within an array of integers.
Iterate through the array and keep track of the current sum of subarray
Update the minimum sum if a smaller sum is found
Consider using Kadane's algorithm for an efficient solution
I appeared for an interview in Mar 2025, where I was asked the following questions.
BFS (Breadth-First Search) is an algorithm for traversing or searching tree or graph data structures level by level.
Level Order Traversal: BFS explores all neighbors at the present depth prior to moving on to nodes at the next depth level.
Queue Data Structure: BFS uses a queue to keep track of nodes to be explored, ensuring nodes are processed in the order they are discovered.
Shortest Path: In unweighted graphs, BFS ca...
I appeared for an interview in Dec 2024, where I was asked the following questions.
I applied via Approached by Company and was interviewed in May 2024. There were 2 interview rounds.
It had very basic dsa problem I don't not remember the exact question. It was based on array manipulation.
The Rotten Oranges problem involves determining the time taken for all oranges to rot in a grid.
Model the grid as a graph where each cell represents an orange.
Use BFS to simulate the rotting process, starting from all initially rotten oranges.
Count the minutes taken for all reachable fresh oranges to rot.
Example: In a 2D grid, rotten oranges spread to adjacent fresh oranges every minute.
I applied via LinkedIn and was interviewed in Jun 2024. There were 2 interview rounds.
Basic aptitude and data structures along with some personality based questions
The sliding window algorithm efficiently solves problems involving contiguous subarrays or substrings.
Used to find maximum/minimum in a subarray of fixed size. Example: max sum of any 3 consecutive elements.
Helps in counting distinct elements in a substring. Example: count of unique characters in 'abcabc'.
Can be applied to problems like longest substring without repeating characters. Example: 'abcabcbb' -> 'abc'.
Use...
Binary search is an efficient algorithm for finding an item from a sorted list of items.
Binary search works on sorted arrays. Example: [1, 2, 3, 4, 5].
It divides the search interval in half. If the target is less than the middle element, search the left half.
Time complexity is O(log n), making it faster than linear search (O(n)).
Example: To find 3 in [1, 2, 3, 4, 5], check middle (3), found it immediately.
If the target...
LC Medium - 2 questions
Two-pointer technique is used to solve problems involving arrays or linked lists by using two pointers to traverse the data structure.
Start with two pointers at different positions in the array or linked list
Move the pointers based on the problem requirements (e.g. one pointer moves faster than the other)
Commonly used in problems like finding a pair of elements that sum up to a target value
I applied via Referral and was interviewed in Mar 2024. There was 1 interview round.
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 2-4 weeks to complete.
based on 43 interview experiences
Difficulty level
Duration
based on 91 reviews
Rating in categories
Customer Service Associate
4.1k
salaries
| ₹1.8 L/yr - ₹5 L/yr |
Transaction Risk Investigator
3.1k
salaries
| ₹2.9 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.3k
salaries
| ₹24.8 L/yr - ₹44.1 L/yr |
Flipkart
TCS
Netflix