i
Amazon
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
Find all permutations of a given string, handling duplicates.
Use recursion to generate all possible permutations
Use a hash set to keep track of already generated permutations
Handle duplicates by skipping already generated permutations
Time complexity is O(n!)
Return an array of strings containing all permutations
Prove that in-order traversal of a BST is always sorted and vice versa
In-order traversal of a BST visits nodes in ascending order
If a binary tree's in-order traversal is sorted, it is a BST
A BST's left subtree contains only nodes with values less than its root
A BST's right subtree contains only nodes with values greater than its root
Sort an array of 0s, 1s, and 2s without using counting sort.
Use three pointers to keep track of the positions of 0s, 1s, and 2s.
Traverse the array and swap elements to their respective positions.
Time complexity: O(n), Space complexity: O(1).
Find an element k in a sorted array such that Max(k) < n.
Use binary search to find the largest element smaller than n
Start with mid element and adjust search range based on comparison with n
Return -1 if no such element exists
Find the first occurrence of 1 in a sorted array of 0s and 1s.
Use binary search to find the first occurrence of 1.
If mid element is 1, check left subarray for first occurrence.
If mid element is 0, check right subarray for first occurrence.
Find minimum vertices to place policemen in an acyclic graph of a city to cover all roads.
Use Depth First Search (DFS) to traverse the graph
Maintain a set of visited vertices to avoid revisiting
For each unvisited vertex, place a policeman and mark all connected edges as covered
Repeat until all edges are covered
Return the minimum number of policemen placed
Pre-process a dictionary to output anagrams of a given string. Data structure, time and space complexity?
Create a hash table with sorted string as key and list of anagrams as value
Iterate through dictionary and sort each string, add to hash table
To find anagrams of given string, sort it and look up in hash table
Time complexity: O(n * klogk), space complexity: O(n)
n = number of strings in dictionary, k = length of longe
Check if a binary tree is a BST or not and give time and space complexity.
Traverse the tree in-order and check if the elements are in ascending order
Keep track of the maximum value seen so far while traversing
If any element violates the ascending order, return false
Time complexity: O(n), Space complexity: O(h) where h is the height of the tree
Design a lift system using OOPs concepts.
Create a Lift class with methods like moveUp(), moveDown(), openDoor(), closeDoor()
Create a Floor class with methods like requestLift()
Use inheritance to create different types of lifts like passenger lift, cargo lift, etc.
Use encapsulation to hide the internal workings of the lift system from the outside world.
Use polymorphism to allow different types of lifts to respond differ
Find minimum length substring of string a containing all characters of string b.
Use sliding window approach
Maintain a frequency map of characters in b
Move the window until all characters of b are present
Update the minimum length substring as you move the window
Ds and Algo, tree, array String
DS Algo, Tree Array grapH String
What people are saying about Amazon
1hr with two DSA questions, one is printing nth row of pascal triangle,
other I donot remember
Diagonal traversal of a binary tree involves printing the nodes of the tree in a diagonal pattern.
Start with the root node and move to its right child, then move down to its left child.
Repeat this process for each diagonal of the tree, printing the nodes as you traverse.
Use a queue to keep track of the nodes at each level of the tree.
Find the merge point of two linked lists.
Traverse both linked lists to find their lengths.
Calculate the difference in lengths and move the pointer of the longer list by the difference.
Traverse both lists in parallel until the merge point is found.
The Next Greater Element problem involves finding the next greater element for each element in an array.
Use a stack to keep track of elements for which the next greater element is yet to be found.
Iterate through the array and for each element, pop elements from the stack until a greater element is found.
Store the next greater element for each element in a result array.
Amazon interview questions for designations
DSA and SQL leetcode questions
Get interview-ready with Top Amazon Interview Questions
Standard DS/Algo involving mostly trees and leadership principles
I applied via Approached by Company and was interviewed in May 2024. There were 2 interview rounds.
Hackerrank 2 questions followed by leadership principle questions
Handled conflict with seniors by discussing concerns openly and finding common ground
Approached senior calmly and respectfully to discuss concerns
Listened to their perspective and tried to understand their point of view
Suggested potential solutions or compromises to resolve the conflict
Worked together to find common ground and move forward professionally
3 simple questions on arrays and strings
Using BFS to find the minimum number of steps for oranges to decay in a grid
Implement BFS algorithm to traverse the grid and decay the oranges
Keep track of the number of steps taken to decay all oranges
Return the minimum number of steps required to decay all oranges
Basic trie question for word suggestions
General DSA questions
Some of the top questions asked at the Amazon Software Development Engineer interview -
The duration of Amazon Software Development Engineer interview process can vary, but typically it takes about 2-4 weeks to complete.
based on 31 interviews
4 Interview rounds
based on 132 reviews
Rating in categories
Customer Service Associate
4.2k
salaries
| ₹0.6 L/yr - ₹6.8 L/yr |
Transaction Risk Investigator
3.1k
salaries
| ₹2.3 L/yr - ₹6.5 L/yr |
Associate
2.8k
salaries
| ₹0.8 L/yr - ₹6.9 L/yr |
Senior Associate
2.5k
salaries
| ₹2 L/yr - ₹10.1 L/yr |
Program Manager
2.3k
salaries
| ₹9 L/yr - ₹36 L/yr |
Flipkart
TCS
Netflix