Saturday, May 26, 2018

Are Right, A Lot

May 26, 2018

Introduction


It is time for me to do some study on leadership one by one. It is not easy to come out the principle, but it is also very hard for me to look up those principles without a few good references. 

The principle is called Are Right, A Lot. The explanation is "Leaders are right a lot. They have strong judgment and good instincts. They seek diverse perspectives and work to disconfirm their beliefs."


Leadership study


Are right, A lot. 

Let me brainstorm the leadership on May 25, 2018.

Leaders are right a lot. This statement makes sense or not? Leader are right a lot. A lot means bigger than 50% probability, 70% is a lot? 

Judgement and good instincts. Question is how to define judgement as strong, how to define instincts are good. 

It is hard to mainain the strong judgement. Since bible says that do not judge otherwise you will be judged. 

Good instinct? Sometimes we have to practice a lot, meet a lot of people through mock interview, and then I can quickly learn how to make good judgement. Sometimes it is easy to tell that the peer is nervous, or trying to hide lack of practice, sometime the peer tries to get hint without asking. 

diverse perspectives? Give an example about diverse perspective, 

Work to disconfirm their beliefs.

Relate to my work experience


I have to work on some way to help me get motivated and keep getting help from various resources. I need a few platforms for me to play and get recognition for the hard work, knowledge about computer science, and good working spirit and easy to collaborate.

I need to brand myself. I need to work on daily and try to put together things. 

Work with my coach

May 26, 2018

Introduction


I like to spend some time to work on my coach training, and I like to share my research with my coach this weekend. Since we like to get close, I can have more ideas to learn from his coaching.

Write a short email first


I spent time to write one email after my last mock interview. The coach does not get impressed. He replied. So I wrote another one.

Hi, Mr. xxx, 

 I like to spend give five minutes to 10 minutes to share my favorite tennis sports. I like to find out ways to win.

 Sloane Stephens, rank from 974 to 17 since she won grand slam. She had foot surgery, training again, very good story to share, encouraging, USA style success story. 


 When is our next meeting? I will find time to work on my home work before our next meeting. 

I did send another email since I sent a wrong link of youtube:

Hi, Mr. xxx, 

Sorry, I sent wrong video. I like to share one video from USA athlete Sloane. 

I like to send this video from Sloane Stephens - https://www.youtube.com/watch?v=b1QM5cjlh_w

I like Sloane's coach, and her coaches and how they work together. 

Being coachable 


I like to work on small details to make myself a good student and allow my coach guide me better to solve algorithm and data structure problems. It is second week I got a coach. 

The coach told me to work on easy algorithm on Leetcode.com.




100 minutes to work with a young graduate - Copy linked list with random pointer

May 26, 2018

Introduction


I could not believe that I spent over 100 minutes to work with a young graduate on my May 25, 2018 10:00 PM mock interview. It was such great experience, I learned how to evaluate his performance and gave him honest feedback.

First Algorithm - copy linked list with random pointer

I will come back to write down more.

Second algorithm - Maximum subarray product

I will come back to write down more.

Wednesday, May 23, 2018

Being an interviewee: Suggest a char with maximum occurrence at the position with the given prefix

May 23, 2018

Introduction


It is my most favorite algorithm to practice with my coach. The algorithm is called to suggest a char with maximum occurrence at the position with the given prefix.

The coached asked me if I have Trie experience two days before my mock interview, so I spent some time to review Leetcode 212 and also my question on stackexchange.com.

The conversation of writing a Trie data structure was very interesting.


Coach: can you explain how you define the Trie?
Julia: It should be recursive structure, Children should have Node type as well.
Coach: Do you need to have a list of numbers for children?
Julia: No. It should be minimum. Every node just takes care of its own number.

In-between the mock interview, the coach asked me why you define the Trie this way, save "ABC" as a member of class definition. I just told the coach that I memorized the solution I reviewed recently. But actually we do not need to do that here. I felt much more relax after we work together more than 10 hours.

Trie algorithm


I learn how to work with the coach and write a solution in the mock interview. And also the coach asked me to test the code using the test case documented from line 93 to line 96, I found the bug on line 107, and delay increment of index variable until line 123.

Here is the transcript of the mock interview.

Follow up 


I wrote the C# code and tested it using a simple test case. Now it is 12:21 AM, I need to rush to go to bed since at tomorrow 8:00 AM I will have a mock interview.

10:00 PM mock interview as interviewer


I also ask the interviewee to work on the algorithm at 10:00 PM mock interview. The intervewee has more than eight years experience working in Silicon Valley to target for biggest software companies, and I helped him to write a Trie solution. What I did is to try to copy my coach, how he did to me. I asked the interviewee to work on the test case, show me the trie, and also give hint to use array for fixed size instead of using Dictionary.

Here is the C# code the interviewee wrote before I write my own C# solution.

Code review from my coach


I sent an email to ask the coach to review my code before I will have next mock interview. The coach offered me to send the code before mocking interview after our second mock interview, so he can prepare better for next mock interview. We can squeeze in more activities in the mock interview together. My coach is super talent programmer and I like his working attitude.

"I think that it is definitely no problem at all. Let us meet Friday morning.

I just like to send you the code I wrote for suggest char based on prefix.

Here is the link."

May 25, 2018
8:00 AM

My coach told me that one thing is not correct. The iterate variable may be null pointer. I need to add null pointer checking on line 152.

Being an interviewee: Leetcode 42: Trapping rain water

May 23, 2018

Introduction


I asked my friend to give me a mock interview and he offered me to practice mock interview Tuesday and Thursday and Friday for 45 minutes each time. He did very good job to ask me to work on Leetcode 42: Trapping rain water. He also gave me some good advice, but he gave out the major hint too quick so that I did not have to come out the solution by myself.

I was nervous and talked about brute force solution, and then talked about descending stack. I made a mistake to try to relate to the algorithm I practiced recently. This is a bad behavior, the interviewer had discussion with me at the end of mock interview. I should get rid of this non reasoning thinking, I am supposed to work on the algorithm I have never seen before. So I have to practice my approach based on the facts, test cases, intuition etc.

The solution is nothing to do with descending stack, but the interviewer just gave away the major hint. He told me to scan two times, one is from left to right, the second one is to scan right to left.

Mock interview 


Here is the transcript of the mock interview.

Follow up


After mock interview, I wrote a C# solution. Here is the link.

Ask help from my coach in Tsinghua university


I sent an email to my coach to ask help on May 25 12:20 AM:

