Wednesday, October 3, 2018

Learn from my mock interview experience

Oct. 3, 2018

Introduction


It is very helpful for me to evaluate the candidates in the market and also I like to learn how to stay humble, work hard. I have a role model who works for Facebook, and then I compare my practice with him.

I meet people, and most of time people tell me that he finished over 200 algorithms in 3 months.

I learn to evaluate a candidate with 250 Leetcode algorithms in three months. After the mock interview, he advised me to work on practice as he does. He worked on first 250 Leetcode algorithms. But he chose to work on the same type algorithm together. For example, dynamic programming, he worked on all dynamic programming from easy, medium and hard level together, and then he moved on to work on other type of algorithms. Categories of algorithm can be dynamic programming, tree, array, math, string, stack, heap.



Comparison


I spent over three years to work on 100 Leetcode algorithms. Compared to the one using three months, 250 Leetcode algorithms, 160 lintcode algorithms.

Last three month, I worked on 140 easy level algorithms.

I need to work hard to solve more problems. I have to get good habit to read and think and write code.

Longest univalue path algorithm


It is challenging for me to be an interviewer, for my favorite easy level tree algorithm. I know that the algorithm should be marked as difficult.

I worked with the peer, and then peer asked me for a hint. So I gave the following hint:

Tree with one node value 5,

  5

please return 0


Tree with root node value 5, and left child 5 and right child 1, please return 1

  5
 / \
5   1


Tree with root node value 5, and left child 5 and right child 5, please return 2

  5
 /  \
5   5

The interviewee took hint quickly and wrote a perfect answer in 10 minutes.


No comments:

Post a Comment