i
OLX
Filter interviews by
Clear (1)
Promises, async/await, and event emitters are all ways to handle asynchronous operations in JavaScript.
Promises provide a way to handle asynchronous operations by returning a promise object that can be resolved or rejected.
Async/await is a syntax for working with promises that makes code easier to read and write.
Event emitters allow you to create custom events that can be triggered and listened for in your code.
Design a system like Facebook
Create a user registration and login system
Implement a news feed for users to see updates from friends
Allow users to create and join groups
Include features like messaging, commenting, and liking posts
Implement privacy settings for users to control who can see their content
Rate your
company
🤫 100% anonymous
How was your last interview experience?
Top trending discussions
Find sum of all numbers formed from root to leaf path in a binary tree
Traverse the binary tree using DFS
At each leaf node, add the number formed from root to leaf path to a sum variable
Return the sum variable
Time complexity: O(n)
Example: For a binary tree with root value 1, left child 2 and right child 3, the sum would be 12 + 13 = 25
Given a string, print all possible strings that can be made by placing spaces (zero or one) in between them.
Use recursion to generate all possible combinations of spaces
For each recursive call, either add a space or don't add a space between the current character and the next character
Base case is when there are no more characters left to add spaces between
Time complexity is O(2^n) where n is the length of the string
Preorder traversal without recursion
Use a stack to keep track of nodes
Push right child first and then left child onto stack
Pop top of stack and print value
Repeat until stack is empty
Find longest continuous patch on a 12 km road with updates in patches
Maintain a variable to keep track of current patch length
Update the variable whenever a new patch is added
Maintain a variable to keep track of longest patch so far
Compare current patch length with longest patch length and update if necessary
Use a sorted data structure like a binary search tree to store the patches for efficient search
Time complexity: ...
Find median of an unsorted array.
Sort the array and find the middle element
Use quickselect algorithm to find the median in O(n) time
If the array is small, use brute force to find the median
Find 'k' elements closest to a given number from a stream of characters.
Use a priority queue to keep track of closest elements.
Update the queue as new characters come in.
Return the 'k' closest elements from the queue.
Design a data structure with O(1) insert, remove, find-max, and delete-max operations.
Use a doubly linked list to maintain the elements in sorted order.
Use a hash table to store the pointers to the nodes in the linked list.
Maintain a pointer to the maximum element in the hash table.
Update the pointers in the hash table when inserting or removing elements.
Update the maximum pointer when deleting or inserting the maximum
Check if a given linked list is a palindrome.
Traverse the linked list and store the values in an array.
Compare the first and last elements of the array, then move towards the center.
If all elements match, the linked list is a palindrome.
Alternatively, use two pointers to find the middle of the linked list and reverse the second half.
Compare the first half with the reversed second half to check for a palindrome.
I applied via Recruitment Consulltant and was interviewed in Aug 2022. There were 5 interview rounds.
2 Coding questions both easy-medium level.
1. Based on the Sliding Window
2. Graph Question
A simple feed platform, which supports some basic functionality. The main point of this round was to see how well a candidate architect the application.
Design a 2/3rd Winning game.
The game should have a clear win condition
The win condition should be achievable in 2/3rd of the total game time
The game should have a balanced difficulty level
The game should have a clear feedback system for the player
Examples: Chess, Tic Tac Toe, Connect Four
NoSQL is non-relational and schema-less while SQL is relational and has a fixed schema.
NoSQL databases are horizontally scalable and can handle large amounts of unstructured data.
SQL databases are vertically scalable and are better suited for structured data with complex relationships.
NoSQL databases are often used in web applications, while SQL databases are commonly used in enterprise applications.
Examples of NoSQL d...
I was interviewed in May 2021.
Round duration - 120 minutes
Round difficulty - Medium
it was morning 10AM-12
friendly environment given by the interviewer
It was machine coding round, the problem statement was to create a online food ordering system with various features.
interviewer was good and supportive
Round duration - 60 Minutes
Round difficulty - Medium
timing noon 3-4Pm
good interviewer
interviwer was giving hints if required and all
Given an array/list ARR
consisting of integers where each element is either 0, 1, or 2, your task is to sort this array in increasing order.
The input sta...
Sort an array of 0s, 1s, and 2s in increasing order.
Use a three-pointer approach to sort the array in a single pass.
Initialize three pointers for 0, 1, and 2 values and iterate through the array.
Swap elements based on the values encountered to achieve the sorted array.
Example: Input array [0, 2, 1, 1] should be sorted as [0, 1, 1, 2].
You are given an n-ary tree consisting of 'N' nodes. Your task is to determine the maximum sum of the path from the root to any leaf node.
For the giv...
Find the maximum sum of the path from the root to any leaf node in an n-ary tree.
Traverse the tree from root to leaf nodes, keeping track of the sum along the path.
At each node, calculate the sum of the path from the root to that node and update the maximum sum found so far.
Consider using depth-first search (DFS) to traverse the tree efficiently.
Handle cases where nodes are absent (-1) by appropriately updating the pat...
Round duration - 90 Minutes
Round difficulty - Easy
evening 4-5:30PM
interviewer was good
very supportive and giving hints
Design a system for BookMyShow to allow users to book movie tickets.
Create a user-friendly website and mobile app for users to browse movies and showtimes.
Implement a secure payment gateway for users to purchase tickets online.
Develop a database to store movie information, showtimes, and user bookings.
Include features like seat selection, ticket confirmation, and booking history for users.
Integrate with cinema partners
Round duration - 40 Minutes
Round difficulty - Easy
4-5 PM
Interviewer was good
Tip 1 : Practice Atleast 200 Questions
Tip 2 : Practice company specific interview question
Tip 3 : Prepare resume nicely
Tip 1 : Prepare resume very nicely.
Tip 2 : don't mention any tech stack you are confident of.
I applied via Referral and was interviewed in Jan 2023. There were 3 interview rounds.
This was a machine coding round in which we have to implement an online cab booking service.
Standard problem solving round consists of two questions on tree and dp.
Hacker Rank test - 4 rounds (Coding, System Design and Work style assessment, Leadership Principles)
I was interviewed before May 2021.
Round duration - 45 Minutes
Round difficulty - Easy
Given an integer N
representing the number of pairs of parentheses, find all the possible combinations of balanced parentheses using the given number of pairs.
Generate all possible combinations of balanced parentheses for a given number of pairs.
Use recursion to generate all possible combinations of balanced parentheses.
Keep track of the number of open and close parentheses used in each combination.
Terminate recursion when the number of open and close parentheses used equals the given number of pairs.
Round duration - 45 Minutes
Round difficulty - Easy
You are given a binary tree of integers. Your task is to print the boundary nodes of this binary tree in an anti-clockwise direction starting from the ro...
Print the boundary nodes of a binary tree in an anti-clockwise direction starting from the root node.
Traverse the left boundary nodes from top to bottom
Traverse the leaf nodes from left to right
Traverse the right boundary nodes from bottom to top
Handle cases where nodes are null (-1)
Print the boundary nodes in the specified order
Round duration - 45 Minutes
Round difficulty - Easy
Given a binary tree, the task is to print its bottom view from left to right. Assume the left and the right child nodes make a 45-degree angle with their paren...
The task is to print the bottom view of a binary tree from left to right.
Traverse the binary tree in level order and keep track of the horizontal distance of each node from the root.
For each horizontal distance, update the node value in a map to get the bottom view nodes.
Print the values of the map in sorted order of horizontal distance to get the bottom view sequence.
Round duration - 45 minutes
Round difficulty - Easy
Bar raiser
Yes, I can design a parking lot using LLD and a tiny URL service using HLD.
For designing a parking lot using LLD, we can create classes like ParkingLot, ParkingSpot, Vehicle, etc. with their respective attributes and methods.
For designing a tiny URL service using HLD, we can focus on scalability, fault tolerance, and performance. We can use techniques like sharding, caching, load balancing, etc.
In the parking lot LLD, ...
Tip 1 : Prepare 1-2 examples for each Leadership Principles
Tip 2 : Prepare questions from the latest interview experiences
Tip 1 : Concise, without errors
Tip 2 : Highlight years of experience
I was interviewed in Oct 2020.
Round duration - 60 mins
Round difficulty - Medium
3 Questions were asked : 2- Trees and 1- Stack.
Interviewer was not receptive at all, I think this was a stress interview.
Given a binary tree with 'N' nodes, determine if it is a Binary Search Tree (BST). Return true
if the tree is a BST, otherwise return false
.
Validate if a given binary tree is a Binary Search Tree (BST) or not.
Check if the left subtree of a node contains only nodes with values less than the node's value.
Check if the right subtree of a node contains only nodes with values greater than the node's value.
Ensure that both the left and right subtrees are also binary search trees.
Traverse the tree in-order and check if the elements are in sorted order.
Use a recurs...
Given a binary tree with 'N' nodes, transform it into a Greater Tree. In this transformation, each node's value should be updated to the sum of its original value and...
Convert a binary tree into a Greater Tree by updating each node's value to the sum of its original value and the values of all nodes greater than or equal to it.
Traverse the tree in reverse inorder (right, root, left) to update the nodes' values.
Keep track of the sum of nodes visited so far to update each node's value.
Recursively update the node's value by adding the sum of greater nodes to it.
You are given a string STR
containing only the characters "{", "}", "(", ")", "[", and "]". Your task is to determine if the parentheses in the string are balanced.
Th...
Check if the given string containing only parentheses is balanced or not.
Use a stack to keep track of opening parentheses.
Iterate through the string and push opening parentheses onto the stack.
When a closing parenthesis is encountered, pop from the stack and check if it matches the corresponding opening parenthesis.
If at the end the stack is empty, return 'YES' else return 'NO'.
Round duration - 60 mins
Round difficulty - Hard
2 Coding Questions were asked, both were of Medium to Hard Difficulty.
You are given a multi-level linked list containing 'N' nodes. Each node has 'next' and 'child' pointers that may or may not point to other nodes. Your task is to flatten th...
Flatten a multi-level linked list into a single linked list by rearranging the pointers.
Traverse the linked list and whenever a node has a child, flatten the child list and append it after the current node.
Update the 'next' and 'child' pointers accordingly while flattening the list.
Continue this process until all nodes are rearranged into a single linked list.
Given an array/list ARR
of size N
, representing an elevation map where each element ARR[i]
denotes the elevation of the i-th
bar. Your task is to calculate and print ...
Calculate the total amount of rainwater that can be trapped between given elevations in an elevation map.
Use two-pointer approach to keep track of left and right boundaries.
Calculate the trapped water by finding the minimum of left_max and right_max for each bar.
Subtract the current bar's height from the minimum of left_max and right_max to get the trapped water.
Keep updating the left_max and right_max as you iterate t
Round duration - 90 minutes
Round difficulty - Medium
Timing : It was late night.
How the interviewer was? He was very tired and I had to lead the discussion.
1 System Design Question was asked, had to provide - HLD, LLD, APIs.
Round duration - 60 minutes
Round difficulty - Medium
Timing : Afternoon
How was the environment? Home
Interviewer : Hiring Manager
Discussed about past Projects, challenges faced, disagreements with manager, why looking for job switch, leadership principle questions were asked.
Round duration - 60 minutes
Round difficulty - Medium
Timing - Afternoon
How was the environment? Home
How the interviewer was? Very Helpful Interviewer
Bar raiser Round - Coding + System Design + Leadership principle
Tip 1 : 250 Leetcode ( Easy- 70, Medium- 150, Hard- 30)
Tip 2 : Don't underestimate importance of good projects on your Resume.
Tip 3 : Be Confident.
Tip 1: Resume should not be more than 1 page.
Tip 2: Have Keywords on Resume that match Job descriptions.
I was interviewed in Apr 2021.
Round duration - 60 minutes
Round difficulty - Easy
Started with brief intro(5 mins) about interviewer.
Problem solving question, question was already there in the codelink shared by the interviewer. He explained the problem again with sample testcase.
The Interviewer was friendly.
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.
Create a graph with courses as nodes and prerequisites as edges.
Use topological sorting to find a valid order to complete all courses.
Return an empty list if it's impossible to complete all courses.
Design a live video broadcast platform.
Implement video streaming functionality using protocols like RTMP or WebRTC
Include features for live chat, reactions, and audience engagement
Ensure scalability and reliability by using cloud services like AWS or Azure
Provide analytics for viewership data and user engagement
Integrate monetization options such as ads or subscriptions
Round duration - 90 minutes
Round difficulty - Medium
There were 2 interviewers(India HM and Seattle HM), India HM was just shadowing and didn't ask any questions. Started with intro, he asked in detail about what I do at current company(10 mins). Again, jumped into LP's(25 mins).
Given a binary tree and the values of two distinct nodes, determine the distance between these two nodes in the tree. The distance is defined as the minimum num...
Calculate the distance between two nodes in a binary tree.
Traverse the tree to find the paths from the root to each node
Find the lowest common ancestor of the two nodes
Calculate the distance by summing the distances from each node to the common ancestor
Your task is to determine the median of integers as they are read from a data stream. The median is the middle value in the ordered list of numbers. If the list length...
Find median of integers in a data stream as they are read.
Use two heaps - max heap for lower half of numbers and min heap for upper half.
Keep the size of two heaps balanced to find the median efficiently.
Handle even and odd number of elements separately to calculate median.
Return vector of medians after each element is read from the stream.
Round duration - 60 minutes
Round difficulty - Medium
There was only 1 interviewer in this round and We had no video sharing in this round so it was becoming difficult to understand each other.
Tip 1 : Bookmark the GFG Amazon Archives. It helped me a lot during my preparations. Reading other’s interview experiences is one of the best ways to get yourselves ready for the next job interview. Practice daily atleast 5 questions.
Tip 2 : Most commonly asked topics in Amazon Interviews ( as per the mail I received from my recruiter ) :
BFS/DFS/Flood fill, Binary Search, Tree traversals, Hash tables, Linked list, stacks, queues, two pointers/sliding window
Binary heaps, Ad hoc/string manipulations.
Tip 3 : Highly recommended sites for practicing questions ( usually practice medium and hard level questions) :
Leetcode (highly encouraged)
Geeksforgeeks (highly encouraged)
CodeZen( highly encouraged)
Codeforces
Tip 4 : This is a great bigocheatsheet that could be of great help https://www.bigocheatsheet.com/
Tip 1 : Mention past working experience in detail as how you were important to your previous company.
Tip 2 : Try to keep your resume to 1 page if work experience < 5 years
Tip 3 : Update your resume according to role you are applying for and never put false things on resume.
I was interviewed in Oct 2020.
Round duration - 90 minutes
Round difficulty - Easy
I got a call from an Amazon recruiter regarding the schedule of the test . She sent me the coding test link which I had to complete within a week. we can attempt the online test anytime, when we have time for a period of 90 minutes at a stretch.Once I completed the test, I got a call to schedule the interviews in two weeks.
Given arrays representing the costs of pants, shirts, shoes, and skirts, and a budget amount 'X', determine the total number of valid combinations that can be purchased ...
Determine total number of valid shopping combinations within budget
Iterate through all possible combinations of items from each array
Check if the total cost of the combination is within the budget
Return the count of valid combinations
You are provided with a matrix MAT
consisting of integers, with dimensions N x M
(i.e., N rows and M columns). Your objective is to determine the maximum sum submatrix with...
Find the maximum sum submatrix in a given matrix.
Iterate over all possible submatrices and calculate their sums
Use Kadane's algorithm to find the maximum sum subarray in each row
Combine the sums of rows to find the maximum sum submatrix
Round duration - 60 minutes
Round difficulty - Medium
Virtual interview occured in amazon chime.The interviewer gave his introduction, asked me a bit on the kind of projects I’ve worked on. Then he started with a data structure problem.
Given a binary tree where each node has pointers to its left, right, and a random node, create a deep copy of the binary tree.
The first line contains an ...
Clone a binary tree with random pointers and verify if cloning was successful by printing inorder traversal.
Create a deep copy of the binary tree with random pointers.
Print the inorder traversal of the cloned binary tree.
Verify cloning success by printing '1' if successful, '0' otherwise.
Ninja is in a city with 'N' colonies, where each colony contains 'K' houses. He starts at house number "sourceHouse" in colony number "sourceColony" and wants to reach house number ...
The Ninja Port Problem involves finding the minimum time for a ninja to travel between colonies and houses using secret paths and teleportation.
Calculate the minimum time considering teleportation within colonies, traveling between colonies, and secret paths.
Keep track of the number of secret paths used and ensure they are one-way.
Consider the constraints provided to optimize the solution.
Example: N=2, K=3, S=1, P=1, s...
Round duration - 75 Minutes
Round difficulty - Easy
This was taken by an engineering manager who asked me regarding my projects for around 10-15 mins and then we moved to a system design problem. He asked me to design Slack messenger.
I started by listing the functional and non-functional requirements(on which he questioned me a bit), then I moved to draw the high-level architecture. The components which I drew were the clients, gateway service(LB + authentication, etc), Messaging Service, User Service, Web Socket Manager service, Fan Out service(I added this for the group messages thing, but he didn’t interrogate much on that).
He asked me what would be the schema of my messages table and the scenarios in which the recipient user is online/offline.Also asked about the partitioning key and primary key of the 2-3 tables which I had made
Round duration - 60 minutes
Round difficulty - Hard
BarRaiser Round
This was again taken by an engineering manager who discussed my projects in depth for around 20-25 mins. In the remaining time he asked me 2 dsa questions. (Yes I too was surprised that he didn’t ask anything regarding design).
In almost all the rounds, I was asked questions related to Amazon Leadership principles, so do make sure you go through those before sitting for the interview process. You can refer to this link(https://www.codingninjas.com/codestudio/problem-lists/top-amazon-coding-interview-questions) for practicing the same, I found it useful.
In the design rounds, interviewer doesn’t expect the most ideal answer from you and unless your choice of technology is outrageously wrong, he won’t pinpoint that.
Given an array/list of strings STR_LIST
, group the anagrams together and return each group as a list of strings. Each group must contain strings that are anagrams of each other.
Group anagrams together in a list of strings.
Iterate through the list of strings and sort each string to group anagrams together.
Use a hashmap to store the sorted string as key and the original string as value.
Return the values of the hashmap as the grouped anagrams.
Your task is to find the sum list of two numbers represented by linked lists and return the head of the sum list.
The sum list should be a linked...
Add two numbers represented by linked lists and return the head of the sum list.
Traverse both linked lists simultaneously while keeping track of carry from previous sum
Create a new linked list to store the sum of the two numbers
Handle cases where one linked list is longer than the other by padding with zeros
Update the sum and carry values accordingly while iterating through the linked lists
Tip 1 : Expect questions related to Amazon Leadership principles in all rounds, so go through those thoroughly before sitting for the interview process.
Tip 2 : In the design rounds, interviewer doesn’t expect the most ideal answer from you and unless your choice of technology is outrageously wrong, he won’t pinpoint that.
Tip 3 : Data Structures questions are a must in all rounds, so try to master them thoroughly
Tip 1 : Make sure you know everything you mention in your resume
Tip 2 : Have some hands on with hackathons and contests ,which brings an added value to your resume
Anonymously discuss salaries, work culture, and many more
Get Ambitionbox App
Dealer Success Manager
149
salaries
| ₹0 L/yr - ₹0 L/yr |
Key Account Manager
141
salaries
| ₹0 L/yr - ₹0 L/yr |
Accounts Manager
119
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Accounts Manager
70
salaries
| ₹0 L/yr - ₹0 L/yr |
Retail Associate
65
salaries
| ₹0 L/yr - ₹0 L/yr |
Quikr
eBay
Tokopedia
Flipkart