State Bank of India Interview Preparation
This is a very tricky question and I’ve faced this question before in a previous interview during my campus placements and I couldn’t solve it then. My confidence dropped a little but I started with a brute force solution, where I start dropping the egg from the ground floor one floor at a time, but it was very inefficient as it takes 100 drops in the worst case and only uses 1 egg. Next, I thought about binary search where I start on the 50th floor and proceed to halve each time, but it was still inefficient but better than brute force. Next, I tried to divide the floor into block sizes of B floors i.e 100/B blocks in total. I would start dropping eggs from the topmost floor in each block and proceed this way. I wrote a mathematical function in terms of B for the worst case and differentiated it to get the optimal value of B:
The hackerrank test link was sent to my email after my resume got shortlisted. Since the position, I applied for was for a mobile app developer, the test link had 25 MCQs related to android, kotlin, etc. for which I had no working experience. I managed to answer a few based on wild guesses and some googling. There were 2 easy coding questions that I was able to complete.
I haven’t come across this question before, but I could build on top of things I knew. The heart of the problem is to find the Lowest Common Ancestor (LCA) of the two nodes and then find the height of node A and node B from the LCA node. The sum of these two heights gives the distance between the two nodes. I was asked to write code on a whiteboard and this is what I ended up writing:
This was my final round and it was with my hiring manager and he was the same interviewer who took my second skype round. He initially discussed the queue question he asked in his previous skype round and he said that I was right then about the modulus operations. After this, he said that this round will be a full system design and straight away gave me the problem statement:
The interviewer paused the coding question and started asking general technical questions. He asked me to explain the CAP theorem in layman’s terms and how it’s applicable in distributed systems. He then asked me about design patterns I knew and where I’ve used them for which I answered singleton, builder, and factory but I couldn’t give him an example of a factory pattern. He then asked me questions about my current work. In the end, the interviewer sounded very positive and asked me to brush up on my knowledge of data structures and algorithms and he also mentioned that he hoped to see me for onsite rounds soon. I was almost sure that I wouldnt go beyond this round.
Top skills recommended for Xyz Company Executive interview Insights by AmbitionBox