Tuesday, July 17, 2012

Nagarro Interview Experience of Amit Kumar

Written Test: 2 papers
Paper 1: Aptitude (mathematical section) and analytical reasoning (only Problem solving type puzzles)

This paper includes two sections
  1. Mathematical section problems on mensuration, geometry, trigonometry, profit-loss, percentage, problems on train, boat-stream etc.
  2. Analytical reasoning (only Problem solving type puzzles).
The level of Mathematical section is more than average as compared to other companies
And also the level of Analytical reasoning questions is good.

Paper 2: Coding round
3 problems are given to be coded in 75 minutes (I attempted all 3).

  1. Given an array of integers which contains positive and negative numbers you have to arrange the negative number first then positive numbers in O (n) time.
  2. Given an array of integers and a number “k”, you have to find the all such elements whose sum is equal to “k”.
    This is a subset sum problem.
    Ex:- {1,2,3,4,5,6,7,8,9} k=10
    O/P:- {1,2,3,4}, { 1,3,6}, { 1,2,7}, {1,4,5}, {1,9}, {2,8}, {3,7}, { 4,6}, {2,3,5}.
  3. Given an integer array of positive numbers, you have to find all pairs of “next nearest consecutive numbers” in array, if not present then nothing to print, if present then print all such pairs.
    Ex: - Input1:- {1, 4, 2, 5, 7, 8} O/P is {7, 8}
    Input2:- {1,4,2,5,7,8,9,10} O/P is {7,8}{8,9}{9,10}
    Input3:- {1, 6, 9, 11} No output.
Those who cleared the written test were called for the technical interviews.
TIP: - Try to attempt all codes.

Interviews

It started with discussion of the codes one by one.
For codes which were not optimal, he asked me for other optimal approaches.

For Question 1:-
I had used extra memory to store the result, sir pointed out that I could have done the same thing using O(1) (constant) space and I did with constant space(with different approach).
He was trying to entangle me by the question “You haven't handled the case of ZERO (0)” then I said that ZERO is neither positive nor negative.


For Question 2:-
My code would not have printed all outputs if the input size would increase, so he asked me to think different approaches. I told him an approach that use all (2^n) subsets of the give array of size n, that takes sum of the elements of the subset and then check with the given sum. If they equal print all elements of that and I repeat this process to all (2^n) subset of array.

He said that same approach is written by your friend, than I said that it may happen, then he asked me again to think different approach. I said that I don't have any alternative solution.

For Question 3:-
My code prints the all such pairs that differ by one, so sir asked me to correct the code then I said that I can find the minimum difference of two indexes and also the difference of the element at these indexes equal to one.
Again, he was trying to entangle me by the question “You want to make array of difference of indexes”, then I said that no I will use only two variables.

After this, he asked me to write a code to print the following pattern
12345
23451
34512
45123
51234

That's all for the technical interview.

HR Interview
  • About yourself
  • Marks, JAM Rank, how many candidates appeared for JAM that year.
  • Interests
  • About Nagarro - Where do you see yourself in 5 years, how many seniors you know in Nagarro, is this your first interview, technology you'd like to work upon, how will you manage transportation to Gurgaon etc. 
That's it. :)

No comments:

Post a Comment