Saturday, July 22, 2017

Recursive function small talk

July 22, 2017

Introduction


It is most favorite thing to do in the world, write a quick and short solution using depth first search, and also in recursive function call. Julia wrote a blog about her recursive function practice a few days ago, called Maze.

Today Julia spent near 30 minutes to conduct a mocking practice, and then she chose to practice one more time.


One more practice 


Given a binary search tree, write a function to return the largest smaller value in a binary search tree. Here is the C# code.

It is the first time Julia wrote this recursive algorithm. She made a few correction through whiteboard testing. And then she argued that the algorithm should work, one thing is to prove that any number returned should be less than given value.


Time to share


It is so interesting that Julia did impress the peer after 60 minutes mocking interview, and the peer asked Julia how she practices. So it took extra 40 minutes for Julia to share her experience. Julia likes to get organized and give good advice to the peer.

Last 3 months Julia practiced the algorithm a few times, and she also used the algorithm as an interviewer. But she did not come out a correct solution first time.

Three things Julia shared her practice:

1. Leetcode 10 - the most important about recursion tree, return A || B || C, A is that b* stands for empty string, B is that b* stands for one b, C is that b* stands for more than once, like "bb". The recursion is in 3 branches.

It is the hard algorithm and Julia interviewed over a few people, only one person is very close to the perfect solution. The code was very clean and almost perfect. Julia learned through the experience, she was interviewed to write the algorithm twice, both of them were not correct, not very close to optimal solution at all. Julia shared honestly her experience on the algorithm.

This algorithm became Julia's most favorite one after she invested so many hours on it. She wrote a few blogs on this algorithm, the one she likes to share is here.

2. Code review on stackexchange website, her experience on code review. Link is here.
3. Refdash mocking interview.

It is the first time Julia was told to adjust the camera so that the peer can see her face impression, in first a few minutes. This is the second time Julia got complaint, first time the peer complained the echo sound, so she decided to use headset.




No comments:

Post a Comment