I am glad to find you as my coach. Here is the algorithm I mocked interview Tuesday with Mr. Yang. I did not do very well on analysis, take a look if you have a few minutes.

Here is the blog link.

I have to call it a day. Talk to you later.

May 25, 2018
8:20 AM
The coach told me that I did not have time to develop the solution using descending stack. Actually the rain water is filled up for each time range incrementally. He explained the algorithm to me based on given test case, I understand the algorithm right away.

Basically there are multiple ways to solve the algorithm, my interviewer only knows one way to solve it.

I will write C# solution based on descending stack later.

Find string s2 containg s1 permutation - 5th interview from my coach

May 23, 2018

Introduction


It is the algorithm called find string s2 containing s1 permutation. I wrote the algorithm using sliding window, and also implement the algorithm using time complexity O(N) where N is the length of string s2.


Algorithm


Here is the transcript for my mock interview. We used Google Docs.

I wrote the code but there are some issues in my code. The coach spent over 5 minutes to test my code using a test case, and then he shared with me his implementation using time complexity O(26*N) solution.

Here is my C# algorithm I wrote after the mock interview.

Tuesday, May 22, 2018

Invent and Simplify principle study

May 22, 2018

Introduction


It is the principle called Invent and simplify principle. It is my favorite. Here is the explanation. Leaders expect and require innovation and invention from their teams and always find ways to simplify. They are extremely aware, look for new ideas from everywhere, and are not limited by "not invented here". As we do new things, we accept that we may be misunderstood for long periods of time.

Principle study


Let me write down some keywords in the above principle here:


innovation and invention
find ways to simplify
aware and look for new ideas, also from everywhere. Everywhere is the keyword.
new things
may be misunderstood for long periods of time

long periods of time - how long? one week, one month, one year?


S.T.A.R story


It is my favorite principle. I have so many things to write down.

I look for ways to learn how to write simple code, readable code.

Action: I asked questions on stackexchange.com, I start to write on quora.com, Leetcode discussion panel, my own coding blog.

I practice mock interview daily, understand how others do the work as software engineer, learn to evaluate the talent, learn one soft skill a time.

I practiced one algorithm over 50 times. I have written one algorithm in mock interview over ten times.

New things I tried last 5 months:

Udemy.com
...

Result:

will seen the result one day.

Ownership principle study

May 22, 2018

Introduction


It is my task to write a short blog about Ownership principle. Here are the detail about the ownership, leaders are owners. They think long term and don't sacrifice long-term value for short-term results. They act on behalf of the entire company, beyond just their own team. They never say "that's not my job".

Here are the words in the above statement:
Leaders, owners,
long-term value  vs short-term result
entire company   vs their own team
That is not my job

Study note


I like to study the leadership one a time.

If I like to apply the principle to my current job, what is the case?

Long-term value vs short-term result

Long-term value - I try to rewrite the website to make sure the code is readable, remove smell of code, write simple code, break giant function or object into small objects. Apply object-oriented design.

I plan to study those courses on frontendmasters.com about web security, and I learn how to use Google web browser developer tools.

Short-term result - visual things to do, visual evidence I do the work. Something surface level.

This is not my job - Have I said that sentence before?


S.T.A.R story


I like to come out a few stories related to ownership.

Source control


S  - Situation - Virus issue on my computer, ransom attack
T - Task - I need to figure out better way to do source control
A - Action - last August I started to purchase github service annual subscription. I did some research on source control available products, and then I chose to subscribe the github.
R - Result  - The source control is advanced to much better status compared to before.

Web server and database migration

Anti virus software incident 


S - Situation - false positive, the anti-virus software deleted database file
T - Solve the issue - restore the database
A - Restore the website
      Study the virus and anti-virus, and ask questions about false positive issue
      Need more work here ...
R - Result
   

Website onwership


I need to balance my time on different issues, front end, use interaction, website architecture, SQL server administration, and all related issues.

A list of things happened:

SQL injection attack

Virus software removed the database file

Database server and web server migration

Work with consultation company to upgrade the database server, IIS server

IIS 8.0 learning

C#, JavaScript, HTML, CSS, Jquery coding

Vacation break challenge

Work with sales, marketing and graphic design

Move source control to github after ransom attack, server upgrade etc. in 2017.

Business analysis ownership


Sales analysis or any analysis, how to handle dispute? The program I write and design I have to make change after 2015, if there is any dispute, I should be able to set down the dispute in less than 5 minutes.



Monday, May 21, 2018

From Julia coding blog to self-training course on udemy.com

May 21, 2018

Introduction


It is the holiday and then I tried to do something creative. I like to prepare for a course on udemy.com, the course is titled "From Julia coding blog to self-training course".

I have a list thing to do before I can submit the course for a review.

Things to work on


Here is the things to work on. I am planning to find time to work on 30 minutes a time.




Good programmer needs friends

May 21, 2018

Introduction


I could not believe that I got contacted by a few friends I made over mock interview practice last 12 months this long weekend. The work they did for me are touching my heart.

I am more open and confident. I first purchased my video course on udemy.com and also I purchased grokking system design interview course.

I still remembered that one of UCLA students gave me mock interview comment, stubborn, do not take hint less than six months ago. I worked on the algorithm called Largest smaller key in BST. 


Most challenge work 


Today I also like to write down for a small research topic called most challenge work I have done. If it is not challenge enough, I will find another one. I will try a few times until it is really challenge one. 

I had a holiday break today, and then I invited my friend to chat with me. I was trying to relax and have some reading work to do before I work on my home work from my coach. I did not do very well on my last mock interview, I practiced over ten times on word count engine algorithm. The coach gave me similar question, but he likes me to show very good coding as well with optimal space complexity. 

I do believe there are a lot of benefit to join one community or another one in order to help to build a good career in software industry. But I do think there is something missing in normal business practice. I also try to experience and tell that. Do your current job very well. Make your current employer happy. 

Counter argument is that if you can get a job with double salary why you choose to work on the less one. But in reality, only less than six percent will be selected after phone screen and onsite screening. Most of us are still working on daily job as usual. 

Another thing is how to embrace the hard work. I do see my weakness to solve simple and medium algorithm, since I like to solve advanced ones or hard level on Hackerrank, I notice that it is easy to get excited and continuously try to solve one, 10 hours to solve one algorithm scoring one with score zero. No complaint and also I was so happy to have pushed myself so hard on submitting all kinds of ideas against online judge of Hackerrank. 

