Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Nagaaro interview experience Real time questions & tips from candidates to crack your interview

Associate Engineer

Nagaaro
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 1 month
Topics: Data Structure, Algorithm, OOPS, Dynamic Programming, Competitive programming.
Tip
Tip

Tip 1 : Practice competitive programming
Tip 2 : Make your data structure strong
Tip 3 : Make sure your OOPS concepts is clear.

Application process
Where: Referral
Eligibility: Above 6.8 CGPA
Resume Tip
Resume tip

Tip 1 : Make a strong resume only add those skill in which you are perfect.
Tip 2 : Add projects in which you have good knowledge

Interview rounds

01
Round
Easy
Online Coding Interview
Duration60 minutes
Interview date10 Sep 2020
Coding problem2

1. Find the K-th Smallest Element in Array

Easy
10m average time
90% success
0/40
Asked in companies
FlipkartMicrosoftBlackrock

You are given an array/list ‘ARR’ consisting of ‘N’ non - negative integers and an integer ‘K’. Your task is to return the K-th smallest element of the array.

For example :-

Given an array/list ‘ARR' = [ 3, 2, 4, 5, 6 ] and 'K' = 3. The 3rd smallest element is "4" because the order of numbers is [ 2, 3, 4, 5, 6 ].
Problem approach

First sort the array
second print the value at 2nd position

Try solving now

2. Reverse Linked List

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

Given a singly linked list of integers. Your task is to return the head of the reversed linked list.

For example:
The given linked list is 1 -> 2 -> 3 -> 4-> NULL. Then the reverse linked list is 4 -> 3 -> 2 -> 1 -> NULL and the head of the reversed linked list will be 4.
Follow Up :
Can you solve this problem in O(N) time and O(1) space complexity?
Problem approach

while (current != NULL) { 
// Store next 
next = current->next; 
// Reverse current node's pointer 
current->next = prev; 
// Move pointers one position ahead. 
prev = current; 
current = next; 
}

Try solving now
02
Round
Medium
Online Coding Test
Duration90 minutes
Interview date20 Sep 2020
Coding problem2

There were three coding questions
1. Easy
2. Medium
3. Hard

Easy
15m average time
85% success
0/40
Asked in companies
AmazonFactSetAccolite

You have been given a matrix of ‘N’ rows and ‘M’ columns filled up with integers where every row is sorted in non-decreasing order. Your task is to return all the elements of the given matrix in non-decreasing order.

Problem approach

1. Read all the inputs.
->number of rows and columns say m and n.
->mxn matrix elements.
->base column number b. 
2. let i is the row index and j is the column index which starts from 0.
->hence first element of the base column b means (0,b).
3. start applying the sort logic on the column b=2.
4. for every swap required swap the elements in the other columns as well.
->when it's checked that (r1, b)needs to be swapped with (r2, b), don‟t just swap these 
two
->start from column 1, swap element at r1 with that of r2, then go on until the column n.
->repeat the swapping until all the m elements of the base column b are sorted.

Try solving now

2. Subarrays With Zero Sum

Easy
0/40
Asked in companies
AmazonOYOMicrosoft

You are given ‘N’ integers in the form of an array ‘ARR’. Count the number of subarrays having their sum as 0.

For example :
Let ‘ARR’ be: [1, 4, -5]
The subarray [1, 4, -5] has a sum equal to 0. So the count is 1.
Problem approach

1. Maintain sum of elements encountered so far in a variable (say sum).
2. If current sum is 0, we found a subarray starting from index 0 and ending at 
index current index
3. Check if current sum exists in the hash table or not.
4. If current sum already exists in the hash table then it indicates that this sum was 
the sum of some sub-array elements arr[0]…arr[i] and now the same sum is 
obtained for the current sub-array arr[0]…arr[j] which means that the sum of the 
sub-array arr[i+1]…arr[j] must be 0.
5. Insert current sum into the hash table

Try solving now
03
Round
Hard
Face to Face
Duration60 minutes
Interview date27 Sep 2020
Coding problem1

Interviewer asked all the question which I attempted during your coding round.
You need to tell about the time complexity, then he will ask you to reduce the complexity
And some question related to OOPS, DP etc

1. Merge two sorted arrays

Moderate
15m average time
85% success
0/80
Asked in companies
AmazonOlaTata Consultancy Services (TCS)

Ninja has been given two sorted integer arrays/lists ‘ARR1’ and ‘ARR2’ of size ‘M’ and ‘N’. Ninja has to merge these sorted arrays/lists into ‘ARR1’ as one sorted array. You may have to assume that ‘ARR1’ has a size equal to ‘M’ + ‘N’ such that ‘ARR1’ has enough space to add all the elements of ‘ARR2’ in ‘ARR1’.

For example:

‘ARR1’ = [3 6 9 0 0]
‘ARR2’ = [4 10]
After merging the ‘ARR1’ and ‘ARR2’ in ‘ARR1’. 
‘ARR1’ = [3 4 6 9 10]
Problem approach

1. Create an array arr3[ ] of size n1 + n2. 
2. Simultaneously traverse arr1[ ] and arr2[ ]. 
o Pick smaller of current elements in arr1[ ] and arr2[ ], copy this 
smaller element to next position in arr3[ ] and move ahead in 
arr3[ ] and the array whose element is picked.
3. If there are remaining elements in arr1[ ] or arr2[ ], copy them also in 
arr3[ ].

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 the output of print (0.1 + 0.2 == 0.3) in Python?

Choose another skill to practice
Start a Discussion
Similar interview experiences
company logo
Associate Engineer
2 rounds | 3 problems
Interviewed by Nagaaro
0 views
0 comments
0 upvotes
company logo
Associate Engineer
2 rounds | 2 problems
Interviewed by Nagaaro
584 views
0 comments
0 upvotes
company logo
Associate Engineer
3 rounds | 8 problems
Interviewed by Nagaaro
617 views
0 comments
0 upvotes
company logo
Associate Engineer
3 rounds | 3 problems
Interviewed by Nagaaro
570 views
0 comments
0 upvotes