Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
3,402 views
in Online Assessments by Expert (115,770 points) | 3,402 views

1 Answer

0 like 0 dislike
Hey,
I have appeared in De Shaw Code Pair Interview Round. This was my first Interview for big company . The Interviewer was very decent.
Round : Code-Pair Round
Platform - HackerRank
No. of Question : 3 (2 coding & 1 Mathematics )
Question 1 : Find the missing Number in array of size n. Given all the numbers are distinct and numbers are from 1<=a[i]<=n+1 .
I asked that is the Array Sorted He answered yes . Then I gave him a simple solution O(n) by simple comparing index of array +1 with the array number.
Then he told me to lower time complexity.
I gave him binary search solution now he told me to code it. It was able to code it in 3-4 minute. He put all the base cases in my code and tested My code failed at 1 edge case. He told me to fix it I got my mistake and I fixed it.
Then we moved to second question.

Question 2 : Find the LCA of the Binary tree.
Answer : I was explaining him my approach but he was unable to understand me maybe due to internet issue or something So I told him to let me code he gave me permission and told me to code it fast.
So I was able to code it in 5-7 min . Then I explained him my approach I told him that my solution will work for n-arry tree too. He then took 5 min and tried lot of test cases. Luckily all the test cases passed. But I was not feeling confident as I was not able to explain my approach verbally and I might have used binary lifting or simply gone for creating binary tree and done it in simple binary traveral but it would have taken time. He never told me to optimize my solution as I already done it in O(n) but he told me that I should have done this with very less space time complexity.

Question 3(Maths Question) : It was very simple question but here I - up due to overthinking and over-confidence.
The question was find total number of common numbers between multiples of 10^95 and divisors of 10^98 .
I started telling him that it will take me only 10^3 moves to go from 10^95 to 10^98 so what I have to check only what are the multiples of 1000. He said yes then I simple up in calculating the easist thing of the world i.e calculating number of multiples of 1000.
Time was up for interview. Immediately after interview I know i was - up.
Note : Never be too confident and too frank with the interviewer and think twice before answering.
by Expert (115,770 points)
edited by