Thursday, May 3, 2018

Being interviewer: Sentence reverse

May 3, 2018

Introduction


I was mock interviewer and the interviewee worked on the sentence reverse. And then we moved on the discussion of remove leading, trailing middle spaces.

Here is the code I used for me to be interviewer from Leetcode 151: reverse words in a string.

Mock interview


The interviewee wrote python solution and then we had discussion, work on coding to fit into removing extra space.

Here is python code, I lost it again before I saved it gist. I should save it without any name or description first.

Mock interview


It is so interesting I met a young graduate who is preparing Google onsite in a month. I had chance to talk and learn something from the mock interview. The mock interview lasted one hour fourty minutes. I tried to figure out how good a candidate is, but somehow I understood it. The way the peer handles the problem solving, he definitely can write good code using python, also he can work on the improvement right away once I pointed out.

The peer told me that one of the important things about interview is to communicate on the algorithm, and ask questions, clarify the problem, and also talk about things.

Chit chat about my performance



He likes my way to write down analysis using keywords, ask for:, constraints. I told him that I trained myself to spend first 5 minutes to write down the analysis, like system design, talk about keywords, constraints, and what to ask for. And then I can figure out how to design the algorithm. I tried to fully use the first 5 minutes, push myself to write down things, do not memeorize algorithm, do not assume the things, write down constraints.

And also the peer likes me to talk about the algorithm, and gave out the ideas to solve the problems. I told the peer that I have worked on coding skills so many times, definitely I feel comfortable now to write most common algorithm and data structure. For me, I have to make it real, write down the analysis, and then have discussion to find the optimal solution.

The peer gave me his idea to solve the problem. It is much better than me and simple. And then we had discussion, I asked if we can do better compared to his idea. Later, I shared array quadruplet post I did on code review website with the peer.

I have worked on those interview algorithm more than ten times. I already went through the stage to memorize the algorithm, and then made mistakes to mix algorithms. I treat all the algorithms are the same. From scratch, word by word, read the problem statement first.

I got complaint about deletion distance, dynamic programming algorithm, I memorized the solution and got complaint by an Intel senior engineer, Ph.D., he told me that it is no hire if I memorize the algorithm, write something before I fully understand the problem.

Now I try to act like a teacher, a lawyer, write down the keywords, constraints. I do have lessons from hackerrank contest since I missed some important words in the paragraph. It is also good time to demo how good I can read.





No comments:

Post a Comment