Welcome Learners!. This post Round 2 interview experience is a continuation to my previous post. If you didn’t refer it, please do refer Round 1 interview experience before reading this post. In this post I will share the experience of round 2 of my interviews.
Round 2 interview experience
Round 2:
After round 1, within 10 – 15 minutes, I got the call that I got selected for second round of interview and it is scheduled. I have joined five minutes prior to the scheduled time. Again as usual, the interviewer asked me to introduce myself first.
Then after he directly jumped into coding.
He given me several questions to solve to test my problem solving skills and optimization skills.
Questions:
First Question
Find the second maximum element from the given array.
I explained the approach to him briefly and he asked me to write the code. I wrote the code and shown him. He said it is fine but fails in some cases. He asked me to find that case. I have gone through my code and then realized my mistake. I mentioned him the case which I missed and where my code is going to fail. He said it was right, and then asked me to modify my code.
Then I corrected my code. He checked my code and and given several testcases to check the correctness of my code. The code went well through all the cases which was given.
You can find the solution here.
Second Question
There are two arrays, and you need to choose two elements ( one from each ) and you need to swap them. My swapping them you need to make the sum of both the arrays as equal.
Again, before proceeding to code my solution, I explained my approach clearly to the interviewer. I wrote the code for my approach. He asked me whether my code works in all cases or not?. I checked it and said yes. But he analyzed it and found a small mistake in my code. I corrected it and shown to him. He also asked me explain my code by taking an example to show how it works. I took an example and explained him step by step execution of my code.
You can find the solution here.
Round 3 experience will be shared in next post. Continue reading Learners!!!.