Urban Company (UrbanClap) interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Urban Company (UrbanClap)
upvote
share-icon
4 rounds | 13 Coding problems

Interview preparation journey

expand-icon
Journey
Truly Speaking, I was not fond of this world of computer science but anyhow I got admitted to B.Tech in Computer Science. Firstly I planned that I will start learning DSA in the first year but I could not. So, I started DSA in the fourth semester and along with DSA, I also learned development because that is what I wanted to be (A web Developer). By the end of the Third year, I was confident in both DSA and development but even then I keep on revising the concepts. I had contact with my friend who was working in Urban Clap I asked him for a referral and that is all a wrap to my journey.
Application story
At the start of my fourth year of graduation, some of my friends were already placed in various companies. It started to worry me that I was the one who had not even tried for an interview till then. Then, One day I saw an opening in the UrbanClap. So, I contacted my old childhood friend, who was already placed in UrbanClap, to get a referral, and I got one. After that, the interview process was scheduled.
Why selected/rejected for the role?
I think my skills and knowledge were up to the mark and they found me a valuable candidate. Moreover, my communication skills added up to my numbers.
Preparation
Duration: 3 months
Topics: Data Structures, OOPS, Dynamic programming, Algorithms, DBMS, OS
Tip
Tip

Tip 1 : Learn the concepts, not the solutions.
Tip 2 : You should have deep knowledge about the projects mentioned in your resume.

Application process
Where: Referral
Eligibility: None
Resume Tip
Resume tip

Tip 1 : Resume should be only 1 page.
Tip 2 : Try to tell a story through your resume. For eg - always mention the impact or scale of your projects/internship.

Interview rounds

01
Round
Medium
Online Coding Test
Duration75 minutes
Interview date11 Oct 2020
Coding problem3

The test had 3 questions which had to solved in 75 minutes.The test was of medium difficulty.

1. Meetings II

Moderate
10m average time
90% success
0/80
Asked in companies
BNY MellonAmazonIBM

Stark Industry is planning to organize Stark Expo, for which various departments have to organize meetings to check their preparations. Since Stark Tower has limited rooms available for the meeting, Tony decided to allot a room to each meeting so that all the meetings are organized in the least possible conference rooms, and a the moment, only one meeting will happen in one room. So, he asked JARVIS to allot each meeting a room and tell the minimum number of conference rooms to be reserved. But, since JARVIS was busy rendering another Iron Man suit model, he asked you to help.

You are given an array of integers ARR of size N x 2, representing the start and end time for N meetings. Your task is to find the minimum number of rooms required to organize all the meetings.

Note:

1. You can assume that all the meetings will happen on the same day.
2. Also, as soon as a meeting gets over if some other meeting is scheduled to start at that moment, they can then be allocated that room.

Note:

Try to solve the problem in linear time complexity.

For Example:

Consider there are three meetings scheduled with timings:
1pm - 4pm
3pm - 5pm
4pm - 6pm

At the start of time, meeting 1 will be allotted room 1, which will be occupied till 4 pm hence for meeting 2 we’ll have to provide another room. At 4 pm, meeting 3 can be organized in room 1 because by that time, meeting 1 would have ended. Hence we’ll require two rooms for holding all three meetings.
Problem approach

Step 1 : Created 2 arrays for start time and end time and sorted them.
Step 2 : Applied merge 2 sorted arrays to get a sorted array technique to find the minimum rooms required.
Step 3 : If the start time is less than the end time, I incremented the number of rooms required else I decremented the
number of rooms required.I also kept track of maximum rooms required at any instance of time

Try solving now

2. Find a value whose XOR with a given value is maximum.

Easy
20m average time
80% success
0/40
Asked in companies
OptumUrban Company (UrbanClap)American Express

You are given an integer 'X' and your task is to find an integer 'Y' such that the bitwise XOR of the integers 'X' and 'Y' give the maximum possible value. The integer 'Y' should not be greater than 2305843009213693951 ((2^61) - 1).

