i
Amazon
Proud winner of ABECA 2025 - AmbitionBox Employee Choice Awards
Filter interviews by
Search for an element in a rotated sorted array.
Use binary search to find the pivot point where the array is rotated.
Compare the target element with the first element of the array to determine which half to search.
Perform binary search on the selected half to find the target element.
Time complexity: O(log n), Space complexity: O(1).
Find the first non-repeating character in a continuous character stream.
Use a hash table to keep track of character frequency.
Iterate through the stream and check if the current character has a frequency of 1.
If yes, return the character as the first non-repeating character.
If no non-repeating character is found, return null or a default value.
Check if there exists any sub array with given sum in the array with O(1K) space complexity.
Use two pointers to traverse the array and maintain a current sum.
If the current sum is greater than the given sum, move the left pointer.
If the current sum is less than the given sum, move the right pointer.
If the current sum is equal to the given sum, return true.
References and pointers are both used to access memory locations, but references cannot be null and cannot be reassigned.
Pointers can be null and can be reassigned to point to different memory locations.
References are automatically dereferenced, while pointers need to be explicitly dereferenced.
Pointers can perform arithmetic operations, while references cannot.
Example: int x = 5; int *ptr = &x; int &ref = x;
Examp...
What people are saying about Amazon
Given a list of process IDs and their corresponding parent process IDs, print the IDs of all processes that are children of a specific process ID, and recursively kill all their children.
Iterate through the list of process IDs and parent process IDs
Check if the current process ID is the one to be killed
If yes, recursively find and print all its children
If a child has further children, recursively kill them as well
Implementation of LRU cache using a doubly linked list and a hash map.
LRU (Least Recently Used) cache is a data structure that stores a fixed number of items and evicts the least recently used item when the cache is full.
To implement LRU cache, we can use a doubly linked list to maintain the order of items based on their usage frequency.
We can also use a hash map to store the key-value pairs for quick access and r...
A reference variable is a variable that holds the memory address of an object, while an actual reference is the object itself.
A reference variable is declared with a specific type and can only refer to objects of that type.
An actual reference is the object itself, which can be accessed and manipulated using the reference variable.
Changing the value of a reference variable does not affect the original object, but c...
When we type an URL, the browser sends a request to the server hosting the website and retrieves the corresponding webpage.
The browser parses the URL to extract the protocol, domain, and path.
It resolves the domain name to an IP address using DNS.
The browser establishes a TCP connection with the server.
It sends an HTTP request to the server.
The server processes the request and sends back an HTTP response.
The brows...
NP hardness refers to the difficulty of solving a problem in non-deterministic polynomial time.
NP-hard problems are some of the most difficult problems in computer science.
They cannot be solved in polynomial time by any known algorithm.
Examples include the traveling salesman problem and the knapsack problem.
Indexing in DBMS is a technique to improve query performance by creating a data structure that allows faster data retrieval.
Indexing is used to speed up data retrieval operations in a database.
It involves creating a separate data structure that maps the values of a specific column to their corresponding records.
This data structure is called an index.
Indexes are typically created on columns that are frequently used...
1. Question on Graph LC-Hard 2. Question on BFS LC-Medium
Calculate the minimum number of platforms required at a railway station for given arrival and departure times.
Sort arrival and departure times.
Use two pointers to track platforms needed at any time.
Increment platform count on arrival and decrement on departure.
Example: For arrivals [10:00, 10:15] and departures [10:30, 10:45], 2 platforms are needed.
Find missing number in array without extra space
Iterate through the array and XOR all the elements with their indices and the actual numbers
The missing number will be the XOR result
Example: ['1', '2', '4', '5'] -> XOR(0, 1) ^ XOR(1, 2) ^ XOR(2, 4) ^ XOR(3, 5) = 3
Implementing Heap data structure in C++
Use an array to represent the binary tree structure of the heap
Implement functions for inserting elements, deleting elements, and heapifying the array
Ensure that the heap property is maintained (parent node is always greater than or equal to its children)
LRU Cache is a data structure that stores a fixed number of items and removes the least recently used item when the cache is full.
Use a combination of a doubly linked list and a hashmap to efficiently implement LRU Cache.
Keep track of the least recently used item at the tail of the linked list.
When an item is accessed, move it to the head of the linked list to mark it as the most recently used item.
When adding a new it...
A linked list is a linear data structure where elements are stored in nodes with each node pointing to the next node in the sequence.
Consists of nodes connected by pointers
Does not have a fixed size like arrays
Can easily insert or delete elements without shifting other elements
Examples: Singly linked list, Doubly linked list, Circular linked list
Sets in JavaScript are used to store unique values of any type.
Create a new set using the Set constructor
Add values to the set using the add() method
Check if a value exists in the set using the has() method
Remove a value from the set using the delete() method
Iterate over the set using the forEach() method
I applied via Referral and was interviewed in Jun 2023. There were 5 interview rounds.
2 questions of leetcode medium level
And also has to write the steps of the approaches
Dynamic programming problem involving arrays of strings.
Use dynamic programming to efficiently solve problems by breaking them down into smaller subproblems.
Consider using a 2D array to store intermediate results for optimal substructure.
Examples: Longest Common Subsequence, Word Break, Minimum Path Sum.
3 Coding question on hackerrank (graph leet code medium)
Find the final element in a rotated array.
Identify the pivot point where the array was rotated.
Determine if the target element is in the first or second half of the array.
Use binary search to find the target element.
Reorder a linked list in place.
Use two pointers to find the middle of the list
Reverse the second half of the list
Merge the two halves of the list
Finding the intersection point of two linked lists.
Traverse both lists and find their lengths
Move the head of the longer list by the difference in lengths
Traverse both lists simultaneously until they meet at the intersection point
Calculate the sum of all paths between two nodes in a binary tree.
Traverse the tree and keep track of the path and its sum from the root to the current node.
When the target nodes are found, calculate the sum of all paths between them by adding the path sums of their common ancestor.
Recursively traverse the left and right subtrees to find the target nodes.
Use a hash table to store the path sums of each node for efficien...
45 minutes
2 medium level questions
Binary Search Tree Traversal, 20 min, Leetcode
Caching is the process of storing frequently accessed data in a temporary storage to improve performance.
Caching improves performance by reducing the need to fetch data from the original source.
It involves storing data in a temporary storage, such as memory or disk, closer to the user or application.
Caching can be done at various levels, including browser caching, server-side caching, and database caching.
Examples of c...
POST requests are a type of HTTP request method used to submit data to a server.
POST requests are used to create or update resources on a server.
They are commonly used in web forms to submit user input data.
POST requests have a request body that contains the data being submitted.
They are different from GET requests, which are used to retrieve data from a server.
POST requests are more secure than GET requests because th...
I applied via Campus Placement and was interviewed before Dec 2023. There were 3 interview rounds.
Coding test on Amazon own website
Assessment of 2 coding questions in 70 minutes + behaviour questions
I applied via Campus Placement and was interviewed before Jul 2023. There were 3 interview rounds.
Basic leetcode and hard one question
Matrix multiplication involves multiplying the elements of one matrix with another matrix.
Create two matrices with compatible dimensions
Multiply corresponding elements of each row in the first matrix with each column in the second matrix
Sum the products to get the resulting matrix
I applied via Campus Placement and was interviewed in Oct 2022. There were 4 interview rounds.
Machine learning, SQL, data structure
Privious problem with logical understanding , always participate in discussion with valid and clear points.
Random Forest is a machine learning algorithm that builds multiple decision trees and combines their outputs.
Random Forest is an ensemble learning method.
It builds multiple decision trees and combines their outputs to make a final prediction.
It is used for both classification and regression tasks.
It is less prone to overfitting compared to a single decision tree.
It can handle missing values and outliers.
Example: predic...
String attachment algorithm joins two strings together.
Create a new string variable to hold the result
Loop through the first string and add each character to the new string
Loop through the second string and add each character to the new string
Return the new string
Some of the top questions asked at the Amazon Sde1 interview -
based on 14 interview experiences
Difficulty level
Duration
based on 101 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.3k
salaries
| ₹23.2 L/yr - ₹43.3 L/yr |
Flipkart
TCS
Netflix