Introduction
It is the first time in mock interview I came cross a peer who worked hard first five to ten minutes to write down his analysis and also in very structured ways. It is the algorithm called "Find largest smaller binary search tree key than given node". I have written more than five time and also I have interviewed others more than five times. Over my one hundred interview, this is the first time I read such a great analysis of the algorithm.
Analysis of the algorithm
Here is the link.
There is only minor thing to modify in the base case. The node may not be the leaf node all the time.
Code review
Here is the C# code after the code review. I asked the peer to add null pointer checking at the beginning and make it one of base cases. So this way the code is much simple to read and if statement do not need to check is null pointer at all. The success of coding is that base case is well-defined on line 24.
Are you ready?
This is not the first time I met a person who is working on Google onsite in less than one week. The mock interview platform provides me great training and also I just write down those peer's code and study more, I should figure out ideas for me to improve. We do not need to spend money for tutoring, just learn by ourselves.
One easy thing to learn is to write down some note related the analysis of the algorithm. Organize them so it is well-written. Write down the constraints, write down the ideas, write down the pseudo code, write down base case for depth first search if applicable.
Share some advice from the peer
I like to share some advice from the peer. Focus on soft skills.
No comments:
Post a Comment