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

SDE - 1

Dunzo
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Journey
I was admitted to DTU College in the computer science stream. My seniors advised me to practice DSA from the start of B.Tech, and I did not take that seriously. I regretted not taking their advice, and in the third year, I started coding; I had to increase practice hours because I started late.
Application story
I applied for the post through the campus drive. After applying I practiced hard for it and the hardwork paid off at the last.
Why selected/rejected for the role?
I was on point with my coding solutions to the questions asked in the interviews. I could not provide the optimal solutions and was giving correct explanations to some theory questions asked.
Preparation
Duration: 6 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Try it even if you are stuck in the problem. The interviewer will help you.
Tip 2 : Prepare Data Structures and Algorithms well. They mainly check our ability to find solutions to real-world problems.
Tip 3 : Be confident enough, don't be nervous. Maintain at least two projects on your resume.

Application process
Where: Campus
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Mention atleast 2 projects.
Tip 2 : Mention your skills in which you are perfect.
Tip 3 : It should not be too long or too short

Interview rounds

01
Round
Easy
Video Call
Duration60 minutes
Interview date22 Oct 2022
Coding problem2

1. Check Identical Trees

Moderate
20m average time
85% success
0/80
Asked in companies
DunzoMicrosoftDisney + Hotstar

You are given two binary trees with 'n' and 'm' nodes respectively.


You need to return true if the two trees are identical. Otherwise, return false.


Example:
For the trees given below:- 

example

The given trees are identical as:-
1. The number of nodes in both trees is the same. 
2. The number of edges in both trees is the same. 
3. The data for root for both the trees is the same i.e 5. 
4. The data of root -> left (root’s left child) for both the trees is the same i.e 2.
5. The data of root -> right (root’s right child) for both the trees is the same i.e 3.
6. The data of root -> right -> left ( left child of root’s right child) for both the trees is the same i.e 6.
7. Nodes with data 2 and 6 are the leaf nodes for both the binary trees. 
Try solving now

2. Flatten 2D array

Easy
20m average time
80% success
0/40
Asked in companies
FacebookAppleDunzo

