# Nagarro Technical Test April 2011

Posted on :05-04-2016

Q1. A string of charater is given. Find the highest occurance of a character and display that character.

For Example: INPUT: AEGBCNAVNEETGUPTAEDAGPE

OUTPUT: E

Q2. Take an array of 100 elements and fill it with the number 1 to 100 such that one number should skip and one number should be repeated. Find the number which is repeated and which is skipped.

Q3. Find the all possible combination of digits ranging 1 to 9 whose sum is 10, no digit should be repeated in any combination.

ANS:

1234
127
136
145
19
235
28
37
46

Q4. Write a function to give demonstrate the functionality of 3d in 1d. Function prototype:

change (int value, int index X, int index Y, int index Z, int [] 1dArray);

value = what is the date; index X = x-axis   index Y= y-axis     index Z = z-axis and 1d Array = in which and where the value is stored.

Q5. Remove all the blank spaces between character. Matrix is of 10* 10.

eg: INPUT

------------------------------------
| N   |   A      |        |  V      |       |T
-------------------------------------
|        |G         | U   |           |P     |
--------------------------------------
|T      |          |        | A       |       |
------------------------------------

OUTPUT:

------------------------------------
| N   |   A      |  V    |  T     |       |
-------------------------------------
|G     |U        | P     |          |        |
--------------------------------------
|T      |    A   |        |        |           |
------------------------------------

Q6. If there is a matrix A[][] of order m and another matrix B[][] of order n such that (m>n) you have to find the occurence of matrix B[][] in matrix A[][].

A[5][5]=1,2,3,4,5
5,4,1,9,7
2,1,7,3,4
6,4,8,2,7
0,2,4,5,8

B[3][3]=1,9,7
7,3,4
8,2,7

This matrix B exist in A.

Q7. Write a function for seat allocate and seat reserved. Seat allocate array and seat reserved array. Seat allocate array is of 10*20 and each row and column represent A1,A2....;B1,B2.....;........J1,J2... and so on i.e row are A to J whereas col starts from 0 to 19. Each cell in the table represent either 0 or 1. 0 represent seat available, 1 represent seat reserved.

Seat allocation starts from highest to lowest. And row j is highest, i is second highest and so on. Max 20 seats can be booked at a time. If seat is available print the seat number like B2 i.e (2 row, 3 col) and seat is booked. otherwise Print- Seat is not available.

FreshersLive - No.1 Job site in India. Here you can find latest 2018 government as well as private job recruitment notifications for different posts vacancies in India. Get top company jobs for both fresher and experienced. Job Seekers can get useful interview tips, resume services & interview Question and answer. Practice online test free which is helpful for interview preparation. Register with us to get latest employment news/rojgar samachar notifications. Also get latest free govt and other sarkari naukri job alerts daily through E-mail.

 ✖