[Uber - L5A] SSE interview experience
Anonymous User
10940

Reposting the experience as earlier one got flagged as I used names of interview prep resources

Round -1:
I appeared for Uber hiring drive around mid-May. The round was called 'screening' but seemed like a proper DSA round in which I was expected to give a working solution by the end of the round.

Question:
Given a n*m 2-D matrix with arrows in different directions, find out the minimum cost to travel from top-left grid to bottom-right grid if the cost to travel in the direction of the grid arrow costs you nothing but if you want to travel in any other direction, it would cost you 1 quantity.

Discussion:
I initially suggested a DFS approach, along with mentioning that it is brute force. Interviewer asked me to explain the approach and the time complexity of it. We spent sometime on the time-complexity bit, I suggested that it would be O(n^2 * m^ 2) but he argued that it should be something like O(4^x) since we can go in any of the 4 directions. Once that was settled, I very briefly thought of a DP based approach but quickly rejected that and suggested a graph based approach. I explained that I would construct a weighted(0,1 edge) graph as per the setup and then implement a Dijkstra solution to arrive at the answer. I was able to code it within 60 mins.

Round -2:
In this round, I was asked to find the next greater palindrome number of the given number. I had done a similar question before and was able to write a working solution by the end of the hour. The solution approach is unique (Mirror and Carry Propagation), but if you know that, it is relatively easy to code and to handle different scenarios.
(This is the standard “next greater palindrome” interview problem; plenty of online references use that exact wording.)

Round -3
In this machine coding round, I was asked to code an expiry counter. Given a class with methods like put_element(k), get_element_count(k) and get_total_elements(), implement the above methods after initialising a custom counter class with expiry time of 't' seconds.

This question kind of confused me since I was expecting some sort of producer-consumer(multi-threaded), parking lot, task scheduler etc kind of question as they are the most common. This question seemed to me more of a DSA style but I went ahead with the assumption. I suggested a priority queue along with hashmap based approach where I would add elements with their expiry timestamps to the PQ like (k1, t1), (k2, t2) etc. On the read operation, I would first remove the expired timestamps and then return the count of that element. For all elements read, I would do that for each element using the hashmap's keyset.
The interviewer didn't sound very convinced with this approach and asked me if I can do better. Then I suggested a binary search based approach in which I would just maintain a mapping of element to list of timestamps like 'k': [t1, t2, ... tn], on a specific element read, I would find the valid timestamps in O(logn). He found this 'fine' and asked me to code it up. I coded this in around 7-8 mins(python bisect rocks!) and ran the code which worked as expected. The interviewer questioned me on why am I not discarding the stale timestamps at the time of reading which is inefficient, I said we can do that, just got missed. This is the point I think I lost the interviewer as he kept on insisting on the point that I should have thought of this as a production system(without mentioning that in the question anywhere).

Eventually after coding and running both approaches, I came to know, a couple of days later, that the interviewer gave me a NO-HIRE.
I requested my recruiter multiple times to ask the HM to go through my submitted code, as there seemed to be some misunderstanding. The HM agreed to take the remaining 2 rounds and then decide. Phew!

Round -4:
This was the system design round and was taken by a Staff software engineer who was also the bar-raiser. He asked me to build a heat map of Uber drivers in a city and display this data in an internal dashboard for an analytics team in Uber. I need to cover the following 2 scenarios and make the appropriate assumptions. I need to think of this as a sub-system to focus on the actual problem at hand.

-The dashboard is needed for a near real-time usecase where you need to display the heatmap of the city for the past 20 mins.
-The dashboard is needed after 24hrs and should be bucketized by the hour.

I had read this question in one of the past interview experiences so had some idea but writing the FRs, NFRs, APIs took around 10-15 mins. I initially went for an in-memory counter approach in my Kafka consumers but discarded this line of thought considering that the input stream TPS is around 500,000. The final approach which I suggested for the first use-case involved consuming location events from a Kafka topic. The consumers would use a geo-hashing library to convert the lat,long into a geohash of a certain precision and then push these to a Kafka stream which would be partitioned by geohashId. An Apache Flink cluster would consume these geohashId bucketized stream and perform a count operation over a tumbling window of 1 min and finally persist this in a Redis cache. The second use-case would be covered by defining another Flink processor which would flush out the hourly aggregates in a PostGres DB.

The interviewer had minor questions around my use of DynamoDB(which I then changed to PostGres) and the way I was defining my Redis nested mappings. He asked me questions on scalability and fault-tolerance of the system but seemed satisfied with my overall approach.

Recruiter, after a couple of days, told me that my feedback was 'good'.

Round -5:
The interviewer was a TLM(Tech Lead Manager) and asked a couple of questions regarding the product I was working on at my current company and the company prior. Post the intro, he asked to use a virtual white board and to go over a complex/impactful project I had worked on/lead. He emphasized on the fact that he wants me to go over the details of every challenge I faced, technical and non-technical. After around 45 mins of kinda monologue, with just a couple of queries from his side, he seemed content with my contributions/impact.
Then he described the kind of work I can expect in case I'm selected and explained the product, why it is important, the upcoming AI use-cases etc. He asked me why I want to leave my current role and what type of work I'm looking for.

Verdict:
Around a week later, I got a call from the recruiter informing that even though I received a NH in one of the rounds, HM and BR were able to flip it in the final de-brief and they would be moving ahead with the offer! XD


Preparation
I started to prepare for this from mid-March onwards. I solved around 200+ questions on LC and read through maybe 20-30 more. I worked through roughly 70 % of a popular “top 150” problem list while solving the LC questions. For machine-coding, I practised 7-8 of the most frequently asked problems at Uber. For system-design prep, I used a paid practice platform that walks through FRs, NFRs, API contracts and design steps sequentially, and I also referred to the system design interview book for a few topics.

Apologies for a super-long post, brevity is a skill I surely lack, in the end I would just emphasize on some cliched stuff. Interview preparation can be a really frustating experience(I got my share of rejections from Google, Rippling, LinkedIn(inept interviewers)), but try to keep up the momentum. Don't over-stretch your preparation timelines because then the revision aspect gets tedious. Cracking an interview is a combination of hard work and luck, don't be too harsh on yourself if you get a few rejections, they just make you a stronger candidate for your next company!

Offer details: https://leetcode.com/discuss/post/6966567/uber-india-senior-software-engineer-l5a-aua4x/

Comments (10)