Uber Interview Questions
- 0of 0 votes
AnswersThere is a primary machine and a secondary(backup machine). Write a program to sync files from primary to backup machine
- Player October 07, 2017 in United States| Report Duplicate | Flag | PURGE
Uber Software Engineer / Developer - 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
AnswersGiven an unsorted array of integers, find the length of the longest consecutive elements sequence.
- NoOne August 22, 2017 in India
For example,
Given [100, 4, 200, 1, 3, 2],
The longest consecutive elements sequence is [1, 2, 3, 4].
Return its length: 4.
Your algorithm should run in O(n) complexity.| Report Duplicate | Flag | PURGE
Uber Senior Software Development Engineer Algorithm - 1of 1 vote
AnswersGenerate all possible matched parenthesis, given n left parenthesis and right parenthesis needs to be matched.
- NoOne August 16, 2017 in India| Report Duplicate | Flag | PURGE
Uber Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersCreate a data structure that stores integers, let then add, delete. It also should be be able to return the minimum diff value of the current integers.
- NoOne August 16, 2017 in India
That is,
min_diff = minimum ( | x_i - x_j | )
Example:
-1,3,4,10,11,11
min_diff = 0
-1,3,4,10,11,14
min_diff = 1| Report Duplicate | Flag | PURGE
Uber Senior Software Development Engineer Algorithm - -7of 7 votes
Answersaa
- Anonymous July 25, 2017 in United States| Report Duplicate | Flag | PURGE
Uber Senior Software Development Engineer Coding - 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
AnswersHow to do estimate driver arrival and drop off time?
- EriB March 25, 2017 in United States| Report Duplicate | Flag | PURGE
Uber Analyst - 0of 0 votes
AnswersHow to evaluate that the estimated time (for when the driver arrives and the drop off time) is a good estimate?
- EriB March 25, 2017 in United States| Report Duplicate | Flag | PURGE
Uber Analyst - 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 input which is vector of log entries of some online system each entry is something like (user_name, login_time, logout_time), come up with an algorithm with outputs number of users logged in the system at each time slot in the input, output should contain only the time slot which are in the input. For the example given below output should contain timeslots
- ann November 22, 2016 in United States
[(1.2, 1), (3.1, 2), (4.5, 1), (6.7, 0), (8.9, 1), (10.3,0)]
/*
[
("Jane", 1.2, 4.5),
("Jin", 3.1, 6.7),
("June", 8.9, 10.3)
]
=>
[(1.2, 1), (3.1, 2), (4.5, 1), (6.7, 0), (8.9, 1), (10.3, 0)]
*/| Report Duplicate | Flag | PURGE
Uber SDE-2 - 1of 1 vote
AnswersEach test file starts with an integer ‘t’ - the number of testcases.
- scylla October 29, 2016 in India
In each of the next ‘t’ lines, you are given a string of ‘n’ characters [ either ‘(‘ or ’)’ or ‘*’ ].
Your task is to find the number of distinct balanced parentheses expressions you can make by replacing the ‘*’ with either ‘(‘ or ‘)’ or removing the ‘*’
Note : You have to replace each ‘*’ with one of ‘(‘ or ‘)’ or remove it. If removed, assume the string has reduced by 1 character.
Duplicate strings are not allowed. The final expressions to be counted have to be distinct
As the answer may be large, please output it modulo 1000000007 (10^9+7)
Output one integer per line corresponding to each testcase.
Constraints :
1 <= t <= 20
1 <= n <= 100
0 <= Number of ‘*’ in the input string <= min(n,10)
Sample Input:
2
(*(*)*)
*(*(**)*
Sample Output
5
9
Explanation
The five possible valid solutions are for the first input are :
((()))
()(())
()()()
(())()
(())
The nine possible valid solutions are for the second input are :
(((())))
(()(()))
(()()())
(()())
((()))
()(())
()()()
()()
(())| Report Duplicate | Flag | PURGE
Uber Software Developer 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
AnswersDesign a hashMap in Java. Implement put, get, remove, resize methods.
- xankar May 10, 2016 in United States| Report Duplicate | Flag | PURGE
Uber Software Developer Algorithm - 0of 0 votes
Answers1) Narrate an instance you optimized or improved a software design.
- xankar May 10, 2016 in United States
2) Given a chance how would you re-think some of the design aspects?| Report Duplicate | Flag | PURGE
Uber Software Developer Behavioral - 0of 0 votes
AnswerDesign a Twitter feeds API. How would you actually connect it from a mobile? What happens behind the Twitter network? how do the Trends get published? From where does Twitter get the information for a particular trend(Eg: #Obama, #nfl) and publish it out? What protocol does it use? How do you connect to Twitter API? How does Twitter handle multiple connections?
- xankar May 10, 2016 in United States| Report Duplicate | Flag | PURGE
Uber Software Developer Software Design - 0of 0 votes
Answers1) Describe your most proudest project, least proudest project
- xankar May 10, 2016 in United States
2) Most inpiring teammate, what did he do?
3) Most awesome manager? Why was he so good?| Report Duplicate | Flag | PURGE
Uber Software Developer Behavioral - 0of 0 votes
AnswersGiven a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.
- xankar May 10, 2016 in United States
For example, given
s = "leetcode",
dict = ["leet", "code"].
Return true because "leetcode" can be segmented as "leet code".| Report Duplicate | Flag | PURGE
Uber Software Developer Algorithm - 0of 0 votes
AnswersLRU Cache
- anonymous May 03, 2016 in United States| Report Duplicate | Flag | PURGE
Uber Senior Software Development Engineer Algorithm - 1of 1 vote
AnswersWAP to take one element from each of the array add it to the target sum. Print all those three-element combinations.
- xankar April 28, 2016 in United States
/*
A = [1, 2, 3, 3]
B = [2, 3, 3, 4]
C = [1, 2, 2, 2]
target = 7
*/
Result:
[[1, 2, 4], [1, 3, 3], [1, 3, 3], [1, 3, 3], [1, 3, 3], [1, 4, 2], [2, 2, 3], [2, 2, 3], [2, 3, 2], [2, 3, 2], [3, 2, 2], [3, 2, 2]]| Report Duplicate | Flag | PURGE
Uber Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersFor a given string and dictionary, how many sentences can you make from the string, such that all the words are contained in the dictionary.
- Annonymous November 18, 2015 in United States
// eg: for given string -> "appletablet"
// "apple", "tablet"
// "applet", "able", "t"
// "apple", "table", "t"
// "app", "let", "able", "t"
// "applet", {app, let, apple, t, applet} => 3
// "thing", {"thing"} -> 1| Report Duplicate | Flag | PURGE
Uber Software Engineer / Developer Algorithm