Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
Practice Tech Mahindra Essay Topics

# Coding Questions Asked in Nagarro

1 / 8

Given an array of size MxN and coordinates of starting of subarray (x, y). You need to rotate that subarray and then print the full array after rotation.

Input : NA

Output : NA

|  Array | | | |  Fresher

Tags:Nagarro

2 / 8

Given a string, say sentence=" this is crazy and fun" and a list, say name=["is", "fun"]. Now you need to capitalize on the first letter of every word in the given string which is not present in the list.

Input : this is crazy and fun

Output :

|  Strings | | | |  Fresher

Tags:Nagarro

3 / 8

Given three sorted arrays A, B, and C. Write the most efficient algorithm to find the 5th largest element among the three arrays.

Input : NA

Output : NA

|  Array | | | |  Fresher

Tags:Nagarro

4 / 8

Return the character which occurs for the maximum numbers of times in the Input String.
If multiple characters occur with the same highest frequency then return "0".

Input : Input1: abcdd

Output :

|  Strings | | | |  Experience, Fresher

5 / 8

A prime number is a whole number greater than 1 that is divisible only by itself and the number 1.

Given 'n' (1 <= n <= 100000), find the nth prime number.

Input : An integer n

Output :

|  Basics | | | |  Experience, Fresher

6 / 8

A Derangement is a permutation of n elements, such that no element appears in its original position. For example, a derangement of {0, 1, 2, 3} is {2, 3, 1, 0}.

Given a number n, find the total number of Derangements of a set of n elements.

Input : 1st Input: n = 2

For two elements say {0, 1}, there is only one
possible derangement {1, 0}

2nd Input: n = 3

For three elements say {0, 1, 2}, there are two
possible derangements {2, 0, 1} and {1, 2, 0}

Output :

|  Basics | | | |  Experience, Fresher

7 / 8

Every character in the input string is followed by its frequency.
Write a function to decrypt the string and find the nth character of the decrypted string. If no character exists at that positionthen then return "-1".
For eg:- If the input string is "a2b3" the decrypted string is "aabbb".
Note: The frequency of encrypted string cannot be greater than a single digit i.e.<10.

Explanation:

The decrypted string is "abccc", hence the 5th character in the decrypted string is "c".

Input : Input Specification:
Input1: A string.
Input2:5

Output :

|  Basics | | | |  Experience, Fresher

8 / 8

Given a number of objects N(non-repetitive object) Find the number of arrangements in which no objects occur at original positions.

Input : Input1: N, the number of Objects.
Input1: 3

Output :

|  Basics | | | |  Experience, Fresher

+ Contribute Programming Qs.

Baig
1