You have to implement an iterator for ‘FLATTEN_2D’ to flatten a two-dimensional array ‘ARR_2D’ into a one-dimensional array ‘ARR_1D’. The iterator should support the following two operations:
  • ‘NEXT’: The first call to ‘NEXT’ should return the first element of ‘ARR_2D’. Each subsequent call should return the next element in the row-wise traversal of ‘ARR_2D’.
  • ‘HAS_NEXT’: It should return ‘true’ if the iteration has more elements to traverse; otherwise, if ‘NEXT’ has traversed the entire ‘ARR_2D’, return ‘false’.
  • Try to code this using only iterators in C++ or iterators in Java.

    The ‘FLATTEN_2D’ object will be instantiated and called as follow:
      FLATTEN_2D it = new FLATTEN_2D(ARR_2d);
      while (it.hasNext()) {
          arr1d.append(it.next());
      }

    Example:
    ARR_2D = [ 
              [0, 1],
              [2, 3, 4],
              [],
              [5] 
            ]
    The computed ‘ARR_1D’ should be as follows:
    ARR_1D = [0, 1, 2, 3, 4, 5]
    So, the printed output will be: 0 1 2 3 4 5
    
    Try solving now
    02
    Round
    Easy
    Video Call
    Duration60 minutes
    Interview date22 Oct 2022
    Coding problem2

    1. Word Break-1

    Hard
    36m average time
    55% success
    0/120
    Asked in companies
    IBMAmazonMicrosoft

    You are given a string 's', and a dictionary of words 'dict' containing 'n' words. Your task is to add spaces in 's' to form valid sentences, where each word is a word from the dictionary.


    You need to return all possible sentences that can be formed using the given dictionary.


    Note :
    The same word from a dictionary can be used as many times as possible to make sentences.
    
    Try solving now

    2. Distance Of Nearest Cell Having 1 In A Binary Matrix

    Moderate
    35m average time
    65% success
    0/80
    Asked in companies
    FacebookDunzoCIS - Cyber Infrastructure

    You have been given a binary matrix 'MAT' containing only 0’s and 1’s of size N x M. You need to find the distance of the nearest cell having 1 in the matrix for each cell.

    The distance is calculated as |i1 – i2| + |j1 – j2|, where i1, j1 are the coordinates of the current cell and i2, j2 are the coordinates of the nearest cell having value 1.
    
    Note :
    You can only move in four directions which are : Up, Down, Left and Right.
    
    For example :
    If N = 3, M = 4
    
    and mat[ ][ ] = { 0, 0, 0, 1,
                      0, 0, 1, 1,
                      0, 1, 1, 0 }
    
    then the output matrix will be
    
    3  2  1  0
    2  1  0  0
    1  0  0  1
    
    Problem approach

    The idea is to load the i and j coordinates of each ‘1′ in the Matrix into a Queue and then traverse all the “0” Matrix elements and compare the distance between all the 1’s from the Queue to get a minimum distance

    Try solving now
    03
    Round
    Easy
    Video Call
    Duration60 minutes
    Interview date22 Oct 2022
    Coding problem2

    1. Distance between two nodes of a Tree

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

    Given a binary tree and the value of two nodes, find the distance between the given two nodes of the Binary Tree.

    Distance between two nodes is defined as the minimum number of edges in the path from one node to another.

    Problem approach

    We have to follow the step:

    Find the LCA of the given two nodes
    Store the path of two-node from LCA in strings S1 and S2 that will store ‘l’ if we have to take a left turn in the path starting from LCA to that node and ‘r’ if we take a right turn in the path starting from LCA.
    Reverse one of the strings and concatenate both strings.
    Count the number of time characters in our resultant string not equal to its adjacent character.

    Try solving now

    2. Convert BST to Min Heap

    Moderate
    25m average time
    70% success
    0/80
    Asked in companies
    FacebookDunzoFareye Technologies Private Limited

    You are given a 'ROOT' of a binary search tree of integers. The given BST is also a complete binary tree.

    Your task is to convert the given binary search tree into a Min Heap and print the preorder traversal of the updated binary search tree.

    Note:

    Binary Search Tree is a node-based binary tree data structure that has the following properties:
    
    1. The left subtree of a node contains only nodes with keys lesser than the node’s key.
    2. The right subtree of a node contains only nodes with keys greater than the node’s key.
    3. The left and right subtree each must also be a binary search tree.
    
    A Binary Heap is a Binary Tree with the following property:
    
    1. It’s a complete tree (all levels are filled except possibly the last level and the last level has all keys as left as possible). This property of Binary Heap makes them suitable to be stored in an array.
    
    A Binary Heap is either Min Heap or Max Heap. In a Min Binary Heap, the key at the root must be minimum among all keys present in Binary Heap. The same property must be recursively true for all nodes in Binary Tree. Max Binary Heap is similar to Min Heap.
    

    For example:

    Given:- BST’s ‘ROOT’ = 4 2 6 -1 -1 -1 -1 
    Then the min-heap in pre-order fashion would be 2 4 6.
    
    Problem approach

    Create an array arr[] of size n, where n is the number of nodes in the given BST. 
    Perform the inorder traversal of the BST and copy the node values in the arr[] in sorted 
    order. 
    Now perform the postorder traversal of the tree. 
    While traversing the root during the postorder traversal, one by one copy the values from the array arr[] to the nodes.

    Try solving now

    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 remove whitespace from the start of a string?

    Choose another skill to practice
    Similar interview experiences
    company logo
    SDE - 1
    3 rounds | 5 problems
    Interviewed by Dunzo
    4718 views
    0 comments
    0 upvotes
    company logo
    SDE - 1
    3 rounds | 6 problems
    Interviewed by Dunzo
    781 views
    0 comments
    0 upvotes
    company logo
    SDE - 1
    3 rounds | 7 problems
    Interviewed by Dunzo
    725 views
    0 comments
    0 upvotes
    company logo
    SDE - 1
    3 rounds | 5 problems
    Interviewed by Dunzo
    807 views
    0 comments
    0 upvotes
    Companies with similar interview experiences
    company logo
    SDE - 1
    5 rounds | 12 problems
    Interviewed by Amazon
    115097 views
    24 comments
    0 upvotes
    company logo
    SDE - 1
    4 rounds | 5 problems
    Interviewed by Microsoft
    58238 views
    5 comments
    0 upvotes
    company logo
    SDE - 1
    3 rounds | 7 problems
    Interviewed by Amazon
    35147 views
    7 comments
    0 upvotes