Nagarro
Nagarro
Nagarro
th
April 2014
First Round
It is the usual nagarros apti round which included the mathematical portion and analytical reasoning
and all. As I was not that much comfortable with the first part of the paper so I attempted the second
half first which is the reasoning portion. I did attempted few questions from the first part for which I was
sure. The coding paper included the following questions:-
Ques 1. Given a decimal number when converted into its binary form forms a palindrome or not.
Bool IsBinaryPalindrome(int decimalNumber)
Ques 2. You are given a sentence contained in a given string S. Write a function which will replace all the
words within the sentence whose length is even and greater than equal to 4, with a space between the
two equal halves of the word.
Input:
Men have become the tool of their tools
Output:
Men ha ve bec ome the to ol of their tools
String ReplaceEvenWord(string S)
Ques 3. To sort an array containing 0s and 1s in O(n) time.
For example:-
Arr[] = {1,0,0,0,1,0,1,1,0,1,1,0}
Sorted array
Arr []={0,0,0,0,0,1,1,1,1,1,1}
After completing this paper I got to know that I have cleared my first paper and I have to move forward
for the interview.
The questions asked by the interviewer:
The interviewer first asked me the questions I did, my approaches. Dry run with few examples. Then he
asked me to code few questions for him.
Given array of characters and a string we need to check whether the characters of the string are there in
the array of characters in the same sequence as that of the string.
Second question I dont remember but that requires the application of hashing.