Urban Company Interview Experience by Sanyam Singhal | Full-Time | SDE | Virtual On Campus 2020

 URBAN COMPANY INTERVIEW EXPERIENCE (SDE)




Urban Company conducted a recruitment drive to hire Final year students for the role of Software Development Engineers. 

They allowed CSE, IT, ECE, EE from B.Tech and MCA, Mtech, MSc students were also allowed to register.

They did some shortlisting based on CPI, so initially, students having CPI >= 8 were only allowed. But later on, allowed some more students to have CPI near to 7.9.

So a total of only 72 students were shortlisted to take the online coding test.


Round 1: ONLINE CODING ROUND(2 hours)

This round was conducted on HackerEarth. It has 4 coding questions to be solved in 2 hours. The questions were as follows:- 



1.Given a matrix cost of size n,m. There are n ships each selling m different kinds of items. The ith store sells the jth item for Cij dollars. You decide to buy M-1 different types of items from each shop. If you want to have all M kinds of items in your shopping bag, then what is the minimum amount that you need to spend?- 20 PointsConstraints:- 1<= n, m <= 1000

Input:-

[[2, 3]

 [3, 5]]

Output :- 6 (3+3)

(At first look this question may seem complex but it was simple, you just need to leave the product’s kind which is of maximum price by ensuring that at least one of each kind is taken) 



2. Given an array of size n, where you need to find the minimum cost to cross the array (i.e. to jump to index >= n)

You are allowed to make a jump from index i to i+2 and i to i-1 where the cost of the jump is equal to arr[i]

(Hint:- can be done using either DP or Dijkstra Algo, I did it using DP) - 20 Points.



3.Given an array of size n, representing the lengths of sides of a triangle. You have to find the length of the longest subsequence where any pair of three sides makes a rectangle.

Constraints :- 3 <= n <= 10^5

Input :- 2, 3, 4, 5, 7, 10

Output :- 4 i.e. [2, 3, 4, 5]

(Hint - Sort the array as the order doesn’t matter and linearly iterate and select the first two sides for subsequence and find the last side using binary search with a condition that first+second > last) - 50 Points



4.The problem has a long description but it was basically a question on a weighted graph you are given n vertices (from 0 to n-1) with m weighted edges where weight denotes the distance among the vertices. 

Also given an array priority of size n-1 where priority[i] denotes the priority of vertex i+1.

You need to start from vertex 0 and go to the adjacent vertices with the highest priority until there is some unvisited adjacent current vertex and backtrack if not. (i.e. basically a DFS type of traversal but we also need to add the distance when going back from a vertex).

Find the total distance traveled in visiting all the vertex of the graph.

(Hint:- First I made the adjacency list for the graph, and for every vertex, i sorted its adjacency list on the basis of priority of nodes in that list in decreasing order, then just write the code for DFS with some extra conditions to handle this). - 50 Points.


I was able to solve Q2 and Q4 completely and a few test cases for Q1 and Q4.

Around 25 students were shortlisted for further interview rounds.

Students who solved one 20 Points question and partial (50% test case) one 50 marks question were shortlisted.



Round 2: Technical Interview(1 hour) - DSA + Core Subjects

The interview rounds were conducted virtually on Google meet, the next day of the coding round in the morning. He shared a link to an online editor where I need to write the code.


1.The interviewer first introduced himself and what he works on in UC then asked me to tell me something about myself.

2.Then he directly jumped to the coding question, the question was this

https://www.geeksforgeeks.org/k-th-missing-element-in-sorted-array/

First I discussed the Naive approach with time complexity in O(N) and then

asked me to optimize it. I took some time to think and then explained my binary  

search approach and wrote its code.

3.Then he asked about Inheritance, I explained it with an example.

4.What is Normalization and different normal forms (1NF, 2NF, 3NF) - I explained all of them with some examples.

5.Then he asked how was the online coding test and asked me to tell the approach for Q3. (Although I was not able to solve it completely in the coding round I have a habit of discussing the question with my friends after the contests and I did the same this time which helped me during the interview).


At the end of the interview, I asked him some questions related to the work he does and works freshers get to do when they join the company.

The interviewer was very helpful and helped me in identifying the edge cases for binary search solution in the first question. 

So overall, I was able to answer all of his questions and he seemed satisfied with my answers. 

Around 19 students were shortlisted for the next round.



Round 3: Technical Interview(1 hour) - Project Round/Knowledge Round

1.First, he introduced himself and asked me to do the same.

2.He asked me to explain about my internship project at SAP Labs and asked a few questions like what was the project about, what was my contribution, and a few more project-based questions.

3.Then he jumped to my personal project, where first I explained to him about my project and then he asked multiple questions on the project like what you did for handling this, then he gave some scenarios and asked what will do in this case.

Also asked me to write a basic code like how to create a thread in Java.


4.Next, he asked me a question to write a SQL query.(Not an easy one)

Given two tables 

Warehouse(name, product_id, units) and 

Products(product_id, product_name, Width, Length, Height) 

where (name, product_id) and (product_id) are the primary keys respectively.

Write a SQL query to find the volume in cubic feet for every warehouse_name

(My solution was to join the two tables and use ‘group by’ on the table formed after joining, and then just some basic select statement on that.)


5.Last, gave a code snippet and asked me to explain and tell the time complexity for that. ( I explained it with the complete derivation of time complexity).


At the end of the interview, he asked if I have any questions for him.

I asked a few questions about work and projects.


Initially we were told that there will be an HR round, but they didn’t take that for anyone and ended the interviews after this round.

The results were announced the next day in the morning and finally, only 3 students were selected and I was one of them.


Some tips based on my experience:- 

Whatever you are explaining to the interviewer, always try to explain it with an example and write something on screen/paper. Keep the interview as a two-way communication so that if they are not understanding something in your solution you can stop and re-explain it.

Don’t get demotivated or lose hope due to rejection in the interviews, I know it’s very hard to deal with rejections but sometimes it is because of a mistake which you could have avoided or sometimes it is just because of luck. So better start analyzing your mistake and learn from them - “Never repeat the same mistake”

Clearing the online coding round is the first and foremost step, so I will suggest to do a lot of practice and give as many short contests as possible, that will help you to improve your speed and accuracy.



Sanyam Singhal

IT 2k21

https://www.linkedin.com/in/sanyam-singhal-/





Comments