Open In App

Nagarro Interview Experience (On-Campus)2023

Hi everyone,

I’m excited to share my interview experience at Nagarro for the Software Developer role. The process consisted of four rounds:



Online Test (Aptitude + Technical Questions)

This round comprised 45-50 questions covering aptitude, logical reasoning, arithmetic, English grammar, and technical topics. It lasted for an hour and included questions on percentage, profit and loss, time and work, sentence corrections, synonyms, and grammar. Additionally, technical questions covered OOPs, DBMS, computer networks, and operating systems.

Online Coding Round

The second round featured five coding problems related to arrays, strings, and dynamic programming.



Planning the street

King George has built an exclusive street for his executives-class employees to build their houses. The street is divided into M sections. Each section corresponds to two plots. one on each side of the street. He has assigned you to plan the street. You have to decide on which plots along the street can the new building be built to do this you first need to calculate the number of possible ways in which free plots can be assigned to buildings, keeping in mind the restriction mentioned below-

No two consecutive plots can have buildings on them. This is done to ensure a sense of free space in the area. Your task is to find and return the number of possible assignments.

Input Specification:

Input1: An integer M depending on the number of sections

Output Specifications: streetsReturn the number of possible assignments.

Example 1:

Input1: 3

Output: 25

Explanation:

If we look at one of the streets and mark X as a plot where building is allowed and Y as a free plot, we have XYX, YXY, YYX, XYY, YYY Because the same number exists on the other side, we have 5*5=25 combinations.

Therefore 25 is returned as the output.

There are 6 different ways to paint 4 houses such that exactly 1 pair of adjacent houses has different colours. Hence output is 6.

Example 2:

Input: 2

Output: 9

Explanation:

If we look at one side of the street and mark X as a plot where building is allowed and Y as a free plot, we have XY, YX, YY Because the same number exists on the other side we have 3*3=9 combinations.

Therefore 9 is returned as the output.

Cheat Ways

It is examination time and as always, the backbenchers are finding ways to cheat in the exam and they need your help. Their teacher is very fond of data structures and has made the seating arrangement in the form of a tree.

There are N students in class numbered from 1,2….N with 1 as the root of this tree. We have k first benchers(teachers’ favourites) students in the class.

The backbenchers are planning to pass chits in teams, but are afraid of the first benchers. If any chit reaches them. They will complain to the teacher.

A cheat way is defined as the path along which a chit can be passed without going through a first bencher. Given the seating arrangement and number of first benchers,

Your task is to find the longest cheat way possible.

Input Specification:

Input 1: Total number of students in the class N.

1<=N<=10000.

Input 2: A 2D array with N-1 rows, each consisting of two integers C and D,

Denoting C and D are sitting adjacent. Only adjacent students can pass chits directly to each other.

Input 3: Number of first benchers.

0<=k<=N

Input 4: Array of K numbers denoting the position of each first bencher.

1<=input4[i]<=N

Output Specifications:

Return the length of the longest cheat way possible.

Example 1:

input1: 5

input2: {{1,2},{1,3}{3,4},{3,5}}

input3: 1

input4: {3}

Output: 1

Literary Competition

In a literary competition, children are asked to read books from a set of N different books. A child takes some time to read a book and after finishing that book. he/she is awarded with some points which can later be redeemed for gifts. The Competition has a time limit of T.

Your task is to design a strategy that helps the child earn maximum points by reading any number of books, with the constraint that the total reading time of the selected books should not exceed the time limit T of the competition.

Input Specification:

input 1: An integer N depending on the number of books

input 2: An integer T denoting the time limit of the competition where T<=160

input 3: An integer array of N elements where each value of the array represents the number of points awarded for reading the ith book(where 0<=i<=N-1 and 1<=input4[i]<=100)

Output Specifications: Return the maximum points a child can earn.

Example 1:

Input1: 3

Input2: 7

Input3: 2 6 9

Input4: 3 5 3

Output: 11

Explanation:

The child will read the 0th and the 2nd book as the time required by them is 3 +3=6 which is less than 7 ( the time limit of competition) thus amounting to 2 +9 =11 points. Therefore, 11 will be returned as the output.

Example 2:

input1: 2

input2: 5

input3: 2 4

input4: 3 5

Output: 4

Explanation:

The child will only be able to read the 1st book as the time required to read it is 5 which is equal to 5 (time limit of the competition) thus awarding him 4 points, Therefore 4 will be returned as the output.

Jump to Escape Jail

A thief, Jack Sparrow plans to escape from jail. He, being a monkey man, can jump over a wall. jack has practised well and succeeded in jumping X meters.

However, the wall is slippery, so he slides down Y meters after every jump. To escape from jail, he must cross N number of walls, where the height of each wall is given in an array.

Your task is to return the total number of jumps Jack needs to make to escape from the jail.

Input Specification:

Input 1: An integer value X denoting the number of meters he can jump up(1<=input1<=10^4)

Input 2: An integer value Y denoting the number of meters he slides down (1<=input2<=10^4)

Input 3: An integer value N denoting the number of walls he needs to jump to escape(1<=input3<=10^4)

Input 4: An integer array of size N representing the height of each wall where(1<=input4[i]<=1000)

Output Specifications: Return an integer value representing the total number of jumps Jack Sparrow must make to escape from the jail.

Example 1:

input1: 10

input2: 1

input3: 1

input4: 10

Output: 1

Explanation:

Here, Jack Sparrow can jump a height of 10 meters but slides down by 1 meter.

He was 1 wall to jump, and the height of the wall was 10 meters.

Since he jumps 10 meters in the first attempt, he crosses the wall easily in the first attempt itself.

Therefore, 1 is returned as the output.

Example 2:

Input1: 5

Input2: 1

Input3: 2

Input4: 9 10

Output: 5

Explanation:

Here, Jack Sparrow can jump a height of 5 meters but slides down by 1 meter.

He had 2 walls to jump and the height of each wall was 9 and 10 meters respectively.

First wall

Jack makes 2 attempts because, at the first attempt, he jumps 5 meters but slides down by 1 meter and does not cross the wall. In the next attempt, he jumps 5 more meters from that position and this time he Does not slide down and cross the wall in this attempt(4+5=9)

The Card Game

One day, Fred and his N friends were playing a card game in which each player threw a card with a number written on it.

The cards are such that the number X is written on the front of the card, and the negative of that number is written on the back side of the card. This game has the following rules:

Each of the N players is asked to throw a card. After the N, cards are thrown. Fred has to flip one or more cards in consecutive order, only once.

Your task is to help Fred flip the cards in such a way that the sum of the numbers, on the front face of the cards is the maximum.

Input Specification:

input1: An integer N denoting the number of cards(1<=N<=500)

input2: An integer array containing N integer, where the ith integer denotes

The value on the front of the card(-1000<=input2[i]<=1000)

Output Specifications: Return the maximum sum of the numbers, on the front of the card.

Example 1:

Input1 : 5

Input2: -2 3 -1 -4 -2

Output: 8

Explanation:

Since Fred can flip consecutive cards only once, he chooses to flip the last three cards, which results in the maximum sum (-2+3+1+4+2) i.e. 8

Therefore 8 is returned as the output.

Example 2:

Input1: 5

Input2: -1 2 3 4 -5

Output: 13

Explanation:

Since Fred can flip consecutive cards only once, he chooses to flip the last three cards,

Which results in the maximum sum (1+2+3+4+5) i.e. 13

Therefore 13 is returned as the output.
I was able to solve the 4 questions completely and in one question I solved half and was able to pass the few testcases.
After this, I got the invite for the online Tech Interview.

Technical Round

In this round, the interviewer started with introductions and inquired about my favourite coding language. I expressed my preference for C++, with knowledge of Python and Java. Then, I was given a Hackerrank link for a coding question related to strings. Despite initial nervousness, I managed to draft a solution within the 8-minute timeframe. However, there were some missed edge cases, which prompted a second coding question. After coding, discussions delved into OOP concepts, Java basics, operating system intricacies like threads and processes, and fundamental DBMS queries.

HR Round

The HR round began with introductions, where I highlighted my technical skills. We then discussed soft skills, with examples from my Business Developer Internship and my role as an event coordinator in a club. Project discussions from my internship provided an opportunity to articulate my learning curve and professional growth. Wrapping up with questions about my future aspirations and knowledge about Nagarro, the HR round concluded on a positive note, and I got selected for the role.

I hope this detailed account provides insights into my interview journey, reflecting both challenges and opportunities for growth.

Thank you.


Article Tags :