Interview Experience: Uber

Piyush Rathi
10 min readMar 14, 2019

Hey guys, I am Piyush Rathi, a 3rd year BTech student of the Department of Computer Science and Engineering. I will be doing my internship at Uber Bangalore in the summers of 2019. After reading this, if you have any queries, feel free to ping me on Facebook.

Preparation

In my 3rd semester, as I started learning Algorithms, I started developing an interest in it and hence started off with Competitive Programming from 3rd sem itself. I started solving questions on SPOJ and HackerRank. After a while, I started doing questions on Codeforces(CF). I kept doing problems occasionally on CF during the 4th sem also.

I decided not to do an internship in summer break because I did not think that I would be able to keep up with the internship and the preparation of interviews simultaneously. In the month of May, I decided to do CF Div 2 D problems from a2oj. I did that to increase my ability to handle tough questions.

In the start of the month of June, as I got in touch with some seniors, I realized that the type of questions asked in interviews are quite different when compared to what I had been doing(although they do help you in coding rounds). So, then I started doing questions on Geeksforgeeks and Interviewbit. Since I already had enough grasp on topics like DP, greedy, graphs, etc., I started focusing more on topics like stacks, queues, two pointer method, BST, linked list, etc., good questions to all which can be found easily on GFG and IB. Since I had a habit of solving Div2 D questions, I found the questions on GFG and IB much easier to tackle, and hence doing CF did turn out to be quite useful.

I also started studying OOPs concepts in C++ from learncpp(a really helpful and easy place to learn them all).

Coding Rounds

Coding rounds of CDC started a week before Day 1 of Internships. I sat for the coding rounds of all the companies of Day 1 and was pretty (over)confident that I’d get shortlisted in most if not all of them. But, I couldn’t have been more wrong; in many of the coding rounds, I messed up in one way or another, like not considering enough test cases or not having enough speed from the start, or something else. As things turned out, I was shortlisted for only three companies: Uber, Nutanix, and Goldman Sachs( I gave my priority order for Day 1 interview rounds in that order).

The reason I could find out for not being able to perform well in these coding rounds was a lack of practice of problem-solving in limited time and in fact a lack of practice in general because now that I recall solving the questions on Interviewbit, I realize that I used to skip through a lot of questions because I thought they were easy and mostly because I was lazy and hence I did not have enough practice of topics like linked list, BST, etc. So, I would recommend having as much practice as you can have of questions of Interviewbit(actually implement the solutions and don’t just skip through them after thinking of the logic).

In Uber’s coding round, there were three questions out of which, I was able to solve two in the given time. The first question was a shortest-path problem which very few people could do, and of those who could, most did not find enough time to solve other questions and hence did not get shortlisted. I figured out that the first question was tricky quite early, so I didn’t waste any more of my time on it which gave me an upper edge on a lot of other students. So, it is really important to know what questions will take time and plan out accordingly. The second question was a topological sort problem and the third one was a simple math based ad-hoc problem but it required taking care of a lot of corner cases.

Interview Rounds

I put Uber first in my priority order not just because I wanted to get into it but also because I had heard that the interviews of Uber are generally too tough, so I thought my chances of getting into it are really thin and hence what I wanted from Uber was a good experience so that I could use it for Nutanix and GS. But I couldn’t have been more wrong; not just regarding my notion of rounds being too tough but also of thinking that I would definitely get time to sit for other companies because by the time my Uber’s rounds were over, it was almost 3 PM and most of the companies were already done with their process, so had I not got selected in Uber, I might not have gotten an intern on Day 1at all. So, (this should definitely go without saying) always put the company you want to get into the most at the top of your priority order.

One more thing I would like to put a lot of emphasis is having as much sleep on the night before Day 1 as possible(most of you would get a chance to have that) and not going to the interviews with an empty stomach. The reason I am putting this so strongly is that I have seen people messing up their rounds just because they were too sleep-deprived and hungry to even think properly during interviews. Trust me, after months of putting in the efforts, you definitely do not want your carelessness to be the reason of not getting selected, knowing that you had the potential.

Before the round, I had a small interaction with the HR of Uber(who was really really chill) which really helped me a lot. As I have mentioned, I had a lot of preconceptions about the questions in Uber’s interview, so I was really panicking before the rounds which this HR guy sensed during our talk and told me a lot of things, one of which I remember was that the feedback he has got from the students of other colleges he has been to was nothing like that and that none of them had found the rounds to be that tough. It was this conversation with the HR that boosted my confidence. So, try to be as friendly as possible with the HR of the companies.

Round 1:

There was only one interviewer in each of the rounds. This first interviewer of mine was pretty chill and it was easy to communicate with him. We started off with a basic introduction of the two of us to each other: he told me what his role at Uber is and what does his team does overall.

