Vous êtes sur la page 1sur 4

Nagarro Software Pvt. Ltd.

Subjective/Coding Test
Maximum Time: 7 min
!ead t"e fo##owing instructions ver$ carefu##$ before $ou %roceed.
i& 'ou can write code in an$ %rogramming #anguage (minimum time
com%#exit$&.
)f $ou do not *now t"ese #anguages t"en $ou can a#so write %seudo
#ogic.
ii& 'our code s"ou#d be o%timi+ed in terms of time com%#exit$ and memor$
usage.
iii& ,#an* s"eets are attac"ed at t"e bac* of -uestion %a%er to write t"e
code. if $ou need an additiona# s"eet. %#ease as* invigi#ator.
P#ease /## t"e fo##owing information carefu##$
Name
Degree* & Branch**
Passout Year
College / Current Company
Email Id
Mobile No
Date o Birth !dd/mm/yy"
0isc#aimer#
1. 2n$ candidates w"o are found to "ave c"eated w"i#e
so#ving t"e %a%er wi## automatica##$ be dis-ua#i/ed.
!emember. it is ver$ eas$ to detect if two so#utions are a
co%$ of eac" ot"er w"i#e c"ec*ing t"e %a%ers.
3. 2n$one w"o is found to %ub#is"/s"are t"e -uestion %a%er
to an$ %ub#ic %#atform (media/internet& wi## be subject to
strict action.
4 Se#ect 0egree from t"e #ist be#ow
B $ech B %c
BE P&DC'
MC' (thers !Please %peciy"
M %c
MB'
M $ech
BC'
44 Se#ect ,ranc" from t"e #ist be#ow
,ranc" Code
Computer %ciences C%E
Electronics & Communications E&CE
Electrical EE
Mechanical ME
Chemical C)E
(thers !Please %peciy"
0isc#aimer#
1. 2n$ candidates w"o are found to "ave c"eated w"i#e
so#ving t"e %a%er wi## automatica##$ be dis-ua#i/ed.
!emember. it is ver$ eas$ to detect if two so#utions are a
co%$ of eac" ot"er w"i#e c"ec*ing t"e %a%ers.
3. 2n$one w"o is found to %ub#is"/s"are t"e -uestion %a%er
to an$ %ub#ic %#atform (media/internet& wi## be subject to
strict action.
5uestion 1
You are gi*en +ith a , sorted arrays o integers- You ha*e to +rite an e.cient unction to
/nd top 0 largest numbers altogether rom these three arrays 1
E2ample#
Input 1
Array1 {2, 7, 12, 23, 40, 44, 67, 88, 102}
Array2 {3, 12, 14, 17, 23, 40, 41, 67, 108}
Array3 {8, 12, 23, 40, 59, 86, 119, 130}
(utput 1
{88, 102, 108, 119, 130}
3unction Prototype#
int[] Top5Numbr!"int[] array1, int[] array2, int[] array3#
5uestion 3
You are gi*en +ith a input number N4 +rite a program to print a N2N matri2 in spiral ormat
+hose number +ill starting rom 5 till N
6
-
E2ample 1 or N 7 0
Output -
1 2 3 4 5
16 17 18 19 6
15 24 25 20 7
14 23 22 21 8
13 12 11 10 9
E2planation
1 2 3 4 5
16 17 18 19 6
15 24 25 20 7
14 23 22 21 8
13 12 11 10 9
3unction Prototype#
$oi% &rint'pira()atri*"int N#
0isc#aimer#
1. 2n$ candidates w"o are found to "ave c"eated w"i#e
so#ving t"e %a%er wi## automatica##$ be dis-ua#i/ed.
!emember. it is ver$ eas$ to detect if two so#utions are a
co%$ of eac" ot"er w"i#e c"ec*ing t"e %a%ers.
3. 2n$one w"o is found to %ub#is"/s"are t"e -uestion %a%er
to an$ %ub#ic %#atform (media/internet& wi## be subject to
strict action.
5uestion 6
' string can be said to as a possible palindrome string i the character o string can be
arranged in such a +ay that the combination is a palindrome-
3or e2ample 1
t!t! is possible palindrome because it can be arranged as t!!t4 +hich is a palindrome-
+((o is not possible palindrome because there are no such possible arrangement-
You ha*e to +rite a unction +hich ta8es a string as input and return +hether it is a
possible palindrome or not-
3unction Prototype#
boo( ,!&o!!ib(&a(in%rom'trin-"!trin- input#
0isc#aimer#
1. 2n$ candidates w"o are found to "ave c"eated w"i#e
so#ving t"e %a%er wi## automatica##$ be dis-ua#i/ed.
!emember. it is ver$ eas$ to detect if two so#utions are a
co%$ of eac" ot"er w"i#e c"ec*ing t"e %a%ers.
3. 2n$one w"o is found to %ub#is"/s"are t"e -uestion %a%er
to an$ %ub#ic %#atform (media/internet& wi## be subject to
strict action.