A bitwise XOR is a binary operation that takes two bit patterns of equal length and performs the logical exclusive OR operation on each pair of corresponding bits. The result in each position is 1 if only one of the bits is 1, but will be 0 if both are 0 or both are 1.

Note:

1. The maximum obtainable value can always be stored in 64-bit memory space.
2. The given number 'X' is always non-negative.
Problem approach

Step 1 : Sort the array.
Step 2 : Xor all elements of the array.
Step 3 : Remove maximum element from xor by doing xor_array ^= current_max_element.
Step 4 : return the resultant array.

Try solving now

3. Minimize the maximum difference between adjacent elements in an array

Easy
15m average time
85% success
0/40
Asked in companies
Urban Company (UrbanClap)AmazonSprinklr

You are given a non-decreasing array and an integer K. You need to remove exactly K integers from the given array such that the maximum difference between adjacent elements is minimum.

For example:
If the given array is: [2 6 7 7 10] and K = 2. We need to remove A[0] = 2 and A[4] = 10, then the resultant array would become [6 7 7], where the difference between adjacent pairs are {1, 0}. Thus our answer would be 1. You can see that there would not be any better answer than 1 for this array
Problem approach

The first observation I had was what would I do if the first and last elements were not fixed. I was not able to solve this question completely, hence I used brute force approach(provided in above link) to pass some of the test cases.

Try solving now
02
Round
Easy
Video Call
Duration60 minutes
Interview date14 Oct 2020
Coding problem3

The interview was taken by SDE2 and she was very friendly. All the questions asked were related to DS and algo. The first 10 minutes were used for introductions and the last 5 minutes were reserved for any questions that I have. Always try to ask meaningful questions at the end of the interview.

1. Frequency in a sorted array

Easy
15m average time
85% success
0/40
Asked in companies
OlaAdobeMcAfee

You are given a sorted array 'ARR' and a number 'X'. Your task is to count the number of occurrences of 'X' in 'ARR'.

Note :
1. If 'X' is not found in the array, return 0.
2. The given array is sorted in non-decreasing order.
Problem approach

Step 1 : Provided the linear search solution then I was asked what if the array is sorted?
Step 2 : Since the array is sorted used lower bound and upper bound to find the frequency of the given element

Try solving now

2. Rotting Oranges

Moderate
20m average time
78% success
0/80
Asked in companies
IBMSliceSamsung R&D Institute

