Dec. 13, 2017
It is a long mock interview for me, I worked together with the peer second time, the first time was less than a week ago, the blog is here.
We worked from 10:00 PM to 12:40 AM. I asked two more questions to interview the peer.
The peer helped me to write an algorithm related to recursion, memoization, edit distance problem.
Code review
The C# code is here.
Follow up
After the mock interview, I realized that the memoization has issue. I should declare the memo jagged array with size new int[length1 + 1][length2 + 1] instead of int[length1][length2].
The memoization should record the value for the top row and top column.
Line 42 and line 47.
One thing I can do is to test the code using Leetcode online about memoization design issue. Another one is to read dynamic programming solution, and check the two dimension matrix and its size, base case handling.
The peer brought up a lot of good discussion about the code, I changed the structure of the code to remove redundant code from line 62 to line 73.
From January 2015, she started to practice leetcode questions; she trains herself to stay focus, develops "muscle" memory when she practices those questions one by one. 2015年初, Julia开始参与做Leetcode, 开通自己第一个博客. 刷Leet code的题目, 她看了很多的代码, 每个人那学一点, 也开通Github, 发表自己的代码, 尝试写自己的一些体会. She learns from her favorite sports – tennis, 10,000 serves practice builds up good memory for a great serve. Just keep going. Hard work beats talent when talent fails to work hard.
No comments:
Post a Comment