I have worked with my coach last past week, I understood that he must have put hundreds of hours to complete Leetcode over 600 algorithms. I could not do it for all kinds of reason. I also like to get reality what weakness I have once a while. 


Try to answer this way



My most challenge work I like to do is to make my current job very easy and relax. 

It is not easy for several reasons right now. I have to learn so many things but I like to get good at foundations which are computer science data structure and algorithm.



Find best coach 


I practice so many mock interviews and meet a lot of people. One day I was so amazed that the peer performed so well since I could not fail him after I gave more than four algorithms. After more than 90 minutes talk, I knew that I may find a coach for myself.  


After more than four months, I contacted the graduate student and ask his help to be a coach and hitting partner to practice algorithm and data structure. The coach has practice over 600 Leetcode algorithms. 


Work with the coach


It is not easy to work with the coach and come out the good result in three weeks short time. We have to work together enough time before we can trust the coach and player relationship will work very well.


Why it is most challenge work? 


First I have to understand why I need a coach. I learn it from tennis sports last few years. 

By observing how professional tennis players prepare for China open in Beijing, I learn how professional tennis players develop relationship with each other and also with coaches and hitting partner, personal assistants. 

I need a coach this time for three weeks preparation. Why I need a coach? I try to get more educated and well-prepared. I like to beat the odds against 80% with more dedicated training. 

My coach can help me think about more in terms of algorithm and data structure. And I like to find out my weakness and learn something from the coach's experience. 


My fourth mock interview given by coach - suggest a char

May 21, 2018

Introduction


It is the fourth mock interview I got from my coach. He demonstrated his superior coding skills, he reviewed the code I wrote after mock interview, I made a terrible bug in iterative solution of find the height of tree algorithm documented in the blog, and then I should continue to simplify recursive solution for height of tree as well. It took around 40 minutes for him to review those two algorithm, and one more from the peer I interviewed as an interviewer.

Algorithm to suggest a char


Here is the transcript I worked on the algorithm and my coach spent time to coach me using less space, instead of going over each word, he advised me to go over each char at the same position in all the words.

I also showed him my word count practice, and asked his code review.

We worked together very hard, I am in the city of Vancouver, and the coach is in Beijing, China. I wad told that the talk is cheap, show me the code. I never doubt my coding ability, I think if I explain the idea, he should trust I can write. But that is not the case yet.

The time of interview is from May 19 8:00 AM - 9:46 AM PST.

The code is here to lookup.

Being an interviewee: Set binary tree next pointer

May 21, 2018

Introduction


It is the first meeting I had with the friend's friend. I like to meet and practice algorithms together. My task is to write a next pointer for a binary tree.

Mock interview


Here is the algorithm I wrote.

Leetcode 116: Set binary tree next pointer

Being an interviewer: Copy linked list with a random pointer

May 21, 2018

Introduction


I was surprised to get contacted by a friend's friend and it is from another country Australia. I was so surprised to learn that. I have a new hitting partner to practice algorithm and data structure.

I spent first 20 minutes to share my experience of learning first. Here is the gist I documented, the note is kind of messy, next time I will write more clean and make it more readable.

Mock interview algorithm


I gave an algorithm for the peer to work on. Here is code and then my code for copying the singly linked list with next pointer.

The peer spent over 10 minutes to write a function using iterative solution, and then I also gave my code with some explanation.

Random pointer handling


The peer also worked on the random pointer, I had to ask her to give me her idea first before she wrote the code. And then she found out that she had some issues to figure out how to do the work.

Here is the transcript.

Sunday, May 20, 2018

Prepare leadership stories - moving to No. 1

May 20, 2018


Introduction


It is my long weekend. I really enjoy so many activities. One thing I did is to find leadership stories by going over my resume and then reading some blogs. 


What I also like to do is to document some sports time. I like to watch those tennis professional players. I like to learn how Angel Kerber handled her advance to No. 1 ranking in 2016. 



Interview study


Here is the blog I reviewed. 


Angelique Kerber R3 Interview in Studio - Sep 2, 2016, the interview link is here. 


I like to borrow some ideas from the above interview, and I like to use those ideas to help me find stories in my past 8 years and them categorize them with leadership principles. 


It is so special to learn from sports

Do not get into second week of grand slams. Talk to the coach and set a goal. 

Set a goal to play big tournament very well. Get into second week of tournament. 
Going for it? How much more aggressive? 
  
Technique - hit early, going for, focus on every single point 
  57%, 10%, 33% 
selection of shots - work on the practice -> going for right shots

Try to go for, 
improved attitude? 

  Go out .., put heart on the court, moving better, ..., enjoy everything, ..., if not so nervous

No. 1 ranking? 
  Day will happen. It is still focusing every single point out there. 


Friday, May 18, 2018

Leadership principles - Customer obsession

May 18, 2018

Introduction


I have to learn leadership principle one by one. In order to learn better this time, I like to write a blog for each principle.

I am very good to write short one first and then add some good content later on.

Customer obsession


How to relate to my own work last 8 years? Do I really understand the customer obsession leadership principle?

keywords:
Leaders start with customers and work backwards. <- backward, start with customers

Work vigorously -> vigorously -> how to express vigorously?
Earn and keep customer trust -> trust, earn and keep
How do I understand the trust, customer trust?
Alternative choice, competitors, pay attention to vs obsess

Two groups, one is competitors, one is customer.

My task 

I need to write my own story. It is not easy to write a good one without preparation. I will think about and write down something here.

I need to identify the customer and competitors. How to define pay attention to and obsess? Give an example of Earn and keep customer trust.

Brainstorm stories:

1. Current employer is my customer, next employer is competitor; I need to pay attention to the competitors, but I Need to be obsessed with customer. Earn and keep the trust.
Evaluate current company website, need to make code readable, clean. I like to make the software product as simple as possible.

Do not pay attention to the competitor.
First five years - work with different technologies - play and try
Last three years - work on foundation of data structure and algorithm. Try to write coding blog, ask questions on code review stackexchange, write on Quora.com. Meet people through mock interview platform.

2. Cellular phone, high density device, mobile website image display. Extra work for graphic work.
3. Website fit for all devices vs website maintenance issue, subscribe the courses to help myself strength the website; fancy interface, sales manager pitch vs customer need. Keep busy or look busy vs work on basics
4. Vacation plan - one week - Learn to plan, listen to the opinion. Catch up latest technology.
5. Virus software false positive - remove virus software from database server
6. Network virus - ransom attack - version control - github - website source control
7. Web server database server/ IIS server migration
8. Read my common mistakes after 80 mock interviews, there are some good story to think about.
9. Another one:
http://juliachencoding.blogspot.ca/search?q=stackoverflow+
10. Story about website does not response very well. For example, product menu bar is designed to list 7 products in a row, the customer has difficult to choose one to continue. One thing I came out is to add hover over display, listing all lumens of the product.

