Nagarro pvt limited interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Nagarro pvt limited
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Journey
As a fresher, I have solved around 300 questions and received an offer from TCS. I have a background in mechanical engineering, and most of my coding skills were acquired during my last semester or after graduation.
Application story
This company visited my campus for placements, and I applied for it. They conducted the coding round first, followed by coding questions.
Why selected/rejected for the role?
I was not able to perform well in the interview, hence I was rejected for this role. I was unable to provide effective solutions.
Preparation
Duration: 6 months
Topics: JAVA, DSA, OOPS, Advance DSA like graphs
Tip
Tip

Tip 1: Solve problems to gain hands-on confidence.

Tip 2: Solve high-quality questions.

Tip 3: Attempt to solve questions independently before resorting to YouTube videos for guidance.

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

Tip 1: Include projects on your resume.

Tip 2: Avoid putting false information on your resume.

Interview rounds

01
Round
Easy
Video Call
Duration60 minutes
Interview date13 Jan 2023
Coding problem2

1. Minimum count of balls in a bag

Moderate
15m average time
85% success
0/80
Asked in companies
Wells FargoNatwest GroupFlipkart limited

You are given an integer array ‘ARR’ of size ‘N’, where ‘ARR[i]’ denotes the number of balls in the ‘i-th’ bag. You are also given an integer ‘M’, denoting the maximum number of operations you can perform on ‘ARR’ (the given collection of bags).

In each operation, you can do the following:

  • Choose a bag from the collection and divide it into two new bags such that each bag contains a positive (non-zero) number of balls. Remove the chosen bag from the collection and add the new bags into the collection.

After performing the operations, let ‘X’ be the maximum number of balls in a bag. The task is to find the minimum possible value of ‘X’ and return it.

Example:
ARR = [5, 7], N = 2, M = 2

Perform the following two operations on ‘ARR’: 
1. Divide the bag with 7 balls into 3 and 4. New ARR = [3, 4, 5].
2. Divide the bag with 5 balls into 1 and 4. New ARR = [1, 3, 4, 4].

The bag with the maximum number of balls has 4 balls. Hence, the minimum possible value of ‘X’ is 4. Return 4 as the answer.
Note:
1. You can perform any number of operations between [0, M], both included.
2. Avoid using the 'Modulo' operator as it can cause Time Limit Exceeded.
Problem approach

You are given an integer array ‘ARR’ of size ‘N’, where ‘ARR[i]’ denotes the number of balls in the ‘i-th’ bag. You are also given an integer ‘M’, denoting the maximum number of operations you can perform on ‘ARR’ (the given collection of bags).

Try solving now

2. Next Greater Element

Easy
10m average time
90% success
0/40
Asked in companies
IBMInfo Edge India (Naukri.com)Amazon

You are given an array 'a' of size 'n'.



The Next Greater Element for an element 'x' is the first element on the right side of 'x' in the array, which is greater than 'x'.


If no greater elements exist to the right of 'x', consider the next greater element as -1.


For example:
Input: 'a' = [7, 12, 1, 20]

Output: NGE = [12, 20, 20, -1]

Explanation: For the given array,

- The next greater element for 7 is 12.

- The next greater element for 12 is 20. 

- The next greater element for 1 is 20. 

- There is no greater element for 20 on the right side. So we consider NGE as -1.
Problem approach

You are given an array 'a' of size 'n'.


Print the Next Greater Element(NGE) for every element.


The Next Greater Element for an element 'x' is the first element on the right side of 'x' in the array, which is greater than 'x'.


If no greater elements exist to the right of 'x', consider the next greater element as -1.

Try solving now
02
Round
Easy
Video Call
Duration60 minutes
Interview date31 Mar 2024
Coding problem2

1. Fibonacci Sum

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

Given two integers, ‘N’ and ‘M’, your task is to find the sum of Fibonacci numbers between ‘fib(N)’ and ‘fib(M)’ where ‘fib(N)’ represents the Nth Fibonacci number and ‘fib(M)’ represents the Mth Fibonacci number. The sum is given by sum(N, M) = fib(N) + fib(N+1) + fib(N+2) … fib(M). Since the answer could be large, so you have to return the sum modulo 10^9 + 7.

The fibonacci relation is given by:

fib(0) = 0 
fib(1) = 1
fib(n) = fib(n-1) + fib(n-2), n >= 2, where fib(n) represents the nth fibonacci number.
Problem approach

Given two integers, ‘N’ and ‘M’, your task is to find the sum of Fibonacci numbers between ‘fib(N)’ and ‘fib(M)’ where ‘fib(N)’ represents the Nth Fibonacci number and ‘fib(M)’ represents the Mth Fibonacci number. The sum is given by sum(N, M) = fib(N) + fib(N+1) + fib(N+2) … fib(M). Since the answer could be large, so you have to return the sum modulo 10^9 + 7.

Try solving now

2. Squares of a Sorted Array

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

You are given an array/list ‘ARR’ of ‘N’ integers. You have to generate an array/list containing squares of each number in ‘ARR’, sorted in increasing order.

For example :

Input:
‘ARR’ = [-6,-3, 2, 1, 5] 

If we take a square of each element then the array/list will become [36, 9, 4, 1, 25].
Then the sorted array/list will be [1, 4, 9, 25, 36].

Output :
[1, 4, 9, 25, 36].
Problem approach

You are given an array/list ‘ARR’ of ‘N’ integers. You have to generate an array/list containing squares of each number in ‘ARR’, sorted in increasing order.

Try solving now
03
Round
Easy
Video Call
Duration60 minutes
Interview date31 Mar 2024
Coding problem1

1. N Queue Using Array

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

You will be given ‘N’ queries. You need to implement ‘N’ queues using an array according to those queries. Each query will belong to one of these two types:

1 ‘X’ N: Enqueue element ‘X’  into the end of the nth queue. Returns true if the element is enqueued, otherwise false.

2 N: Dequeue the element at the front of the nth queue. Returns -1 if the queue is empty, otherwise, returns the dequeued element.
Note:
Please note that Enqueue means adding an element to the end of the queue, while Dequeue means removing the element from the front of the queue.
Problem approach

You will be given ‘N’ queries. You need to implement ‘N’ queues using an array according to those queries. Each query will belong to one of these two types:
1 ‘X’ N: Enqueue element ‘X’ into the end of the nth queue. Returns true if the element is enqueued, otherwise false.

2 N: Dequeue the element at the front of the nth queue. Returns -1 if the queue is empty, otherwise, returns the dequeued element.

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
Associate Software Developer
3 rounds | 11 problems
Interviewed by Nagarro pvt limited
485 views
0 comments
0 upvotes
Trainee Software Engineer
4 rounds | 5 problems
Interviewed by Nagarro pvt limited
585 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Salesforce
3452 views
0 comments
0 upvotes
Associate Software Engineer
3 rounds | 2 problems
Interviewed by Nagarro pvt limited
411 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