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

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data Structures and Algorithms, Operating System, Object-Oriented Programming, Low-Level System Design, Web Development
Tip
Tip

Tip 1 : Be confident in what you answer. It's never necessary to give the best solution on the first try. You should come to the final answer constructively.
Tip 2 : Study your resume thoroughly. You should know the details of what you have done and related topics.
Tip 3 : Practice DSA enough to be on a stage where you can create solutions of your own, be it any level

Application process
Where: Campus
Eligibility: 7 GPA
Resume Tip
Resume tip

Tip 1 : Keep it crisp and add details that are relevant to the job you are applying for.
Tip 2 : Try to add the latest working projects with live links so that you can show the proof & working of your awesome work.

Interview rounds

01
Round
Medium
Online Coding Test
Duration90 Minutes
Interview date13 Aug 2021
Coding problem3

It was a medium-level round with 3 DSA questions.

1. Amazing Strings

Easy
15m average time
85% success
0/40
Asked in companies
Urban Company (UrbanClap)D.E.ShawFlipkart limited

Shrey has just arrived in the city. When he entered the city, he was given two strings. Now, after arriving at his college, his professor gave him an extra string. To check his intelligence, his professor told him to check if the third string given to him has all the characters of the first and second strings in any order. Help Shrey before his professor scolds him. He has to answer “YES” if all characters are present else “NO”.

Example: ‘HELLO’ and ‘SHREY’ are two initial strings, and his professor gave him ’HLOHEELSRY’. So, here all the characters are present, so he has to say “YES”.

Note: The strings contain only uppercase Latin characters.

Try solving now

2. Chocolate Problem

Moderate
15m average time
85% success
0/80
Asked in companies
EcomExpressIBMMicrosoft

Given an array/list of integer numbers 'CHOCOLATES' of size 'N', where each value of the array/list represents the number of chocolates in the packet. There are ‘M’ number of students and the task is to distribute the chocolate to their students. Distribute chocolate in such a way that:

1. Each student gets at least one packet of chocolate.

2. The difference between the maximum number of chocolate in a packet and the minimum number of chocolate in a packet given to the students is minimum.

Example :

Given 'N' : 5 (number of packets) and 'M' : 3 (number of students)

subsequence

And chocolates in each packet is : {8, 11, 7, 15, 2}

All possible way to distribute 5 packets of chocolates among 3 students are -

( 8,15, 7 ) difference of maximum-minimum is ‘15 - 7’ = ‘8’
( 8, 15, 2 ) difference of maximum-minimum is ‘15 - 2’ = ‘13’ 
( 8, 15, 11 ) difference of maximum-minimum is ‘15 - 8’ = ‘7’
( 8, 7, 2 ) difference of maximum-minimum is ‘8 - 2’ = ‘6’
( 8, 7, 11 ) difference of maximum-minimum is ‘11 - 7’ = ‘4’
( 8, 2, 11 ) difference of maximum-minimum is ‘11 - 2’ = ‘9’
( 15, 7, 2 ) difference of maximum-minimum is ‘15 - 2’ = 13’
( 15, 7, 11 ) difference of maximum-minimum is ‘15 - 7’ = ‘8’
( 15, 2, 11 ) difference of maximum-minimum is ‘15 - 2’ = ‘13’
( 7, 2, 11 ) difference of maximum-minimum is ‘11 - 2’ = ‘9’

Hence there are 10 possible ways to distribute ‘5’ packets of chocolate among the ‘3’ students and difference of combination (8, 7, 11) is ‘maximum - minimum’ = ‘11 - 7’ = ‘4’ is minimum in all of the above.
Problem approach

It can be solved with Backtracking but the ideal way is to use Binary Search.

Try solving now

3. All prime numbers

Moderate
0/80
Asked in companies
Urban Company (UrbanClap)QualcommHackerEarth

Given an integer N, print all the prime numbers that lie in the range 2 to N (both inclusive).

Try solving now
02
Round
Easy
Video Call
Duration60 Minutes
Interview date16 Aug 2021
Coding problem3

It was scheduled after lunch and was mainly focused on medium DSA problems & Resume Overview

1. Tree Traversals

Easy
15m average time
85% success
0/40
Asked in companies
Wells FargoBig BasketMicrosoft

You have been given a Binary Tree of 'N'

nodes, where the nodes have integer values.


Your task is to return the ln-Order, Pre-Order, and Post-Order traversals of the given binary tree.