I did a few hours work to show the prototype of the work. (Situation, Task, Action, Result)
11. Hold high standard. If there is any dispute, the software I design and develop, I should be able defend my number in less than 5 minutes to settle down any dispute.

Grokking the System Design Interview

May 18, 2018

Introduction


I have to start to learn system design today. I really like to learn something this time. Recently my friend spent 90 minutes to talk about system design to me. I am really excited to learn something new this time.

Two years ago, I had chance to learn something to prepare a system design interview. But I did not learn very well.

I like to purchase the course and then spend time to read those materials. I want to learn system design very well, so I can use the skill to work on exciting projects.


Study time


I have to simplify my system design learning. I like to spend next two weeks to work on the system design, focus on Grokking the system design interview first.

One thing I like to do is to log the time I spent on the reading.

May 21, 2018

One hour reading ...

May 26, 2018

I spent a few hours to read system design for pastebin and instagram,



Software engineer interview unleashed

May 18, 2018

Introduction


I decide to purchase the course on udemy.com given by former Google, Ph.D. Jeff Bae. The course is called software engineer interview unleashed.

I like to show the support for the PH.D., and I like his hard work to present a course on udemy.com. I wish that I can put together something with my coach together next two weeks. But I know that it is not easy to make a good one.

So excited, my first Udemy course


I like to spend time on the course as soon as possible.


Leetcode algorithms tagged by stack

May 18, 2018

Introduction


I like to find all Leetcode algorithms tagged by stack, and then I can read those algorithm problem statement first.  I am training myself to analyze the algorithm, quickly relate to stack to figure out how to solve the problem.

I notice that the training of data structure and algorithm takes a lot of work. I had three mock interview with my coach last Sunday, Tuesday and Thursday. I learned that it is good to have a coach, who can help you prepare for better performance in short future. I was tested on algorithm called Next great element.





Thursday, May 17, 2018

Being an interviewer: Find least number of perfect square sum to given number

Being an interviewer: Print binary tree extreme corner alternate order

Leetcode 152: Maximum Product subarray

May 17, 2018

Introduction 


I just could not believe that I have chance to interview top university graduate student with excellent performance. I chose two algorithms I had this week mock interview given by my coach, the interviewee solved two of them quickly and very efficiently.

I just asked her third algorithm after 50 minutes to see if I can fail her on the dynamic programming algorithm. We had good discussion on this algorithm called Leetcode 152: Maximum product subarray.

Mock interview 


I will write down some discussion here. I like to learn the algorithm at least 10 times with various talents in the world first,  and then I will definitely feel more comfortable to solve the dynamic programming solution.


Find next large value in the array - my third mock interview given by my coach

May 17, 2018

Introduction


I have the third mock interview given by my coach. I was surprised that the coach encouraged me think hard in mock interview. I like to write down our discussion and help myself to learn this algorithm using stack to track next large value.

Mock interview


Here is the transcript. I will write down my analysis, discussion with the coach, how the coach gave me hint. What are things to work on?

I am exciting to learn the algorithm through practicing with strongest hitting partner in the world.

After mock interview ...


How to train myself to come out the optimal solution?


In my mock interview, I did a few things correctly. I started from brute force solution with time complexity O(n2), n is size of the array. And I told the interviewer that I like to do preprocessing.

How to do it? I think that there are two popular ways, one is to use dynamic programming technique, to save the maximum or minimum or other statistics from left to right or right to left iteration.

And the other is to bring stack descending or ascending order to help, this one has some advantage to handle magic things.

Actually the second one is to bring stack descending or ascending order to help, this one has some advantage to handle magic things. My coach taught me the two words summarized as ascending stack or descending stack. I just could not believe that I could not figure out the technique since I do not play with more test cases.

The coach told me that I should say that let me think about a few minutes. So this way I do not need to talk all the time. Quiet time is also very helpful.

My favorite algorithm


I do not know how to push myself to think smart in the mock interview. I have practiced largest rectangle histogram using stack a few times last 6 months. But under the stress of the interview, the data structure just cannot come out quickly since I thought about each element in the array to store data using a data structure, like an array. But I break somewhere in thinking process to connect dots, so I like to write some dots like the following:

I believe that playing with simple test cases I can come out the idea naturally.

But in the mock interview, I was thinking that it takes too much effort for the coach to set up meeting, sacrifice of time to sleep, it is past 12 PM midnight in China. I could not concentrate to push myself think harder.

I just wrote down more here now since it is after the mock interview.

First I talked to my coach to simplify the test case. The coach said that let us get half numbers. I told him that let me choose simple number on line 33: 1, 2, 3, 2, 1

But I like to think about more, to work on a few base cases:

1. test case: [1, 2, 3]

2. test case: [3, 2, 1]

3. test case: [2, 1, 3]

How can I do preprocessing?

First let us go over the answer for each test case.

For test case 1, [1, 2,3], the answer is [2, 3, 3]. The largest one is its right neighbor, the array itself is ascending order.
For test case 2: [3, 2, 1], the answer is [3, 2, 1]. Notice that the array is descending order.
For test case 3: [2, 1, 3], the answer is [3,3,3]. Notice that first 2 elements in the array are descending order, and then 3 is bigger than previous.

And also I am thinking this way. Preprocessing using dynamic programming idea.

First test case:

[1, 2, 3]

The coach gave me hint to iterate from left to right, I like to follow him instead of right to left.

Iterate the first number 1, what I should put into preprocessing array, I could not tell, I need to find largest number met in the future iteration. I do not want to go back again, I need to save it.
[1, ?, ?].

Iterate the second element with value 2, we need to give 2 to its previous element with index = 0, we need to move index = 0 out of data structure, and put result array [2, ?, ?].


Second test case:

Let me work on the second test case:


[3, 2, 1]

First iteration, visit 3, we have to save index = 0 into a data structure, since the coach told me that I should save it to a data structure.
Second iteration, visit 2, 2 is smaller than previous one, save index = 1.

Test case 3:

[2, 1, 3]

Let me talk about magic thing about [2, 1, 3] test case.