He told me the question: that I had to come with logic to implement the Minesweeper game. He explained to me how a game of minesweeper is played and asked me a brief overview of what Data Structures I plan upon using to store different aspects and states of the game. I told him everything pretty quickly and then he asked me about the actual pipelining or the flow of logic that I would use. During all of this, as it was easy to communicate to him, I kept asking him any doubts that I was getting and I was thinking everything out loud so that I could tell him where I was with my thoughts which would help him to give me some hints and also he kept asking me enough questions so as to guide my thought process. In the end, I also told him the different functions I would implement and what they would do, to sum everything up.

Next, he asked me to come with a logic of a bot that would play that game and finish it with as much efficiency and chances as possible. I found this part harder than the first part because there were so many ways in which one could proceed with their logic. After thinking about it for 2–3 minutes, I told him what I had come up with, on which he asked me how I can make some changes to make it more efficient, and so, I made some changes and again told him and then again he asked me to do the same, and this again happened once or twice, after which he was pretty satisfied with what I had. Also, during all of this, I kept telling him what the time and efficiency tradeoffs would be with the different changes I was making with the logic.

Next, he asked me to write the code for the first part(only the logic part of the game) to which I asked me if I have to write Object Oriented code, to which he said that, that would be better. So they were expecting me to have a knowledge of OOPs concepts in C++ or Java. I wrote the code in C++ with proper classes, objects, functions, elaborate variable names, comments, etc with which he was satisfied. My overall code was of 6 pages and I kept rectifying the mistakes I was making while writing it.

The round went on for 60–70 minutes around.

Round 2:

I found it difficult to communicate with my second interviewer, and hence I really struggled with an otherwise medium level question. The question was that given a number c, how many ordered pairs of (a, b) exist such that a = b + c (I said a + b = c in the interaction seminar, but that was wrong), and bitwise a&b = 0.(Here the size of a and b are limited to some predefined values so that the total number of solutions don’t become infinite.)

Initially, I thought that question is math based and hence I wasted 5–6 minutes thinking in that direction only. After that, I realized that the question can be solved using DP as the question had an overlapping subproblem type structure. But after that, as I was so sleep-deprived and had already become nervous because of all the time I had wasted, I couldn’t come up with a recurrence relation totally on my own. The interviewer had to give me 2–3 hints and after that only could I write the proper recurrence relation for the DP.

After that, he asked me the time and space complexities of the solution and also to write the pseudocode for it. The interview went on for around 30–40 minutes overall.

After the Round 2, the HR guy came to have a talk with me and told me that the first interviewer was quite interested to take me in, whereas the second one was a bit reluctant, so they were making an exception for me and planning upon having one more round for me.

Round 3:

The third interview started rather quickly without much of an introduction, and she quickly told me what the question was. The question was a simple graph-based question that could be solved using DFS. Then she modified the same question to make it a bit tougher than the original one. But again, it was easy enough and could be handled using BFS.

Then came the third question which was again a level up from the last question and from what I recall it was: Given an N*N grid, with some cells that are blocked, give the shortest path to reach from (1, 1) to (N, N) such that you can enter at most one blocked cell. After thinking for some time, I came up with a solution with which she was satisfied.

Then came the fourth one which again was a level up from the last one yet again and had a slight modification which was that instead of going through just one obstacle, now you are allowed to pass through at most K of them. It took me 2–3 minutes to come up with a solution(which I later got to know was of exponential time complexity) for this part and after explaining it to her and giving some examples to show how it would work, she was convinced. She then asked me to write a pseudo code for the problem, which I did and hence bringing an end to the final round that went on for around 20–25 minutes.

After some 5 minutes only, the HR guy came and told me that they have decided to take me in and asked me if I would like to accept the offer, which I readily did.

Remarks

  • While writing the code in the interview, make sure to write a very neat and clean code, with self-explanatory variable names, function names, etc.
  • I have a first-hand experience of ruining the interview because of panic. Although I do agree that it is not always possible to avoid that, I’d still say that it can be done in certain cases. A good way to avoid panic may be thinking out loud so that the interviewer can let you know if you are going in the right direction or not.
  • To practice CP(and to prepare for interviews), I’d recommend to not solve questions on too many platforms. Rather, just do it on one or two platforms of your choice because that way it becomes easier to keep track of things, and that also helps you in covering the whole spectrum of topics to be covered much easily. My choice of platforms as I have already mentioned was Codeforces, Interviewbit, and Geeksforgeeks.

📝 Read this story later in Journal.

🗞 Wake up every Sunday morning to the week’s most noteworthy Tech stories, opinions, and news waiting in your inbox: Get the noteworthy newsletter >

--

--