Dunzo interview experience Real time questions & tips from candidates to crack your interview

SDE - 2

Dunzo
upvote
share-icon
4 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 1 month
Topics: Data structures and algorithms, Databases, Design patterns, System design.
Tip
Tip

Tip 1 : Do some basic research about the interview process and types of rounds while appearing for a company interview. Narrow down the topics and draft a realistic plan afterwards.
Tip 2 : Try to solve as many problems as possible topic wise.
Tip 3 : Please cover the breadth of topics first to get an early estimate of strong and weak topics.

Application process
Where: Linkedin
Eligibility: Prior experience as SDE
Resume Tip
Resume tip

Tip 1 : Tailor your resume as per expectations from the role you are applying for.
Tip 2 : Order your experiences and skills by relevance.
Tip 3 : Try to fit the content in a single page.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration60 minutes
Interview date12 May 2019
Coding problem1

1. Container with most water

Moderate
15m average time
90% success
0/80
Asked in companies
FlipkartAmazonSAP Labs

Given a sequence of ‘N’ space-separated non-negative integers A[1],A[2],A[3],......A[i]…...A[n]. Where each number of the sequence represents the height of the line drawn at point 'i'. Hence on the cartesian plane, each line is drawn from coordinate ('i',0) to coordinate ('i', 'A[i]'), here ‘i’ ranges from 1 to ‘N’. Find two lines, which, together with the x-axis forms a container, such that the container contains the most area of water.

Note :
1. You can not slant the container i.e. the height of the water is equal to the minimum height of the two lines which define the container.

2. Do not print anything, you just need to return the area of the container with maximum water.
Example

water-diagram

For the above Diagram, the first red marked line is formed between coordinates (2,0) and (2,10), and the second red-marked line is formed between coordinates (5,0) and (5,9). The area of water contained between these two lines is (height* width) = (5-2)* 9 = 27, which is the maximum area contained between any two lines present on the plane. So in this case, we will return 3* 9=27.
Try solving now
02
Round
Easy
Face to Face
Duration45 minutes
Interview date12 May 2019
Coding problem2

1. Anagram Substring Search

Moderate
35m average time
70% success
0/80
Asked in companies
Media.netZS AssociatesDelhivery

Given two strings ‘STR’ and ‘PTR’. Find all the starting indices of ‘PTR’ anagram substring in ‘STR’. Two strings are anagram if and only if one string can be converted into another string by rearranging the character.

For example, ‘ABCD’ and ‘ACBD’ are two anagram strings because ‘ACBD’ can be converted into ‘ABCD’ by rearranging the ‘B’ and ‘C’. ’ABA’ and ‘ABB’ are not anagram because we can’t convert ‘ABA’ to ‘ABB’ by rearranging the characters of particular strings.

‘ABACD’ and ‘CABAD’ are anagram because ‘ABACD’ can be converted into ‘CABAD’ by rearranging the first ‘A’ with ‘C’ and second ‘A’ with ‘B’.

Note:
Strings ‘STR’ and ‘PTR’ consist only of English uppercases.

Length of string ‘STR’ will always be greater than or equal to the length of string ‘PTR’.

The index is ‘0’ based.

In case, there is no anagram substring then return an empty sequence.

Explanation:

For example, the given ‘STR’ is ‘BACDGABCD’ and ‘PTR’ is ‘ABCD’. Indices are given

0-3 in ‘STR’ index 0,1,2,3 are ‘BACD’ and it is an anagram with ‘ABCD’
1-4 in ‘STR’ index 1,2,3,4 are ‘ACDG’ and it is not anagram with ‘ABCD’
2-5 in ‘STR’ index 2,3,4,5 are ‘CDGA’ and it is not anagram with ‘ABCD’
3-6 in ‘STR’ index 3,4,5,6 are ‘DGAB’ and it is not anagram with ‘ABCD’
4-7 in ‘STR’ index 4,5,6,7 are ‘GABC’ and it is not anagram with ‘ABCD’
5-8 in ‘STR’ index 5,6,7,8 are ‘ABCD’ and it is an anagram with ‘ABCD’

Hence there are 2 starting indices of substrings in the string ‘STR’ that are anagram with given ‘PTR’  which are index 0 and 5.
Try solving now

2. Maximum size rectangle binary sub-matrix with all 1s

Hard
10m average time
80% success
0/120
Asked in companies
AmazonGoogleApple

You are given an 'N' * 'M' sized binary-valued matrix 'MAT, where 'N' is the number of rows and 'M' is the number of columns. You need to return the maximum size (area) of the submatrix which consists of all 1’s i.e. the maximum area of a submatrix in which each cell has only the value ‘1’.

subMatrix_image

In the above image, areas in green, red, and violet color are all submatrices of the original 4x4 matrix.

Note:

1. Binary valued matrix has only two values in each cell : 0 and 1.
2. A submatrix is a matrix formed by selecting certain rows and columns from a larger matrix.
3. The area of a matrix with 'h' rows and 'w' columns is equal to 'h' * 'w'. 
Try solving now
03
Round
Medium
Face to Face
Duration60 minutes
Interview date12 May 2019
Coding problem2

