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 | 9 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 12 months
Topics: OOPS, Graph, Dynamic Programming, Operating System, Data Structures, Databases
Tip
Tip

Tip 1 : Have a good understanding of computer science fundamentals.
Tip 2 : Have in-depth knowledge of the technologies used in the projects.
Tip 3 : Practice as many questions as you can and give mock interviews to build confidence.

Application process
Where: Referral
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1 : Have some variety in the projects, don't have all projects using the same technology.
Tip 2 : Make sure it is up to date at the time of applying.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date23 Jan 2022
Coding problem3

Normal Coding round on Harckerrank in the night

1. Maximum Area Square

Moderate
10m average time
90% success
0/80
Asked in companies
Urban Company (UrbanClap)FreshworksBNY Mellon

You have been given a non-empty grid ‘MAT’ consisting of only 0s and 1s. Your task is to find the area of maximum size square sub-matrix with all 1s.

If there is no such sub-matrix, print 0.

For example, for the following grid:

Input

The area of the largest square submatrix with all 1s is 4.
Problem approach

Standard problem, went ahead with the dp approach and solved.

Try solving now

2. Count Customers Who Did Not Get A Computer

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

Mr. X runs an internet cafe which has 'K' computers. His internet cafe has 'N' customers who can come anytime throughout the day. Initially, all the 'K' computers are available for customer use. When a customer enters the cafe he first checks whether any available computer is there. If he finds one he starts using it and it is marked unavailable. When he leaves the cafe that computer is again marked as available. If the customer is not able to find any available computer he leaves the cafe immediately.

You are given an integer array ‘ARR’ in which each value occurs exactly 2 times, the index of the first occurrence of any value denotes the arrival time of the customer while the second occurrence denotes the departing time of the customer. Your task is to find the no. of customers who were not able to find any available computer and had to leave the cafe immediately.

For example :
Consider the sequence of customers as [ 1, 2, 3, 2, 3, 1 ] for N = 3 and K = 2.

The procedure takes place as follows :
1) At the start, Customer 1 comes and finds an available computer and starts using it and now the number of available computers is reduced by 1. 

2) Customer 2 comes and he is also able to find an available computer and he starts using the computer. Now all the computers are unavailable.

3) Customer 3 comes and goes back immediately as there are no computers available currently. 

4) Customer 2 leaves the cafe making 1 computer available. 

5) As customer 3 has already left no new computers are made available.

6) Customer 1 leaves the cafe and all the computers are again available. 

As only Customer 3 was unable to find any available computers therefore the answer is 1 for this case.
Problem approach

Sorted the order list and used the priority queue to take order one by one and calculate the answer.

Try solving now

3. Tiling Problem

Hard
45m average time
0/120
Asked in companies
OptumOlaAdobe

You have been given a board where there are '2' rows and 'N' columns. You have an infinite supply of 2x1 tiles, and you can place a tile in the following ways:

1. Horizontally as 1x2 tile
2. Vertically as 2x1 tile

Count the number of ways to tile the given board using the available tiles.

Note :
The number of ways might be large so output your answer modulo 10^9 + 7.

Here an example of tile and board for 'N' = 4 :

Tiling Example

Problem approach

Tried solving it using deque was only able to pass half of the test cases.

Try solving now
02
Round
Easy
Video Call
Duration60 minutes
Interview date31 Jan 2022
Coding problem2

The round was scheduled at 12 noon.

1. Topological Sort

Moderate
30m average time
70% success
0/80
Asked in companies
MicrosoftSamsungSprinklr

A Directed Acyclic Graph (DAG) is a directed graph that contains no cycles.

Topological Sorting of DAG is a linear ordering of vertices such that for every directed edge from vertex ‘u’ to vertex ‘v’, vertex ‘u’ comes before ‘v’ in the ordering. Topological Sorting for a graph is not possible if the graph is not a DAG.

Given a DAG consisting of ‘V’ vertices and ‘E’ edges, you need to find out any topological sorting of this DAG. Return an array of size ‘V’ representing the topological sort of the vertices of the given DAG.

For example, Consider the DAG shown in the picture.

alt tex

In this graph, there are directed edges from 0 to 1 and 0 to 3, so 0 should come before 1 and 3. Also, there are directed edges from 1 to 2 and 3 to 2 so 1 and 3 should come before 2.