First iteration, visit 2, we can not do anything, push 2 to the data structure. Next iteration visit 1, since 1 is smaller than previous value 2, I can not do anything either. Push 2 to the data structure. Now iteration visit is 3, which is bigger value than previous number, we have to put index = 1 with value 3, and pop index = 1 out of data structure; now index = 0 is the last one, 3 should also go to index = 0.

So the order of assigning the value is in reverse order. The index is at the top of data structure, and then it can associate with current iterated visting element.

There is a first in last out process.

Just try to please my stack muscle memory! I am counting on this piece of memory. I should practice more on this thinking process, related to one simple test case.

I was busy thinking that each element holds one data structure when the coach gave me the hint.

I love to learn this algorithm, so I just write down more and see if I can use the approach by playing with test cases.


Ready to show my coach the solution


I wrote a C# solution and then I can show my coach the solution this Saturday May 19, 2018 8:00 AM mock interview. I like to find out if there is extra line of code included, or the code can be improved. It is always excited to have a coach. I need to get back to stay confident and positive.

Usually my coach will say that you clean up the code very well. But in mock interview, you write messy code with a few bugs. It will be written down and take points away.


Research algorithm based on stack



I am planning to work on algorithm based on stack. Here are the list of algorithms related to stack.


Being an interviewer: Find height of tree

May 17, 2018

Introduction


It is so enjoyable to work with a young talent at 10:00 PM mock interview. I asked the interviewee to work on the algorithm to find height of tree, and then I found out that I learned a few thing through mock interview, and also I enjoyed discussion with the peer.

The peer is a top performer in his undergraduate. I just could not believe that I just learn from the third year undergraduate and also learn to be a better interviewer.

Mock interview


I will play again the video and see the interview again. Also I will post some code in C++ here later.


Find height of tree - My third mock interview given by my coach

May 17, 2018

Introduction


It is my third mock interview this 8:00 AM. I had very good learning experience in mock interview. I started to learn how to communicate better to work with my coach. He also started to think about helping me to work hard to find bugs in my code.

Mock interview


Here is my transcript. I will write C# code with some test cases, and also try to use recursive function to get node's level of tree for each node starting from 0 as root node.

Coach's advice


Through the mock interview, I was told that there are several issues on my iterative solution. I made a few mistakes. And then I was told to think recursively. If the current node depends on parent's node in terms of height calculation, then it is better to write a recursive solution.

Here is recursive solution I wrote after the mock interview.

I still could not believe that I made a few mistakes, and even I used Visual Studio debugger to help me to troubleshoot the issue. I missed the line 115 to assign value to heightIds[index].

Iterative solution is hard to think



I spent over 30 minutes to write and debug the code, I had to fix my thinking process ending up nothing is calculated. I missed the base case when the node has parent with value -1, then the node's height is one.

Here is iterative solution in C#.

From the performance of this algorithm in the mock interview, I learned the lesson to write an iterative solution correctly is not easy at all. So many bugs and even I write using Visual studio I keep finding issues.

A few places to be corrected after the mock interview:

1. base case: line 126 - line 128
2. line 139, I like to break the list iteration as soon as possible. Make sure that only uncalculated nodes are visited.

I think that the solution may also be broken the time complexity O(N). It is hard to write iterate a solution.

Lesson learned


Think recursively, think memorization. Try to cut time to O(N) linear time.

Wednesday, May 16, 2018

Essay practice

May 16, 2018

Introduction


It is so nice to have a roommate to give a free essay lesson, and also she recorded the video for me. After that, she also gave me at least 10 minutes what I should work on. She gave her own version how she approached the problem as IELTS full time teacher with one year experience.

Write about the following topic:

Some people think that charity organizations should only offer help to people of their own country. But others believe that these organizations should give aid to people in great need whenever they live.

Video 


I like to upload the video to youtube.com, since it is such a big file. Otherwise the file will get lost. There are so many issues in my talk.

I have to start from somewhere. It is better to document my experience.

List of problems


1. There is no interaction with audience
2. The way I looked at people is kind of strange. I did not focus on a person, I moved away.
3. It looks funny somehow
4. The talk is not structured. Audience does not know where it is in the talk. It is better to talk about three points, and tell audience right now which point it is.
5. The hair style is not so good. Leave the fronthead open, show more confident.
6. I should answer two tasks: Two views, write down key points for each view, and talk about them. This is the first task. Second task is to express my opinion.

The video is far below the standard. Just close eye after 20 seconds.

My friend got her training first two months when she started the current job. She practices over ten times for one lecture, using techniques like recording the lecture video, review and try again.

Print binary tree extreme corner in alternate order

May 16, 2018

Introduction


It was such great experience to mock interview a USC computer master degree student, she spent less than 20 minutes to write almost perfect solution using python.

Here is python code.


Feedback


Here is the feedback I wrote for one hour 10 minutes mock interview.


Tuesday, May 15, 2018

Find the least number of perfect square numbers sum equal to given number

May 15, 2018

Introduction


It is the second algorithm in my mock interview today. I like to show my transcript here and plan to write a C# solution when I have a few minutes.

Follow up 


Here is my C# code. I made a mistake and then I fixed the bug.


Swap kth node with kth to last node in singly linked list (recursive solution)

May 15, 2018


Introduction


I had a mock interview this morning. I learned such important lesson in mock interview. Actually I tried to reconstruct a linked list involving four nodes in the linked list. Actually I can just swap values in those two nodes instead.

After the mock interview I also learned the lesson to write a recursive solution. Since I can write the algorithm in less than 10 minutes.

Mock interview


Here is the transcript at 8:00 AM mock interview.

Recursive solution


Here is my C# practice after the mock interview.

My bible for next three weeks

May 15, 2018

Introduction


It was a busy day but I did spend 10 minutes to do some research, and then I found the Leetcode solution written in C++. I choose the solutions as my bible for next three weeks.

My ambitious goal is to read as many solutions as possible, I should reduce time on wechat, instagram, I like to learn a few algorithms this time.

Here is the link.


Manhantan 2 - Booking woman in tech

May 15, 2018

Introduction


I got a coach and then I learn something by observing him how quickly he can read the problem, review my code, and discuss the solution with me on this dynamic programming algorithm.

I will write down the solution based on our discussion lasting over 15 minutes. I showed my coach the blog with C# algorithm I wrote using dynamic programming solution.




Second mock interview given by my coach

May 15, 2018

Introduction


