0 like 0 dislike
782 views
| 782 views

0 like 0 dislike
Status: 3 years experience at an Indian product based company. Currently SDE.
Education: B.E Comp Science at a Tier-3 college

I was just randomly browsing Uber careers section and applied for this position. Surprisingly I got a call from the recruiter who scheduled the interviews.

Interview Process

Phone screen. (PS/DS/Algo)
Problem solving round. (PS/DS/Algo)
Machine coding round. (PS/DS/Algo)
System design round.
Hiring manager round.
Bar raiser.
In all first 3 interviews Uber expects actual working code which is then tested by the interviewer with a few test cases, unlike other companies which require only code on paper.

Phone screen interview (1 hour)
Started with a basic introduction and then he jumped straight into the question.

Given a 2d plane and a set of co-ordinates, return the maximum no. of points lying on a straight line. (Medium/Hard)
Had seen a similar question on Leetcode. Came up with a naive solution then optimised it to expected time complexity. Interviewer then asked me to write the code and handle all cases. Wrote the code, he tested it and worked fine. This took around ~40 mins, so he asked another question.
Given two sets of lines, one is a set of lines parallel to x axis (ex y=0,2,5) and other are lines parallel to y axis (ex x=0,2,5). Find the number of squares formed by intersection of these sets of lines. (Medium/Hard)
Worked on it for a while, gave him a solution where we take a pair of lines in a set (say y=0,y=5) store their difference in a hashmap and do that for all pairs of lines. Do the same for the other set, wherever we find the same difference (indicating same size of length and width) it constitutes a square. Complexity would be O(m^2+n^2) where m, n are sizes of the sets.
Interviewer agreed with the approach, asked to improve time complexity. Thought for a while but ran out of time, then we discussed a few approaches. I liked this question.
Feedback - Went very well, not much -ve feedback. Next 2 rounds scheduled a week later.

Problem solving round (1 hour)

Given a 2d matrix with positive and negative numbers find the largest submatrix with sum equal to 0. (Hard)
I found this question tough as it required a lot of ad-hoc logic. I gave a naive solution which checked all possible submatrices O(m^2 x n^2) Interviewer asked to improve on it, for the life of me despite quite a few hints could not find the right answer. After around 40 mins passed I was quite rattled and low on confidence. In the end with a lot of hints was somewhere close but could not give the right solution. Optimal solution has complexity O(m^2 x n)
I knew I had bombed this one.
Machine coding round (1 hour)
Don't know why they call this as the machine coding round as all rounds require working code. I knew I had no chance of passing because of the last round, so was quite nervous.

Given two lists of intervals return the final list with intersection of those intervals (Medium)
Ex - a = [[1, 4], [5, 7], [10, 15]], b = [[2, 3], [6, 8], [12, 17]]
Ans - [[1, 4], [5, 8], [10, 17]]
Merge sort approach. This was straightforward enough if you handle all the intersection cases properly. Question is on leetcode as well, coded up the solution and properly tested all possible edge cases. Interviewer also tested with some cases, was satisfied. This took up around 35 mins.
Given a matrix of 0s and 1s, find how many rectangles can be formed. A rectangle is a rectangular submatrix with all 4 corner points as 1 (Hard)
Example -
[[0,1,0,1],
[0,0,0,0],
[0,0,0,0].
[0,1,0,1]]
This has 1 rectangle (corners (0,1)(0,3)(3,1)(3,3))
Thought about it, came up with approach where we take all pairs of 1s treat them as a diagonal and check if corners have 1s, then we have a rectangle. Time complexity was higher than expected, would have worked well if it was a sparse matrix. Went for a column by column approach, kind of storing where we saw the 1s. Interviewer said I was on the right track, but it did not handle all the cases. Again got a few hints and with a lot of effort was kind of close to the approach but not quite.

I wasn't expecting to pass and surely a week later got an email saying they will not proceed with the next rounds.

Personal thoughts
Uber interviews are tough. Questions are of a good level and not to forget working code is required. HR had made it clear early on that even though it is SE2 position, focus will be more on coding than design etc. Overall interview process was very smooth, HR kept me updated, called to remind me on the day of the interview also shared interview feedback in detail. Interviewers were helpful and friendly as well.

I felt that a couple of questions (like 2nd round question) required some previous knowledge/ad-hoc logic without knowing which you could not have given the optimal solution for them and coded it up within an hour (in some cases 30 mins as 2 questions are asked). Though interviewers give you tips, but if you are thinking along a tangent it's difficult to make use of those hints. But I have no complaints.
Obviously there are brilliant candidates out there who can solve these questions and those are the ones Uber wants. I am not one of them, lol (for now!) Was very gutted and disappointed as I was confident about the later design rounds. However at the end of the day I knew I gave my best and that's what matters.

Tips
Practice, practice, practice! Uber is a tough nut to crack, only solving many questions will help. Also please keep giving mock interviews on leetcode, they simulate coding rounds real well. For both SE, SE2 focus most on coding questions. Solve Medium and Hard problems with proper working code. Solving mentally is not good enough.
by Expert (30,360 points)