I just finished this interview less than half an hour ago, so this is a fresh write-up.
Overall flow: Technical Coding Interview, 60 minutes, two problems.
First was LeetCode 695, Max Area of Island (not allowed to modify the original array). I had done this one before. I used recursive DFS, explained my approach first, and finished it in about ten-plus minutes, passed in one go with zero bugs.
Follow-up: can you do it with BFS? I said yes, just use a queue. I walked through the idea, the interviewer was fine with it, and since there were still 30 minutes left he gave me another problem.
Second was LeetCode 3039, Apply Operations to Make String Empty. I had not done this one. After reading it I explained my approach first, a brute-force while loop. The interviewer asked for the time complexity of that approach, and I analyzed it as n^2. He then hinted that I should look at what the final remaining string looks like, and that is when I got it. I explained an O(n) approach, and once he agreed with it I started coding. After writing it I ran it back and forth three or four times, and finally the output was correct. At that point there were exactly 5 minutes left, so I asked a few questions and it ended.
Discussion
Loading comments…