1. Number of Subsequences with Even and Odd Sum

Moderate
25m average time
60% success
0/80
Asked in companies
OlaAdobeDunzo

You are given an array consisting of 'N' positive integers, and your task is to find the number of subsequences with odd sum and the number of subsequences with even sum. As the numbers can be too large, you need to return both the numbers mod 10 ^ 9 + 7.

A subsequence is a sequence that can be derived from the given sequence by deleting zero or more elements without changing the order of the remaining elements. For example, consider the array {1, 2, 3}, there are 7 possible subsequences for this. They are {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}.

Even sum subsequence means the subsequence whose total sum( sum of all the elements in the subsequence) is divisible by 2. And for odd sum subsequence, the total sum leaves a remainder of 1 when divided by 2.

Note:

1) In general, for an array of size 'N', there are (2 ^ 'N' - 1) non-empty subsequences possible. Because we are not considering empty subsequence for this problem.

2) The array may contain duplicate elements.

3) X mod 10 ^ 9 + 7 is the remainder when X is divided by 10 ^ 9 + 7.
Problem approach

1. Brute force approach is to check all subsequences in O(2^N)
2. Suggested on dynamic programming based approach - maintain 2 arrays odd and even which stores number of odd subsequences and num of even subsequences respectively till index i.
3. Logic to get ith value: if ith element is odd, ith value of odd array is sum of i-1 th value of odd array, i-1 th value of even array and 1. Similarly ith value of even array is sum of 2 x (i-1 th val of even array) and 1.
4. Optimized memory by using 2 variables instead of arrays for odd, even counts.

Try solving now

2. Minimum cost of reducing Array by merging any adjacent elements repetitively

Hard
15m average time
80% success
0/120
Asked in companies
DunzoZS AssociatesGrab

You are given an array 'ARR' consisting of 'N' positive integers, and you need to reduce the size of the array to 1 by performing an operation several number of times. In a single operation, you can merge any two adjacent elements of the array, and the cost of merging will be equal to the sum of those two elements. Find the minimum cost of reducing the given array by performing this operation several number of times.

In a single merge operation, the two elements are removed, and their sum is inserted at its place, hence decreasing the size of the array by 1 after each operation. For eg: Consider the array A1, A2, Ai-2, Ai-1, Ai, Aj, Aj+1, Aj+2 ,,,, An. Let the operation be performed on two indices i and j, So after merging the array will look like A1, A2, Ai-2, Ai-1, Ai+Aj, Aj+1, Aj+2,,,, An.

Note:

Note that the given operation will be performed only 'N'-1 times, where 'N' is the size of the given array.
Try solving now
04
Round
Medium
Face to Face
Duration60
Interview date12 May 2019
Coding problem2

1. Next Greater Element

Moderate
20m average time
90% success
0/80
Asked in companies
DunzoCIS - Cyber InfrastructureCisco

You are given an array arr of length N. You have to return a list of integers containing the NGE(next greater element) of each element of the given array. The NGE for an element X is the first greater element on the right side of X in the array. Elements for which no greater element exists, consider the NGE as -1.

For Example :

If the given array is [1, 3, 2], then you need to return [3, -1, -1]. Because for 1, 3 is the next greater element, for 3 it does not have any greater number to its right, and similarly for 2.
Problem approach

1. Analysed the problem and clarified the assumption with input sizes and data types
2. Found out the given problem was a variation of next greater element (link above)
3. Used stack data structure to solve it in O(N) time.

Try solving now

2. System Design And OS Questions

Design a least frequently used cache. (Practice)
1. Specify data structures, read/write method logic
2. Handle concurrency and failure scenarios
3. High level system design discussion

Problem approach

Tip 1: Revise general distributed system concepts thoroughly.
Tip 2: Practice as many design problems as possible with time constraints. Try to discuss approaches with friends.
Tip 3: Clarify as many doubts and assumptions as possible wit h the interviewer before jumping to the solution.
Tip 4: While solving low level design problems, do consider concurrency scenarios and failure scenarios.

Here's your problem of the day

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

Skill covered: Programming

How do you create a function in JavaScript?

Choose another skill to practice
Start a Discussion
Similar interview experiences
company logo
SDE - 2
4 rounds | 5 problems
Interviewed by Dunzo
1108 views
0 comments
0 upvotes
company logo
SDE - 2
3 rounds | 4 problems
Interviewed by Dunzo
0 views
0 comments
0 upvotes
company logo
SDE - 2
4 rounds | 4 problems
Interviewed by Dunzo
619 views
0 comments
0 upvotes
company logo
SDE - 2
4 rounds | 4 problems
Interviewed by Dunzo
641 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 2
5 rounds | 12 problems
Interviewed by Walmart
24080 views
8 comments
0 upvotes
company logo
SDE - 2
3 rounds | 5 problems
Interviewed by Amazon
5202 views
0 comments
0 upvotes
company logo
SDE - 2
6 rounds | 8 problems
Interviewed by Amazon
3706 views
0 comments
0 upvotes