For example :
For the given binary tree:

Binary - Tree1

The Inorder traversal will be [5, 3, 2, 1, 7, 4, 6].
The Preorder traversal will be [1, 3, 5, 2, 4, 7, 6].
The Postorder traversal will be [5, 2, 3, 7, 6, 4, 1].
Problem approach

First I used recursion to solve this problem.
Then when asked to optimize the solution
Then I used the stack solution which was better

Try solving now

2. Spiral Order Traversal of a Binary Tree

Easy
20m average time
75% success
0/40
Asked in companies
SliceOYOMicrosoft

You have been given a binary tree of 'N' nodes. Print the Spiral Order traversal of this binary tree.

For example
For the given binary tree [1, 2, 3, -1, -1, 4, 5, -1, -1, -1, -1]
    1
   / \
  2   3
     / \
    4   5

Output: 1 3 2 4 5
Problem approach

I told him about the recursive solution.
But then the interview asked me for a better solution
I used a dequeue to solve this problem

Try solving now

3. Find Number Of Islands

Moderate
34m average time
60% success
0/80
Asked in companies
MicrosoftAmazonUber

You are given a 2-dimensional array/list having N rows and M columns, which is filled with ones(1) and zeroes(0). 1 signifies land, and 0 signifies water.

A cell is said to be connected to another cell, if one cell lies immediately next to the other cell, in any of the eight directions (two vertical, two horizontal, and four diagonals).

A group of connected cells having value 1 is called an island. Your task is to find the number of such islands present in the matrix.

Problem approach

I created a DFS solution using an extra visited matrix.
The interviewer asked me to use constant space.
I used in place value modification to traverse the matrix and came up with the solution

Try solving now
03
Round
Medium
Video Call
Duration60 minutes
Interview date16 Aug 2021
Coding problem1

It was scheduled in the evening when we discussed a low-level system design problem. The interviewer was very helpful and guided as I came up with a solution.

1. Snake and Ladder

Moderate
30m average time
60% success
0/80
Asked in companies
OlaDunzoIntuit

You have been given a Snake and Ladder Board with 'N' rows and 'N' columns with the numbers written from 1 to (N*N) starting from the bottom left of the board, and alternating direction each row.

For example

For a (6 x 6) board, the numbers are written as follows:

6*6 Board

You start from square 1 of the board (which is always in the last row and first column). On each square say 'X', you can throw a dice which can have six outcomes and you have total control over the outcome of dice throw and you want to find out the minimum number of throws required to reach the last cell.
Some of the squares contain Snakes and Ladders, and these are possibilities of a throw at square 'X':
You choose a destination square 'S' with number 'X+1', 'X+2', 'X+3', 'X+4', 'X+5', or 'X+6', provided this number is <= N*N.
If 'S' has a snake or ladder, you move to the destination of that snake or ladder.  Otherwise, you move to S.
A board square on row 'i' and column 'j' has a "Snake or Ladder" if board[i][j] != -1. The destination of that snake or ladder is board[i][j].
Note :
You can only take a snake or ladder at most once per move: if the destination to a snake or ladder is the start of another snake or ladder, you do not continue moving - you have to ignore the snake or ladder present on that square.

For example, if the board is:
-1 1 -1
-1 -1 9
-1 4 -1
Let's say on the first move your destination square is 2  [at row 2, column 1], then you finish your first move at 4 [at row 1, column 2] because you do not continue moving to 9 [at row 0, column 0] by taking the ladder from 4.

A square can also have a Snake or Ladder which will end at the same cell.
For example, if the board is:
-1 3 -1
-1 5 -1
-1 -1 9
Here we can see Snake/Ladder on square 5 [at row 1, column 1] will end on the same square 5.
Problem approach

Tip 1 : Try to think of all the variables and methods first before getting to the code part
Tip 2 : When implementing these functions, think like you are actually using the game and solutions will come to you.
Tip 3 : Choose good variable & method names as they will help you to implement and it looks very impressive.
Tip 4 : Don't be afraid to take guidance from the interviewer. They want you to come up with a solution so they will definitely guide you.

Try solving now
04
Round
Medium
HR Round
Duration60 Minutes
Interview date17 Aug 2021
Coding problem1

Technical Discussion on my Resume & Skills

1. Basic HR Questions

It was mainly around my projects, past internships & experience.

Problem approach

Tip 1 : Be confident & answer all questions with utmost sincerity.

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