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

SDE - 1

Navi Technologies
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 8 months
Topics: Data Structures, OOPS, DBMS, OS, Recursion, basics of Computer Networks
Tip
Tip

Tip 1 : Make proper notes
Tip 2 : Revise each topic regularly
Tip 3 : Practice as much questions

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

Tip 1 : Make a single page resume.
Tip 2 : Highlight the tech stack used.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration120 Minutes
Interview date10 Aug 2022
Coding problem2

There were 4 sections in total to be completed in 2 hours.
Aptitude: 20 questions.
Math: 25 questions.

1. Best Time to Buy and Sell Stock IV

Hard
20m average time
80% success
0/120
Asked in companies
Disney + HotstarAmazonOracle

You have been given an array 'PRICES' consisting of 'N' integers where PRICES[i] denotes the price of a given stock on the i-th day. You are also given an integer 'K' denoting the number of possible transactions you can make.

Your task is to find the maximum profit in at most K transactions. A valid transaction involves buying a stock and then selling it.

Note
You can’t engage in multiple transactions simultaneously, i.e. you must sell the stock before rebuying it.
For Example
Input: N = 6 , PRICES = [3, 2, 6, 5, 0, 3] and K = 2.
Output: 7

Explanation : The optimal way to get maximum profit is to buy the stock on day 2(price = 2) and sell it on day 3(price = 6) and rebuy it on day 5(price = 0) and sell it on day 6(price = 3). The maximum profit will be (6 - 2) + (3 - 0) = 7.
Try solving now

2. Find the number of states

Moderate
15m average time
85% success
0/80
Asked in companies
AmazonSamsung R&D InstituteIntuit

You are given ‘n’ cities, some of which are connected by bidirectional roads. You are also given an ‘n x n’ matrix i.e. ‘roads’, where if city ‘i’ and ‘j’ are connected by a road then ‘roads[i][j]'= 1, otherwise ‘roads[i][j]' = 0.


A province is a group of cities that are either directly or indirectly connected to each other through roads.


The goal is to count and return the total number of such provinces in the given matrix.


Example:
n = 4, roads = [ [1, 1, 1, 0],
                 [1, 1, 1, 0],
                 [1, 1, 1, 0],
                 [0, 0, 0, 1] ]

example

So, there are ‘2’ provinces.
Note:
1. A city is connected to itself. So, for every city ‘i’, ‘roads[i][i] = 1’.
Try solving now
02
Round
Medium
Video Call
Duration45 minutes
Interview date12 Aug 2022
Coding problem2

The interviewer started on a friendly note by introducing herself followed by my introduction. After that, she asked me to open any IDE and share my screen. 2 DSA problems were asked in this round.

1. 3Sum

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

You are given an array/list ARR consisting of N integers. Your task is to find all the distinct triplets present in the array which adds up to a given number K.

An array is said to have a triplet {ARR[i], ARR[j], ARR[k]} with sum = 'K' if there exists three indices i, j and k such that i!=j, j!=k and i!=j and ARR[i] + ARR[j] + ARR[k] = 'K'.

Note:
1. You can return the list of values in any order. For example, if a valid triplet is {1, 2, -3}, then {2, -3, 1}, {-3, 2, 1} etc is also valid triplet. Also, the ordering of different triplets can be random i.e if there are more than one valid triplets, you can return them in any order.
2. The elements in the array need not be distinct.
3. If no such triplet is present in the array, then return an empty list, and the output printed for such a test case will be "-1".
Problem approach

The idea is to sort an input array and then run through all indices of a possible first element of a triplet. For each possible first element, we make a standard bi-directional 2Sum sweep of the remaining part of the array. Also, we want to skip equal elements to avoid duplicates in the answer without making a set or smth like that.

Try solving now

2. Median in a stream

Hard
50m average time
50% success
0/120
Asked in companies
Disney + HotstarAmazonMakeMyTrip

Given that integers are read from a data stream. Your task is to find the median of the elements read so far.

Median is the middle value in an ordered integer list. If the size of the list is even there is no middle value. So the median is the floor of the average of the two middle values.

For example :
[2,3,4] - median is 3.
[2,3] - median is floor((2+3)/2) = 2.


Problem approach

The invariant of the algorithm is two heaps, small and large, each represent half of the current list. The length of smaller half is kept to be n / 2 at all time and the length of the larger half is either n / 2 or n / 2 + 1 depend on n's parity.

This way we only need to peek the two heaps' top number to calculate median.

Any time before we add a new number, there are two scenarios, (total n numbers, k = n / 2):

(1) length of (small, large) == (k, k)
(2) length of (small, large) == (k, k + 1)
After adding the number, total (n + 1) numbers, they will become:

(1) length of (small, large) == (k, k + 1)
(2) length of (small, large) == (k + 1, k + 1)
Here we take the first scenario for example, we know the large will gain one more item and small will remain the same size, but we cannot just push the item into large. What we should do is we push the new number into small and pop the maximum item from small then push it into large (all the pop and push here are heappop and heappush). By doing this kind of operations for the two scenarios we can keep our invariant.

Therefore to add a number, we have 3 O(log n) heap operations. Luckily the heapq provided us a function "heappushpop" which saves some time by combine two into one. The document says:

Push item on the heap, then pop and return the smallest item from the heap. The combined action runs more efficiently than heappush() followed by a separate call to heappop().
Alltogether, the add operation is O(logn), The findMedian operation is O(1).

Try solving now
03
Round
Medium
Video Call
Duration60 Minutes
Interview date17 Aug 2022
Coding problem1

There were 2 interviewers for this round. Both of them introduced themselves after which I gave my introduction. It was supposed to be more like a discussion session than an interview.

- I had mentioned my internship experience and one of them was interested to know more about it. This began a long discussion about the problem statement, the tech stack that I worked on, factors that were considered while choosing the tech stack, what was the outcome, and the overall impact of the project.
- Then he shared a google doc link and wrote a problem on it and asked me to write a function to solve it.
 

1. Search In BST

Easy
15m average time
85% success
0/40
Asked in companies
LinkedInAckoErnst & Young (EY)

There is a Binary Search Tree (BST) consisting of ‘N’ nodes. Each node of this BST has some integer data.


You are given the root node of this BST, and an integer ‘X’. Return true if there is a node in BST having data equal to ‘X’, otherwise return false.


A binary search tree (BST) is a binary tree data structure that has the following properties:

1. The left subtree of a node contains only nodes with data less than the node’s data.

2. The right subtree of a node contains only nodes with data greater than the node’s data.

3. The left and right subtrees must also be binary search trees.
Note:
It is guaranteed that all nodes have distinct data.
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
SDE - 1
3 rounds | 5 problems
Interviewed by Navi Technologies
1089 views
0 comments
0 upvotes
SDE - 1
3 rounds | 5 problems
Interviewed by Navi Technologies
856 views
0 comments
0 upvotes
SDE - 1
3 rounds | 6 problems
Interviewed by Navi Technologies
743 views
0 comments
0 upvotes
SDE - 1
3 rounds | 4 problems
Interviewed by Navi Technologies
1048 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