It was early in 7:40 AM. My coach asked me if I can start early today for a session. We actually worked together from 7:40 AM to 9:30 AM. I just could not believe that.

We did review the algorithm of last mock interview, I showed the coach the algorithm Manhanttan 2, he spent around 10 minutes to think about the solution, we had great discussion. I joked that next time he and I can write some algorithm for Hackerrank contest.

Next I was asked to work on the singly linked list to swap two nodes.

The last I was asked to solve a dynamic programming solution.


Vancouver does not believe in tears

May 15, 2018

Introduction


I like to write a blog called Vancouver does not believe in tears. The story is related to implement the algorithm I was asked in mock interview called swap two nodes in singly linked list. I learned through and after the mock interview on May 15, 2018.

It is a mistake when I write down the test case. I spent time to practice the algorithm called swap kth node with the kth from the end in a singly linked list. Here is C# code.

I made a mistake in my test case, line 37 and line 38 left hand variables are exactly the same, but I tried to find the bug in the algorithm. I spent over one hour and I could explain what kind of bug it was. The behavior was so strange, I used debugger but I could not explain.

My test case is a singly linked list fro 1->2->3->4->5->6, and I like to test the swap 2nd node with 2nd to last end one node. But I made a mistake in test function, the list is created only with 5 nodes, 1->2->3->4->5.

I felt frustrated, and almost exhausted. So I relaxed myself to review one of linked list practices. I came cross one of practice using recursive function. I decided to write a solution based on the recursive function. I found the mistake in test case setup in my code.

How to work with frustration? 


I am so glad to experience the frustration again. I like to measure the level, what kind of actions I have, and later on I can come out good ideas to deal with those kind of mistake.

First let me measure the frustration level, give it rate 7 out of 10. I thought about doing really challenging practice on algorithm, but ended up working on trivial things.

I documented last time I came into tears after the mock interview. After I read the feedback from the interviewer. It is harsh and I Need to learn the lesson of learning harder.


Laundry list of excuses


I like to give possible reasons why I can not handle stress very well in my practice. I can think about several things, first not enough sleep; stress from principal applicant deadline, I need to fill the form for my nephew. And also I do not anticipate anything longer than one hour to write and debug.

In the morning mock interview, I did not simplify the task to swap two nodes's value but instead of working on node reconnects in the singly linked list. Through the mock interview, I learn that I may have done a lot of time at work, I should simplify the task first instead of messing with a complicated problem unnecessary.

I could not believe that I just did very good job for myself last week, and then next week I need to learn from the lesson again. Ask questions about the algorithm, dig deep. Define the requirement, seek the shortcut if there is one. solve the problem quickly first.

Extra 5% cholesterol

May 15, 2018

Introduction


I do not have time to practice tennis as often as I do since I start to work on mock interviews daily. But I need to handle some issue, out-of-normal-range cholesterol value. Just above upper bound not more than 5%. The doctor just told me that I should keep physical exercise and eat healthy.

In order to help myself catch up learning, I like to write my favorite topic a first blog.

Extra 5% cholesterol 


I learn to make sense the value of cholesterol. I need to spell correctly, there is e between cholest and rol. I highlighed e in the last sentence.


Principle applicant paper work ready to go?

May 15, 2018

Introduction


I have to work on a few things and help my young sister and my nephew to send out the principal applicant paper work with physical examination information. I filed all the paper work and then my nephew does not know the whole process. I have to examine all paper work, write a letter to list the documents, and fill the form again to update last 7 months status of applicant.

I even told the young man that he needs to pay land of permanent resident fee. I paid the fee and shared the receipt.

I learn to work with my sister-in-law and also my young sister. I have a nephew who chooses not to contact me directly.

Express the intent


I am open to learn from the young generation people. I like to be a coach for my nephew, but he chooses not to talk to me directly. I have to report to his mom and my young sister.

To get along with people better, I believe that I can learn from working with my relatives first.


My church revisit after 8 years

My burnaby mountain park trip

My grouse mountain hiking trip

May 16, 2018

Introduction



My friends Cai Yongmei and Dr. Huang came from Florida to visit the city of Vancouver the first time, I was so happy to hang out with the couple and experienced the beauty of Vancouver. Last Saturday we spent almost whole day on the grouse mountain.

I hiked, and then walked on the snow, and then enjoyed the company of friends. We know each other over 12 years.

I like to post some photos and videos and then we like to celebrate the good life together with friends.

Do I make things too easy?

May 15, 2018

Introduction


It is so much laughing today since I had chance to review my own code written more than 12 months ago. Is that true every 12 months you advance your programming skills? Since I learn how to come out dynamic programming solution without any headache, I found out my practice over 6 hours in the contest was so such a good thing to laugh about.

I am self-learner on algorithm problem solving. I am pushing myself to top of world level? I could not believe that I wrote so many lines of code, I documented it. The blog serves the purpose to teach me that good code is to write short, very clean code compared to the long complicated functions.

Code comparison


Here is the solution I played with stack with so many things, including extra comment up to 400 lines of code. I did it more than 13 months ago.

Laughing moment. Laughing...

I wrote simple code today. So simple and I could not laugh one more time. The code still has bugs, but I will sort out the constraints in the problem statement.

Dynamic programming solution is here written on May 15, 2018.

Keep writing some code every day and write some coding blog every day.



System design: stream service for twitter

May 15, 2018

Plan to watch some system design video 20 minutes. I like to find 10 topics about system design first, here is the article.

Good programmer starts from learning writing daily

May 14, 2018

Introduction


I had such great experience to mock interview with young master graduate student from university of Florida. He did work on the algorithm called find largest smaller key in binary search tree.

I was so surprised that he worked with me so well, every hint I gave he took action to fix the bug in the code. And so many bugs it really makes the mock interview so exciting. He fixed all of them. It is so nice to work with him. I know that he definitely can learn more and improve more.

Through the peer's mistakes, I learn the way a young graduate learns algorithm so quickly. He told me that he completed more than 240 Leetcode algorithms.


Hard working 


I gave out my encouragement comment. And the peer was so appreciated and he shared with me his experience.

I understood that as a software programmer, maybe, there are a lot of ways to improve your technical skills. But definitely good habits like learning new things, be nice, treat people nice and easy will build up more opportunity to open to the world.

Today I learned from the peer's story. Maybe I will experience his story as well. But I saw his attitude and hard working spirit. I was so proud of University of Florida. He shared his personal experience to compete for a position with number 100 each day onsite interview a global company, he helped me understand the statistics with first hand experience.