So, The topological sorting of this DAG is {0 1 3 2}.

Note that there are multiple topological sortings possible for a DAG. For the graph given above one another topological sorting is: {0, 3, 1, 2}

Note:
1. It is guaranteed that the given graph is DAG.
2. There will be no multiple edges and self-loops in the given DAG.
3. There can be multiple correct solutions, you can find any one of them. 
4. Don’t print anything, just return an array representing the topological sort of the vertices of the given DAG.
Problem approach

Used the BFS approach to implement it, the interviewer was satisfied.

Try solving now

2. Cooking Ninjas

Moderate
25m average time
75% success
0/80
Asked in company
Urban Company (UrbanClap)

In Ninja Land, there is a famous restaurant named ‘CookingNinjas’. There are ‘N’ cooks in ‘CookingNinjas’ numbered from 0 to N-1. Each cook has rank ‘R’ (1 <= R <= 10).

A cook with a rank ‘R’ can prepare 1 dish in the first ‘R’ minutes, 1 more dish in the next ‘2R’ minutes, 1 more dish in next ‘3R’ minutes, and so on (A cook can only make complete dishes) For example if a cook is ranked 2. He will prepare one dish in 2 minutes, one more dish in the next 4 mins and one more in the next 6 minutes hence in a total of 12 minutes he can make 3 dishes, Note, In 13 minutes also he can make only 3 dishes as he does not have enough time for the 4th dish).

One day ‘CookingNinjas’ receive an order of ‘M’ dishes that they need to complete as early as possible. You are given an integer array ‘rank’ of size ‘N’ in which ‘rank[i]’ gives ‘rank’ of ith cook and an integer ‘M’, You need to find out the minimum times required to complete this order of ’M’ dishes.

Note
One dish can be prepared by only one cook, however, two or more cooks can simultaneously prepare different dishes.
For Example
Let ‘N’ = 4,  ‘ranks’ = [1, 2, 3, 4] and ‘M’ = 11.  Then the minimum time required to cook 11 dishes will be 12 minutes.  The cooks should prepare dishes in the following manner -:
Cook-0 prepare 4 dishes in 10 minutes i.e (1 dish in 1 minute, 1 more dish in next 2 minutes, 1 more dish in next 3 minutes, 1 more dish in next 4 minutes).
Cook-1 prepare 3 dishes in 12 minutes i.e (1 dish in 2 minutes, 1 more dish in 4 minutes, 1 more dish in 6 minutes).
Cook-2 prepare 2 dishes in 9 minutes i.e (1 dish in 3 minutes, 1 more dish in the next 6 minutes).
Cook-3 prepare 2 dishes in 12 minutes i.e (1 dish in 4 minutes, 1 more dish in the next 8 minutes).
If all four cooks work simultaneously then they can prepare(4 + 3 + 2 + 2 = 11) dishes in 12 minutes. And it is the minimum possible time.
Problem approach

I went ahead with the BFS approach, and the interviewer was satisfied.

Try solving now
03
Round
Medium
Video Call
Duration60 minutes
Interview date1 Feb 2022
Coding problem1

It was more an Object oriented Design round.

1. System Design Question

Design a coffee vending machine. Come up with all the classes and methods needed for it.

Problem approach

Tip 1 : Figure out all the requirements in the start and the scope of the design as it is a very open-ended problem.
Tip 2 : Try to write neat code, use descriptive names for variables.
Tip 3 : May ask you to run the code so if you are not implementing complete methods try to just declare then and return null to make the code work. Also the code might get very huge so try to run it time to time to catch errors.

04
Round
Easy
Video Call
Duration60 minutes
Interview date2 Feb 2022
Coding problem3

1. Operating System Question

What is virtual memory?
What is threading?
What is context switching?

Problem approach

Tip 1 : Have good understanding of OS.

2. Operating System Question

What is virtual dom and how it works in react?

Problem approach

Tip 1 : I had React in my resume thus this question appeared. Have good understanding of all technologies mentioned in the resume.

3. Technical Question

Behavioural question about leadership and team-bonding.

Problem approach

Tip 1 : Show positive attitude, willingness to work in team etc.
 

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)
779 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