Uber
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
Leetcode medium questions, 45 mins
I applied via LinkedIn and was interviewed in Dec 2022. There were 3 interview rounds.
3 coding questions one on array
Top trending discussions
It had 9 uqestions , one problem solving , one SQL , one API and 6 mcq
Easy assignment , if you hav eOOps knowledge you can do it
I applied via Job Fair and was interviewed in Nov 2023. There was 1 interview round.
Find k closest points to origin from a set of 2D points.
Calculate distance of each point from origin using distance formula
Sort the points based on distance in ascending order
Return first k points from the sorted list
iOS manual memory management requires developers to manually allocate and deallocate memory for objects.
Developers must manually allocate memory for objects using methods like alloc and init.
Developers must also manually deallocate memory for objects using methods like release.
Failure to properly manage memory can lead to memory leaks and crashes.
ARC (Automatic Reference Counting) was introduced in iOS 5 to automate me...
Program to print powerset of a given set
Create an empty list to store subsets
Loop through all possible binary numbers from 0 to 2^n-1 where n is the length of the set
For each binary number, convert it to binary and use the 1's as indices to select elements from the set
Add the selected elements to the list of subsets
Return the list of subsets
Convert Roman numerals to integer in O(n) time
Create a dictionary to map Roman numerals to integers
Iterate through the string from right to left
If the current numeral is less than the previous, subtract it from the total
Else, add it to the total
Return the total
Given a list of numbers and symbols, provide an expression that evaluates to a target number.
Use recursion to try all possible combinations of numbers and symbols
Check for division by zero and negative numbers
Return False if no expression evaluates to the target number
Solve for x in a given expression with single variable.
Simplify the expression by applying the distributive property and combining like terms.
Isolate the variable term on one side of the equation and the constant terms on the other side.
Solve for x by dividing both sides of the equation by the coefficient of the variable term.
Check the solution by substituting the value of x back into the original equation.
In this case...
Given a hashmap M and an input string S, return an array of all possible mutations of S using M's substitutes.
Iterate through each character in S and get its substitutes from M
Use recursion to generate all possible combinations of substitutes for each character
Time complexity: O(n^m) where n is the average number of substitutes per character and m is the length of S
Space complexity: O(n^m) due to the number of possible...
Facebook implements graph search by indexing user data and using natural language processing.
Facebook indexes user data to create a graph of connections and relationships.
Natural language processing is used to interpret user queries and return relevant results.
Graph search allows users to search for specific information within their network, such as 'friends who like hiking'.
Facebook chat is a real-time messaging service that allows users to communicate with each other through the Facebook website or mobile app.
Facebook chat uses XMPP (Extensible Messaging and Presence Protocol) to enable real-time communication between users.
Messages are sent and received through Facebook's servers, which act as intermediaries between users.
Users can see when their friends are online and available to chat...
Facebook stores likes/dislikes as data points in their database.
Likes and dislikes are stored as separate data points.
Each like/dislike is associated with a unique ID for the post or comment.
The data is stored in Facebook's database and can be accessed through their API.
Likes/dislikes can also be used to personalize a user's newsfeed.
Facebook also uses likes/dislikes to gather data for targeted advertising.
Status updates can be implemented through various methods such as push notifications, real-time updates, and periodic polling.
Use push notifications to instantly update users on important changes.
Implement real-time updates using websockets or server-sent events for a seamless user experience.
Periodically poll the server for updates using AJAX or other similar technologies.
Provide a clear and concise interface for user...
A timeline/newsfeed can be implemented using a combination of algorithms and data structures.
Use a database to store user activity data
Implement an algorithm to sort the data by time
Use pagination to limit the number of items displayed at once
Include options for filtering and searching
Consider using caching to improve performance
Adding someone as a friend allows you to connect with them on the platform and see their updates.
When you add someone as a friend, they receive a notification and can choose to accept or decline your request.
Once they accept your request, you can see their updates and they can see yours.
You can also message each other and tag each other in posts.
Adding someone as a friend does not give them access to your personal info...
Hadoop is a distributed computing framework used for storing and processing large datasets.
Hadoop is based on the MapReduce programming model.
It allows for parallel processing of large datasets across multiple nodes.
Hadoop consists of two main components: HDFS for storage and MapReduce for processing.
It is commonly used for big data analytics, machine learning, and data warehousing.
Examples of companies using Hadoop in
FB messages work by allowing users to send and receive text, images, videos, and other media through the Facebook platform.
Messages can be sent to individuals or groups of people.
Users can also send voice messages and make voice and video calls through the messaging feature.
Messages can be archived or deleted, and users can also choose to ignore or block certain senders.
Facebook uses end-to-end encryption to protect th...
FB Mail is a messaging service that allows Facebook users to send and receive messages from other users.
FB Mail is integrated into the Facebook platform and can be accessed through the Messenger app or website.
Users can send messages to individuals or groups, and can also attach files, photos, and videos.
FB Mail also includes features such as message requests, message filtering, and message archiving.
Messages can be se...
Find the second largest element in an array.
Sort the array and return the second last element
Iterate through the array and keep track of the two largest elements
Use a priority queue to find the second largest element
Given a sorted array with repeated elements, find the occurrence of a given element using binary search.
Use binary search to find the first occurrence of the element
Use binary search to find the last occurrence of the element
Calculate the occurrence by subtracting the indices of the last and first occurrences and adding 1
Implement a data structure and algorithm to print all files in a directory, including sub-directories.
Use an n-ary tree or stack to represent the directory structure
Implement a BFS or DFS algorithm to traverse the directory and print files
Handle sub-directories recursively
Consider using a queue or stack to keep track of directories to visit
Print a matrix diagonally.
Start from the top left corner and print the diagonal elements
Move down and right to print the next diagonal
Repeat until all diagonals are printed
DFS is a traversal algorithm used to visit all nodes of a tree or graph. It can be applied to binary as well as n-ary trees.
DFS stands for Depth First Search.
In DFS, we start from the root node and visit its children recursively until we reach a leaf node.
There are two types of DFS: Preorder (root, left, right) and Postorder (left, right, root).
DFS can be implemented using recursion or a stack data structure.
Example: I...
To find the top 10 selling products, sort the products by their sales count in descending order and select the first 10.
Sort the products by their sales count in descending order
Select the first 10 products from the sorted list
Design a valet parking lot with ticket assignment and car retrieval using best fit and nearest distance.
Create a parking lot with designated spots for each size of car
Assign a ticket to the customer upon entry and record the spot number
Retrieve the car by searching for the nearest available spot of the appropriate size
Use best fit algorithm to minimize empty spots
Implement a system for payment upon exit
Find total possible valid unique combinations of given number of pairs of parenthesis without duplicity.
Use recursion to generate all possible combinations
Check for validity of each combination using a stack
Use a set to avoid duplicity
Construct a binary tree from in-order traversal with nodes greater than left and right child.
The root node will be the maximum value in the in-order traversal
Recursively construct the left and right subtrees using the left and right portions of the in-order traversal
Repeat until all nodes are added to the tree
An algorithm to find top 10 trending words inserted by users in sites like Twitter.
Collect a large dataset of tweets
Tokenize the tweets into individual words
Remove stop words and punctuation
Count the frequency of each word
Sort the words by frequency in descending order
Select the top 10 words
Find the first occurrence of 1 in a sorted binary array.
Use binary search to find the first occurrence of 1.
If the mid element is 1, check if it's the first occurrence or if the element before it is 0.
If the mid element is 0, search in the right half of the array.
If the mid element is 1 and the element before it is also 1, search in the left half of the array.
Remove duplicates from a string in O(n) without using hash
Use an array of boolean values to keep track of characters already seen
Iterate through the string and mark characters as seen in the array
If a character has already been seen, remove it from the string
Find the first occurrence of 1 in a sorted infinite binary tree.
Use binary search to traverse the tree.
If the current node is 1, check if its left child is also 1. If yes, move to the left subtree, else return the current node.
If the current node is 0, move to the right subtree.
Repeat until the first occurrence of 1 is found or the tree is exhausted.
Interview experience
Driver
583
salaries
| ₹0.6 L/yr - ₹7 L/yr |
CAR Driver
390
salaries
| ₹0.9 L/yr - ₹7.5 L/yr |
Software Engineer
159
salaries
| ₹19.4 L/yr - ₹84.6 L/yr |
Operations Executive
139
salaries
| ₹1.6 L/yr - ₹4 L/yr |
Data Analyst
130
salaries
| ₹5.6 L/yr - ₹21.7 L/yr |
Amazon
Ola Cabs
Airbnb