I lived in Florida state from 1996 to 2010. I am an alumni alumna of Florida Atlantic university.

Monday, May 14, 2018

Announcer badge

May 14, 2018

Introduction


It is called Announcer badge, one more badge I got on code review site, I did spend time to complete 5 minutes research. I like to document my feeling and learning here.

Announcer badge


I  like to document my badge experience, encourage more people to write and share, make learning and teaching more close to our daily life.

I was complained by my young sister who has more than 25 years teaching experience. She complained about my selfish. So I took some action to share my writing on Leetcode discussion, and I brought myself a badge called Announcer.

Let me show two images about badge information and my 22 badges first.





Here is my algorithm link on Leetcode discussion panel.

I crossed reference my two sharings, one is on code review site, one is on Leetcode discussion. I learned the announcer badge. I should give thanks to my young sister who teaches me some valuable lesson. In order to be a excellent software programmer, I should not be selfish. Writing is my favorite, sharing is also. Do not care too much your sharing. Keep writing more on other site. Give attention to open community like Leetcode discussion panel.


Behavior interview with a friend

May 14, 2018

Introduction


I was luck that my friend finally found time to train me behavior interview. We practiced together two hours, he gave me a few lessons. My biggest problem is to ramble. How to speak very clearly?

Mock interview


I will document my practice here.


Manhantan 2 - Booking woman in tech

May 14, 2018

Introduction


It is so good to review my practice on the algorithm called Manhantan 2 more than 13 months ago. Hackerrank has all my submissions of the algorithm. I was so glad to know that I can solve the algorithm quickly using dynamic programming solution.

I spent over 30 minutes to write the solution, and then debugged the code and fixed a few issues. But I still missed some constraints, I could not come out the idea to all the algorithm pass all test cases. I need to write down keywords in the problem statement.

Dynamic programming solution


Here is C# code I wrote using dynamic programming solution.

I still like to write down a few lessons I learned through the practice.

1. Line 117 the function name is not matching the work. It should be called FindMaxCandiesFromLeftTopToBottomRight.

2. base case line 129, I added the statement before debugging the code.

3. The three loops (line 132, line 134, line 140) is kind of interesting. I came out the idea when I visited the restroom.

I tried to come out the idea to prune the algorithm, minimumToDestination variable is used to help the third loop.

I made mistake on missing line 167, after the debugging, I found out that my result is always 2. So I need to add line 169, but then my result is bigger so I fixed bug to write one statement ( line 167 ). And then I fixed the issue on line 124, I added 1 to the variable timeToLive.

Funny notes but harding work spirit


I like to read my own comment written more than 13 months ago. I was very hard working, but I need to learn how to write dynamic programming solution. I like to copy the notes here.

" The idea is to start from top left node, always go right or down, and then track the  sum and max value; Because the size of matrix is 100 * 100, queue will cause out-of-memory, use stack, DFS search, try to use recursive solution if possible 200 depth at most, 100 + 100 try to get some points first, and then get the idea - 2:35pm - 7pm, now it is 7:53pm, what is the possible reason to get wrong answer? ".

I could not keep laughing, I was so glad that I moved on mock interview starting last April, 2017. At that time, I wrote broken English with a few Grammar errors here.

Because the size of matrix is 100 * 100, queue will cause out-of-memory, use stack, DFS search, try to use recursive solution if possible 200 depth at most, 





Sunday, May 13, 2018

White board practice

May 13, 2018

Introduction


I did some mock interview with my roommate Emma, she gave me a free lesson how to give a good presentation. She has full time one year experience to teach IELTS in Vancouver area.

My assignment is to write an essay about topic: handingwriting skill are declining
Q1: what reasons
Q2: Positive/ negative

What I asked her to help me is to give me an assignment she does very often as a teacher. And then I give a presentation how I will work on the assignment.

My presentation


Here is my writing:


Emma's coaching


Here is emma's notes.


Highlights of Emma coaching


You need to look at each person in the room.
You need to get every one involved. You have to ask question to see if they are following you.
Keep smiling. Hide your nervous or anxiety for presentation.
You see how many words I write, only 10 words. If you write too many words, people will focus on your writing, not what you talk.




Find minimum cost from top left corner to bottom right corner

May 13, 2018

Introduction


It is the algorithm to find the minimum cost from a matrix top left corner to bottom right corner.


Transcript


Here is my work in the mock interview. The interviewer told me that I should write the code after the mock interview, give him to review the code for next mock interview.

My next mock interview will be in Tuesday.


Mock interview 


Learning algorithm is such great experience. It is so much fun to work with a young graduate student around twenty five years old. He was very kind and also very encouraging. I spent first 5 to 10 minutes to think and communicate with the interviewer depth first search, compared to breadth first search. And then he kept asking me how you can improve the algorithm compared to depth first search. He did more than two times.

I finally came out the idea to use dynamic programming algorithm. Even though I have practice Deletion distance algorithm over 20 minutes last 12 months. But I still miss some dots to come to dynamic programming algorithm.

Arguments


I like to write down a few words about my analysis using depth first search is not optimal.

First, the algorithm is to find the minimum cost. There is no need to find actual path. Using depth first search of course takes extra effort to find path from source to destination.

The question is to ask minimum cost. I should quickly related to deletion distance.

I will do some research and figure out how I can come out dynamic programming algorithm without hints by the interviewer.

I have weakness to come out dynamic programming solution at the first place today.

Assignment


The interviewer told me to show him the code I write and he will give me some review next mock interview.

Follow up 

May 14, 2018
It is the algorithm called Leetcode 64: Minimum Path Sum.

I was asked if I worked on the problem before. I said that I did not. But actually I thought about the hackerrank contest I worked on similar algorithm. So I search all contests I played from oldest to latest one, I found the algorithm and blog called Manhantan 2.

I am so glad to learn that my last practice in the contest. I was so glad to see my hard work, and here is my C# algorithm written based on dynamic programming. The solution still has bugs with score 33.


Print binary tree extreme corner in alternate order

May 13, 2018

Introduction


It is my first algorithm to work on. I spent 28 minutes to work on the algorithm.

Transcript


Here is my transcript.


First mock interview from my coach

May 13, 2018

Introduction


I may come cross a most hard working top engineer in the world. My coach is a busy graduate student and working for top four companies in China as an intern. He has to squeeze time just before going to sleep and then giving me a mock interview for 45 minutes.

