Nutanix visited my campus. There were 3 rounds in total:
Round 1 (coding round) :
2 questions were to be solved in 1hr 15min.
Given a string determine whether it is a ‘sum-string’. A string is called a sum-string if it satisfies the following properties:
sub-string(i,x) + sub-string(x+1,j) = sub-string(j,l)
“12358” is a sum string. Explanation : 1+2 = 3 ; 2+3 = 5 ; 3+5 = 8
“199100199” is a sum string. Explanation: 1+99 = 100 ; 99+100 = 199
“2368” is not a sum string.
Given 2 strings s1 and s2 determine whether s2 is a shuffle of s1. Where shuffle is defined as an operation that switches 2 children of a node in a binary tree.
Example: s1 = great s2 = taerg binary tree for s1 great / \ gr eat / \ / \ g r e at after shuffle we obtain, great / \ eat gr (shuffle gr and eat as they are children of great node) / \ / \ at e r g / \ t a
so taerg is a shuffel string of s1.
This was a tricky question of the 2.
12 students qualified for the next round. I solved all the test cases of the 1st question and 5 test cases of question 2. So I was selected for 2nd round.
I was asked to solve a Dynamic Programming problem. Given a string of digits separated by operators ( + and *) only. Then parenthesize the string in such a way that first we get the max value possible and then we get the least value possible from the string. Return the difference of the two values calculated. I had to solve this problem on a paper sheet and explain the whole approach. I took 30 min to complete the code on paper along with the explanation. Then the interviewer tested my code for some simple cases : 2*2+2 => max is 2*(2+2) = 8 and min is (2*2)+2 = 6.
Then he asked me if I had any questions for him.
He was impressed by my solution and coding style, clean and neat with comments and camel case of variables.
In total 6 students were shortlisted for the 3rd round including me.
Interviewer asked me to debug a code involving reader – writer locks. It was an OS question, modified version of readers-writers problem. I pointed out 5 problems with the code, syntactical and logical both. There was a deadlock condition, write after write inconsistency, read after write inconsistency, wrong if then else and a syntax error. I took 10 min to do point out all the problems and write the correct code. The interviewer had a stopwatch running on his phone, which I only got to know about after 5 mins.
If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.