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

SDE - 1

DeHaat
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Journey
I took admission in tier 2 college for B.Tech in Computer Science. Firstly I planned that I will start learning DSA from the first year but I could not. So, I started DSA from the fourth semester and along with DSA, I also learned development because that is what I wanted to be. By the end of Third year, I was confident in both DSA and development but even then I keep on revising the concepts.
Application story
I saw ad on the naukri.com site for their hiring. I contacted HR for the same and shared my resume. I got shortlisted and moved further for the interview rounds.
Why selected/rejected for the role?
I think I was on point with my coding solutions to the questions asked in the interviews. I provided the optimal solutions and I was giving correct explanations to some theory questions asked.
Preparation
Duration: 3 months
Topics: Data Structures, OOPs, Competitive programming, System Design, Core subjects, Algorithms
Tip
Tip

Tip 1 : Practice Leetcode medium-level questions properly
Tip 2 : Low-level and high-level system design is very important
Tip 3 : Always make notes of core subjects like DBMS, OS, CN beforehand to be able to revise before interviews

Application process
Where: Naukri
Eligibility: 7
Resume Tip
Resume tip

Tip 1 : Write the technology about which you know in detail and can discuss pros and cons of using it.
Tip 2 : Prepare your resume well and add 2 good projects for project discussion with good readme file on github.

Interview rounds

01
Round
Medium
Online Coding Test
Duration140 mins
Interview date3 Jan 2023
Coding problem3

There were 3 coding questions.
1 easy
1 medium
1 hard

1. Flip Bit to Win

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

Ninjas are often known for their stealth execution and accuracy to get the job done right. While honing their art of moving through dense forests stealthily, they need the maximum number of continuous trees one after the other for practicing.

Trees are represented by 1s and empty places by 0s (basically a binary representation of a given integer). You are also given an extra tree which you can plant at any empty place (i.e. you can flip one of the zeroes in the binary representation to 1). The tree should be planted such that the maximum number of consecutive trees is maximized.

Your task is to report the maximum number of consecutive trees after plantation.

Note:

You may also choose not to plant that extra tree at all.
For Example:
Input: 54
Output: 5

The binary representation of 54 is 110110.
After flipping the third bit from the left, we get consecutive 5 bits. i.e. 111110.
Problem approach

Simple bit manipulation techniques

Try solving now

2. Day 23 : Infix To Postfix

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

You are given a string 'exp' which is a valid infix expression.


Convert the given infix expression to postfix expression.


Note:
Infix notation is a method of writing mathematical expressions in which operators are placed between operands. 

For example, "3 + 4" represents the addition of 3 and 4.

Postfix notation is a method of writing mathematical expressions in which operators are placed after the operands. 

For example, "3 4 +" represents the addition of 3 and 4.

Expression contains digits, lower case English letters, ‘(’, ‘)’, ‘+’, ‘-’, ‘*’, ‘/’, ‘^’. 


Example:
Input: exp = ‘3+4*8’

Output: 348*+

Explanation:
Here multiplication is performed first and then the addition operation. Hence postfix expression is  3 4 8 * +.


Problem approach

By taking two stacks, this problem was easily solved

Try solving now

3. Saving Money

Moderate
20m average time
80% success
0/80
Asked in companies
FacebookAmazonShareChat

Ninja likes to travel a lot, but at the same time, he wants to save as much money as possible.


There are ‘N’ Stations connected by ‘M’ Trains. Each train that he boards starts from station ‘A’ and reaches destination station ‘B’ with a ticket price ‘P’.


Your task is to return the cheapest price from the given ‘source’ to ‘destination’ with up to ‘K’ stops. If there is no such route, return ‘-1’.


For example:
Input:
5 6
0 1 10
0 2 10
0 3 40
1 4 10
2 4 20
4 3 5
0 3 40 

There are three ways to reach station ‘3’ from station ‘0’. The first path is 0->1->4->3, which will cost us 10+ 10+ 5= 25 and the second path 0->2->4->3 will cost us, 10+ 20+ 5 = 35, and the third path 0->3 will cost us 40. 

We can’t take the first path since K = 1 and in this path, we are taking 2 stops, at station ‘1’ and station ‘4’. 

Similarly, there are 2 stops in the second path. Hence we’ll finally choose the 3rd path i.e. 0->3, which is colored in blue.
Problem approach

Graph concepts

Try solving now
02
Round
Medium
Video Call
Duration60 mins
Interview date4 Jan 2023
Coding problem2

2 coding questions were asked
2 medium questions

1. Dice Throws

Hard
35m average time
65% success
0/120
Asked in companies
MicrosoftDisney + HotstarShareChat

You are given D dice, each having F faces numbered 1 to F, both inclusive. The task is to find the possible number of ways to roll the dice together such that the sum of face-up numbers equal the given target S.

Note :
As the answer can be large, return your answer modulo 10^9  + 7.
Follow Up :
Can you solve this using not more than O(S) extra space?
Problem approach

Mathematical approach

Try solving now

2. Safe Nodes In The Graph

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

Ninja has been given a matrix/list 'EDGES' denoting 'E' edges of a directed graph having ‘N’ nodes. Ninja starts walking from some node (say ‘START’) in the graph along a directed edge of the graph. If Ninja reaches an end node (say ‘END’) (a node that has no outgoing directed edges), Ninja stops walking.

Now a starting node ‘START’ is a safe node only if Ninja must eventually walk to an end node ‘END’. More specifically, there must be a natural number ‘K’, so that Ninja must have stopped at an end node in less than ‘K’ steps for any choice of where to walk.

For Example: For the graph, as shown in the picture below, [2, 4] are the only safe nodes.

img

Ninja wants to know all the safe nodes in the graph in sorted order. Can you help Ninja to find out all the safe nodes?

Problem approach

BFS/DFS implementation

Try solving now
03
Round
Medium
Video Call
Duration60 mins
Interview date4 Jan 2023
Coding problem1

1 coding question was asked and resume related and 1 Javascript related question.

1. Network Delay Time

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

You have been given a network of ‘N’ nodes from 1 to ‘N’ and ‘M’ edges. For each edge, you are given three values (ui, vi, wi) where “ui” and “vi” denote the nodes and “wi” denotes an integer value which represents the time taken by a signal to travel from “ui” to “vi”. Now, you are supposed to find the time which a signal takes to travel from a given node ‘K’ to all nodes. If it is impossible for all nodes to receive the signal then print -1.

Note:
The signal which starts from the source node travels to all nodes simultaneously.
Problem approach

Djikstra Algorithm

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

What is recursion?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by OYO
4657 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Amazon
961 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Meesho
6450 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Salesforce
3452 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