My first mock interview started from 8:00 AM PST. In less than one minute, the coach sent me a wechat message. We started our first mock interview after we first met on mock interviewing platform this January 2018.

Summary


The interview lasted 71 minutes. I finished the first algorithm in 28 minutes, and then second algorithm we discussed the solution and then I got hint to use dynamic programming instead of using depth first search, I wrote down base case and recurrence formula. And then we ended discussion of second algorithm in 55 minutes, moved on the other topics related to the future practice etc.

Feedback


I was asked to answer the question about array and list difference. And then I did not answer very well. I was told to look up Google after mock interview.

I was reminded to use negative operation to make the code more efficient. And also I was asked if I work on the algorithm recently. I told him honestly that  I worked on binary tree level order traversal and zigzag order level traversal recently.

He told me that I was nervous. He gave me the hint to use queue, since I talked about zigzag level order traversal using stack. I followed his hint to use queue instead.

I explained to him after mock interview that I have met a lot of peers through mock interview, write a complicated function in the interview and end up to get stuck. I like to write a simple function to traversal the tree by level using queue first, and then I like to piggyback the work to add the list of extreme nodes.



Saturday, May 12, 2018

Special drill for next three weeks

May 12, 2018

Introduction


It is my decision to contact my mock interview peers and then I decide to get some private lessons from those peers I like the most. Since they are working hard, best performer I have met over the practice. One of them is Tsinghua university gradudate student. I could not find time to finish over 500 Leetcode algorithms in last three years. I asked two of them to be my coach for next three weeks.

How to choose a good peer to be a coach? 


It is not easy at all to do so many things very well. It takes time to practice so many Leetcode algorithms. So it is better to have a coach and find out how to work on the practice more efficiently.

First of all, I like to figure out that what job needs a super talent software programmer.

If I have a good coach to practice at 8:00 AM to be interviewed for two algorithms 10 sessions next three weeks, then I can have Saturday and Sunday, play grouse on the top of grouse mountain this past Saturday and enjoy Sunday service with friends from Florida.

The picture and videos can be viewed from instagram here (?) very soon.

Actionable item:


Plan to study solutions as many as possible next three weeks. I need to read as many as possible solutions.

Here is my next three week's bible.




Thursday, May 10, 2018

A short email to write

May 10, 2018

Introduction


It is also best time to answer a friend's question. I met a person through the mock interview a few days ago. He asked me a few questions. How many questions have you solved in LeetCode ?  And how do you train your muscle memory?  Also, do you time yourself while working on a question? I'm trying to figure out how to improve my speed? 

My answer


I spent 10 minutes to think and write an email to answer those questions. 

Here is my answer I wrote in an email. 

I only submitted 97 out of 796 algorithms. But last 12 months, I worked on same set of algorithm around 30 of them over 11 times on one mock interview platform, work with over 300 hundred programmers together. I learn one thing a time. Some of them are hard level, and I practiced those hard level algorithm over 50 to 60 times. I really figure out how to learn one hard level algorithm very well at the end of 12 months practice. 

 The tip is once you learn one hard level algorithm very well, you will figure out how to learn other medium level or easy level algorithm quickly. 

Book reading: Microservices: from design to deployment

May 10, 2018

Introduction


I am so happy to write coding blog every day and also try to practice mock interview as well last 12 months. Now I like to start a new project, I like to learn system design. For example, how to scale a website to allow million people to watch the live matches.

I was so lucky that I had some coaching from my 22 years ago coworker today, we used to be coworkers in Shanghai from 1994 to 1996. He spent 90 minutes to coach me the basic concepts. Here is the list I should learn:

Auto scaling / Continuous integration
Big Data
Container - docker
Elastic search
Hadoop
Jason
Jekins
MapReduce
Microservice
MySQL
Redis
Rest API - state
Spark


Book to read


I was advised to read the book: Microservices: from design to deployment.

Aha, Julia is learning a a topic called 5 reasons to switch to software for load balancing. This system design project is stress free. Just be nice to your ex-coworker, and keep the friendship as long as 24 years. Just be a good student again in 20 minutes reading.

https://www.slideshare.net/Nginx/5-reasons-to-switch-to-software-for-load-balancing



Book reading: The Mythical Man-Month

May 10, 2018

Introduction


It is such a great book to help me understand two pizza team Amazon leadership principle. I plan to spend 30 minutes to read the article related to the book: The Mythical Man-Month. I like to read the wiki article about this book first, here is the link.




Tuesday, May 8, 2018

Being an interviewer: Find smallest substring containing all characters

May 8, 2018

Introduction


It is my favorite algorithm called Find smallest substring containing all characters. I worked with a peer and helped her to write a brute force solution using python language. I had chance to show how to solve the algorithm and also the peer liked me as a tutor. I enjoyed the time to work with the peer.

Mock interview 


Here is the transcript I reviewed, I gave the analysis for brute force solution, and I wrote a double for loop for brute force solution as a hint as well.


Plan to read the code camp 20 minutes. Here is hackbright academy in San Francisco. 


Being an interviewee: K messed array

May 8, 2018

Introduction


It is my favorite algorithm called K messed array. Since C# does not have class for minimum heap, I chose to write a selection sort algorithm to implement the algorithm.

Mock interview


Here is my C# code.


Leetcode practice

May 8, 2018

Introduction


It is very good practice to review last 12 month what I have practiced on Leetcode. I was surprised that I only submitted 42 algorithms.

Last 12 months


Here is the excel sheet showing my last 12 month Leetcode submission. Here is the pdf file of all algorithms submitted last 12 months.

I like to analyze my behavior to work with Leetcode and see what I should work on to make improvements.


Being an interviewer: Find largest smaller Binary search tree key


Introduction


It is my favorite thing to choose the algorithm I just learn or practice and give it to the interviewee in my mock interview as an interviewer. I did meet a programmer in Seattle with eight years experience who stays anonymous and I did mock interview him 2 hours on May 7 2018 starting from 10:00 PM. I learned through his 40 minute performance to write a recursive solution, after a few times I asked him to simplify the code. He did more than three versions of code in Java. At last moment, I showed him the recursive solution in less than 10 lines of code, I wrote in less than 2 minutes.

I like to write down a few version of code reviewed by me. I enjoy the process to be an interviewer. I know that not long ago I make the same mistake, an easy 5 minutes question I spend over 20 minutes to work on.

Through the interviewee's experience, I understand that we all need some training to solve an algorithm quickly using recursive function.

Will come back later.

Being an interviewer: Leetcode 153: Find maximum subarray product