Uber Interview Questions
- 0of 0 votes
AnswersWrite your own class for key value store which has four methods:
- Desi May 14, 2019 in United States for ATG
put(key,value)
get(key)
getRandom() this should return a random value with equal probability
deleteWithKey(key)
I was allowed to use hashmap internally to store data.
this was my second technical phone interview because they wanted to get some more idea about my technical skills.| Report Duplicate | Flag | PURGE
Uber Software Engineer Algorithm - 0of 0 votes
AnswersAt first Interviewer asked me to write a problem to solve sudoku and return error if sudoku is invalid.
- Desi May 14, 2019 in United States for ATG
I told him I already had seen the problem before and he said he really appreciates my honesty.
this was my second technical phone interview because they wanted to get some more idea about my technical skills.| Report Duplicate | Flag | PURGE
Uber Software Engineer Algorithm - 0of 0 votes
AnswersGiven an array of integers find all combination of numbers (regardless of length) that add up to a particular sum. (Subset sum problem)
- pk May 14, 2019 in United States| Report Duplicate | Flag | PURGE
Uber Software Engineer - 0of 0 votes
AnswersGiven a nxn grid with 1's and 0's find the length of largest black square formed with 1's.
- Desi April 29, 2019 in United States for ATG
So for below example:
00000
11110
01111
01110
The largest square length is 3.
With dynamic programming it can be done in O(n^2) time
It was a technical screen but it was taken in person for an event.| Report Duplicate | Flag | PURGE
Uber Software Engineer Algorithm - 0of 0 votes
AnswersDesign a concurrent hashmap.
- ANONU June 13, 2018 in United States
Please point me to the link if this has been discussed before.
They wanted design with code snippet of the classes.| Report Duplicate | Flag | PURGE
Uber Software Engineer System Design - 1of 1 vote
AnswersYou have two arrays of strings, words and parts. Return an array that contains the strings from words, modified so that any occurrences of the substrings from parts are surrounded by square brackets [], following these guidelines:
- btmakusha February 21, 2018 in United States for Uber Eats
If several parts substrings occur in one string in words, choose the longest one. If there is still more than one such part, then choose the one that appears first in the string.
Example
For words = ["Apple", "Melon", "Orange", "Watermelon"] and parts = ["a", "mel", "lon", "el", "An"], the output should be
findSubstrings(words, parts) = ["Apple", "Me[lon]", "Or[a]nge", "Water[mel]on"].
While "Watermelon" contains three substrings from the parts array, "a", "mel", and "lon", "mel" is the longest substring that appears first in the string.| Report Duplicate | Flag | PURGE
Uber Software Engineer - 3of 3 votes
AnswersConvert a string with digits into a literal representation of the number like: 1001 to one thousand one
- aonecoding February 15, 2018 in United States| Report Duplicate | Flag | PURGE
Uber Software Engineer Algorithm - 1of 1 vote
AnswersFind the Kth most Frequent Number in an Array.
Example:arr[] = {1, 2, 3, 2, 1, 2, 2, 2, 3} k = 2 Result: 3 Because '3' is the second most occurring element.
Follow up: What if the array is extremely large?
- CodeNinja January 04, 2018 in United States for Marketplace| Report Duplicate | Flag | PURGE
Uber Software Engineer Hash Table - 0of 0 votes
Answers
- Anonymous October 13, 2017 in United States for SeattleA text file contains {candidateID,voterID} details of an ongoing voting. Read this file in real time and report top 5 candidates. Also report a fraud if a Voter tries to vote twice or try to vote more then one candidate. Assume that the database is offline.
| Report Duplicate | Flag | PURGE
Uber Software Engineer Algorithm - 1of 1 vote
AnswersGiven two list of unsorted intervals V1 and V2 write 2 functions 'OR ' and 'And' to return a new list
- sachin323 October 05, 2017 in United States
OR Function (union of list ): Input V1 = (2,4) (6,8) (1,3) V2 = (7,9) (2,5)
output = (1,5) (6,9)
And function : This will be intersection function and will return intersection of the lists| Report Duplicate | Flag | PURGE
Uber Software Engineer Algorithm - 2of 2 votes
Answers4/5 Round at Uber
- aonecoding July 20, 2017 in United States
Coding: Given a 2D array of either '\' or '/', find out how many pieces this rectangle is divided into graphically.
For a 2X2 matrix with
/\
\/
The matrix split into 5 pieces - the diamond in middle and the four corners. Return 5 as the answer.
5/5 Round at Uber
Design Excel.| Report Duplicate | Flag | PURGE
Uber Software Engineer Algorithm - 1of 1 vote
Answers2/5 Round at Uber
- aonecoding July 20, 2017 in United States
Bar raiser - Behavioral questions. Coding: Find if a set of meetings overlap. Meeting has a starttime and an endtime with accuracy to minute. All meetings take place in the same day. Do this in O(n) time.
3/5 Round at Uber
Coding: Subset sum. Follow-up: Optimize the solution.| Report Duplicate | Flag | PURGE
Uber Software Engineer Algorithm - 0of 0 votes
Answers1/5 Round at Uber
- aonecoding July 20, 2017 in United States
Manager : Behavioral questions. Basic system design concepts. Publish/subscribe model. Discussion on Uber architecture.| Report Duplicate | Flag | PURGE
Uber Software Engineer System Design - 2of 2 votes
AnswerUber
- aonecoding July 17, 2017 in United States
1. Mirror Binary Tree
2. String pattern matching
The matching should cover the entire input string (not partial).
The function prototype should be:
bool isMatch(String str, String pattern)
Some examples:
isMatch("aa","a") → false
isMatch("aa","aa") → true
isMatch("aaa","aa") → false
isMatch("aa","a{1,3}") → true
isMatch("aaa","a{1,3}") → false
isMatch("ab","a{1,3}b{1,3}") → true
isMatch("abc","a{1,3}b{1,3}c") → true
isMatch("abbc","a{1,3}b{1,2}c") → false
isMatch("acbac","a{1,3}b{1,3}c") → false
isMatch("abcc","a{1,3}b{1,3}cc{1,3}") → true
In pattern string, a char followed by {lower, upper} means that the char occur lower to upper(exclusive) times. e.g. a{1, 3} -> a occurs 1 or 2 times.| Report Duplicate | Flag | PURGE
Uber Software Engineer Algorithm - 0of 0 votes
AnswersDesign classes to represent the following problem and solve the questions 1,2,3
- lks February 18, 2017 in United States
A user might have some outstanding auto loan amount and you have 3 types of offers: personal loan, credit card and auto loan offers. You need to provide the user
with the following details:
1. Send user all the offers to the user
2. Send user all eligible offers (where minCreditScore < userCreditScore < maxCreditScore)
3. Send user all offers which satisfied 2) and where the (userOutStandingLoanAmount < maxOfferedAutoLoanAmount)
personal-loan = [{
"personal-loan": {
"id": 1,
"provider": "Avant",
"term": 36,
"minimumCreditScore": 300,
"maximumCreditScore": 700,
"maximumAmount": 10000
}
}, {
"personal-loan": {
"id": 2,
"provider": "Prosper",
"term": 24,
"minimumCreditScore": 600,
"maximumCreditScore": 700,
"maximumAmount": 5000
}
}]
credit-card=[{
"credit-card": {
"id": 2,
"provider": "CapitalOne",
"minimumCreditScore": 600,
"maximumCreditScore": 700
}
}, {
"credit-card": {
"id": 3,
"provider": "Chase",
"minimumCreditScore": 300,
"maximumCreditScore": 900
}
}]
autoloan = [{
"auto-loan": {
"id": 1,
"provider": "CapitalOne",
"term": 36,
"minimumCreditScore": 300,
"maximumCreditScore": 700,
"maximumAmount": 10000
}
}, {
"auto-loan": {
"id": 2,
"provider": "Blue Harbor",
"term": 24,
"minimumCreditScore": 600,
"maximumCreditScore": 700,
"maximumAmount": 5000
}
}]| Report Duplicate | Flag | PURGE
Uber Software Engineer - 1of 1 vote
AnswersConsider that the driver with one trip want to pick up some peoples in different locations like this:
- sonya.abdoli February 17, 2017 in United States
String[] locations ={
"person1, person2, person3, person4, person5",
" person6, person7, person8, person9",
"person10, person11, person12",
"person13, person14, person15",}
in each location there are different choice, so write a code present all possible way to pick up people in the different locations. you can use every data structure needs.| Report Duplicate | Flag | PURGE
Uber Software Engineer - 3of 3 votes
AnswersGiven a list of system packages, some packages cannot be installed until the other packages are installed. Provide a valid sequence to install all of the packages.
- aonecoding January 15, 2017 in United States
e.g.
a relies on b
b relies on c
then a valid sequence is [c, b, a]| Report Duplicate | Flag | PURGE
Uber Software Engineer Algorithm - 0of 0 votes
AnswersGiven a string s, return all the palindromic permutations ( without duplicates), of it. Return an empty array if no palindromic combinations can be formed.
- NS October 04, 2016 in United States| Report Duplicate | Flag | PURGE
Uber Software Engineer Algorithm - 0of 0 votes
AnswersGiven a string, determine if a permutation of a string can form a palindrome.
- NS October 04, 2016 in United States| Report Duplicate | Flag | PURGE
Uber Software Engineer Algorithm - 3of 3 votes
AnswersGiven an input string and ordering string, need to return true if the ordering string is present in Input string.
- ranjith2jeeth August 04, 2016 in United States
input = "hello world!"
ordering = "hlo!"
result = FALSE (all Ls are not before all Os)
input = "hello world!"
ordering = "!od"
result = FALSE (the input has '!' coming after 'o' and after 'd', but the pattern needs it to come before 'o' and 'd')
input = "hello world!"
ordering = "he!"
result = TRUE
input = "aaaabbbcccc"
ordering = "ac"
result = TRUE| Report Duplicate | Flag | PURGE
Uber Software Engineer String Manipulation - 0of 0 votes
AnswerImplement a data structure to represent this
- Anonymous June 29, 2016 in United States
[1,[2],[[[5]]],6,7,8]. Multi level indirection with in a list| Report Duplicate | Flag | PURGE
Uber Software Engineer Data Structures - 0of 0 votes
AnswersGiven an api which returns an array of chemical names and an array of chemical symbols, display the chemical names with their symbol surrounded by square brackets:
- abcpiipii May 25, 2016 in United States
Ex:
Chemicals array: ['Amazon', 'Microsoft', 'Google']
Symbols: ['I', 'Am', 'cro', 'Na', 'le', 'abc']
Output:
[Am]azon, Mi[cro]soft, Goog[le]
If the chemical string matches more than one symbol, then choose the one with longest length. (ex. 'Microsoft' matches 'i' and 'cro')
My solution:
(I sorted the symbols array in descending order of length and ran loop over chemicals array to find a symbol match(using indexOf in javascript) which worked. But I din't make it through the interview, I am guessing my solution was O(n2) and they expected an efficient algorithm.| Report Duplicate | Flag | PURGE
Uber Software Engineer Algorithm String Manipulation - 0of 0 votes
AnswersGiven a character limit and a message, split the message up into annotated chunks without cutting words as, for example when sending the SMS "Hi Sivasrinivas, your Uber is arriving now!" with char limit 25, you should get
- sivasrinivas November 14, 2015 in United States
["Hi Sivasrinivas,(1/3)", "your Uber is arriving(2/3)", "now!(3/3)"]| Report Duplicate | Flag | PURGE
Uber Software Engineer Algorithm - 0of 2 votes
AnswersAdd a third dimension of time to a hashmap , so ur hashmap will look something like this - HashMap<K, t, V> where t is a float value. Implement the get and put methods to this map. The get method should be something like - map.get(K,t) which should give us the value. If t does not exists then map should return the closest t' such that t' is smaller than t. For example, if map contains (K,1,V1) and (K,2,V2) and the user does a get(k,1.5) then the output should be v1 as 1 is the next smallest number to 1.5
- randomCoder1988 May 02, 2015 in United States for Mobile| Report Duplicate | Flag | PURGE
Uber Software Engineer - 0of 0 votes
AnswerDesign a ride sharing application
- randomCoder1988 April 26, 2015 in United States| Report Duplicate | Flag | PURGE
Uber Software Engineer