You have been given a grid containing some oranges. Each cell of this grid has one of the three integers values:

  • Value 0 - representing an empty cell.
  • Value 1 - representing a fresh orange.
  • Value 2 - representing a rotten orange.
  • Every second, any fresh orange that is adjacent(4-directionally) to a rotten orange becomes rotten.

    Your task is to find out the minimum time after which no cell has a fresh orange. If it's impossible to rot all the fresh oranges then print -1.

    Note:
    1. The grid has 0-based indexing.
    2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.
    
    Problem approach

    I told the interviewer I had already seen this question. Hence I quickly informed here about the concept of multi-source BFS to find the minimum time such that all oranges become rotten.

    Try solving now

    3. Clone Linked List with Random Pointer

    Easy
    10m average time
    90% success
    0/40
    Asked in companies
    Urban Company (UrbanClap)AmazonMeesho

    Given a linked list having two pointers in each node. The first one points to the next node of the list, however, the other pointer is random and can point to any node of the list or null. The task is to create a deep copy of the given linked list and return its head. We will validate whether the linked list is a copy of the original linked list or not.

    A deep copy of a Linked List means we do not copy the references of the nodes of the original Linked List rather for each node in the original Linked List, a new node is created.

    For example,

    example

    Random pointers are shown in red and next pointers in black.

    Problem approach

    Step 1 : Assumed that there is no random pointer present, hence I was able to easily come with the solution to clone a normal linked list.
    Step 2 : I was then asked can I do it in constant space, I was able to come up with the logic but wasn't able to code it.

    Try solving now
    03
    Round
    Medium
    Video Call
    Duration60 minutes
    Interview date17 Oct 2020
    Coding problem3

    The focus of this round was mainly on my projects and internships. It was taken by a Senior SDE and it more of a technical interaction. I was asked in-depth about my projects and most of the questions asked around OS/DBMS were based on my projects.
    The interviewer wanted to judge whether I have core knowledge about subjects like OS and DBMS and also about the projects that I had done.

    1. DBMS

    Two Questions: -

    1. How would you optimize a database?
    2. Difference between Relational vs NoSQL.

    Problem approach

    Tip 1: Ask follow up questions because sometimes the interviewers give very little information to see how the candidate would approach the problem
    Tip 2: GeeksforGeeks is a really good reference for DBMS.
    Tip 3: In the above question interviewer expected indexing, normalisation as the main answer.

    2. DBMS

    You have an e-commerce website. You have to find the closest warehouse to the customer's address. How would you index your database based on latitude and longitude to find the closest warehouse?

    Problem approach

    Tip 1: The interviewer doesn't expect bookish answer, they are more interested in your thinking process
    Tip 2: The answer for this question is geo-spatial indexing(the name is not important, how you reached the solution is important.

    3. DBMS/OS

    You have a large database(100s of TB).Now you have to apply some formatting to it and copy it to another database.
    How would you do it?

    Problem approach

    Tip 1: Always ask follow up questions for such abstract questions
    Tip 2: Before jumping to the solution try to identify the problem you might have.
    In this question first thing that comes to mind is just copy data from one DB to another.
    But the problem is we cannot have such a huge physical memory.

    My solution was reading the database in chunks, then formatting it and finally copying it to new database.
    Follow up question - How would you increase the efficiency in terms of time?
    Answer - Multithreading

    Then another question was asked - Is it possible that the process would stop executing?
    Answer - Yes, Since we are writing data in a new database, before writing the thread has to acquire a lock to access the database, so if this thread gets killed somehow, other threads will not be able to acquire the lock to write in the new database.

    04
    Round
    Easy
    HR Round
    Duration60 minutes
    Interview date17 Oct 2020
    Coding problem4

    It was the culture fit round taken by the Director of Engineering.

    1. What did you learn in your internships?

    Problem approach

    Tip 1: Always follow STAR method while answering such questions.
    Tip 2: Be as authentic as possible.

    2. What role did you play in your projects?

    Problem approach

    Tip 1: Try to show your leadership and management skills while answering such questions.

    3. Why do you want to join our company?

    Problem approach

    Tip 1: Do a thorough research about the company, read about recent press conferences, core values etc.
    Tip 2: Do not give generic answers and never mention money.
    Tip 3: Try to show how your personal goals align with the company's goals.

    4. System Design

    Design a card game. OOD was required in this question.

    Problem approach

    Tip 1: Try to create a structure(entities required etc.) before answering the question and think loudly
    Tip 2: Read about SOLID principles
    Tip 3: Try to think of scalability questions on your own while approaching the problem.

    Here's your problem of the day

    Solving this problem will increase your chance to get selected in this company

    Skill covered: Programming

    What is recursion?

    Choose another skill to practice
    Similar interview experiences
    SDE - 1
    3 rounds | 5 problems
    Interviewed by Urban Company (UrbanClap)
    3460 views
    0 comments
    0 upvotes
    SDE - 1
    4 rounds | 6 problems
    Interviewed by Urban Company (UrbanClap)
    0 views
    0 comments
    0 upvotes
    SDE - 1
    2 rounds | 3 problems
    Interviewed by Urban Company (UrbanClap)
    778 views
    0 comments
    0 upvotes
    SDE - 1
    3 rounds | 6 problems
    Interviewed by Urban Company (UrbanClap)
    809 views
    0 comments
    0 upvotes
    Companies with similar interview experiences
    company logo
    SDE - 1
    5 rounds | 12 problems
    Interviewed by Amazon
    114579 views
    24 comments
    0 upvotes
    company logo
    SDE - 1
    4 rounds | 5 problems
    Interviewed by Microsoft
    57825 views
    5 comments
    0 upvotes
    company logo
    SDE - 1
    3 rounds | 7 problems
    Interviewed by Amazon
    34961 views
    7 comments
    0 upvotes