Showing posts with label tutoring. Show all posts
Showing posts with label tutoring. Show all posts

Sunday, February 18, 2018

Find smallest substring containing unique keys

Feb. 18, 2018

Introduction


It is my most favorite algorithm in 2018 called find smallest substring containing unique keys. That is the algorithm I have practice over 10 times from March 2017 to February 2018. And also it is the most popular interview question and I had one in 2015 January. I had a very good experience 45 minutes since I could not pass the phone screen, but I learned to be open and welcome the challenges as a programmer, show the world that I do care about learning the algorithm, and keep working hard as a software programmer.

This algorithm is the reason I start to write a coding blog starting from May 2015. I knew that I was not so good at learning, but I just started to document my learning and my emotions like feeling of struggling and then enjoy the journey to be a good thinker in algorithm and data structure.


My experience of interviewing


It is the Sunday morning 10:00 am mock interview. The peer had to work on the algorithm, and I worked with the peer 70 minutes until she finished the code, and also passed all test cases.

The first 30 minutes I went over my own blog to review the past practice, and once a while I stopped and gave some advice to the peer.

I do enjoy the interview. I do not have coworker as a programmer in my work place, I am a solo programmer. I really know that it is my own task to find the chance to work with people.

I learn from my experience on this algorithm, so I also like to share the tips to the peer through the mock interview.

Here is the C++ code I reviewed, and the code passes all test cases.

Here is the comment I wrote to share the advice after the mock interview.

My feedback after the mock interview


The peer worked very hard and also very open to advice, took the hint. The peer wrote the algorithm around 70 minutes including discussion, fixing all the bugs etc. 

I like to share that I could not finish the smallest substring algorithm in my first five practice on the mock interview platform, in 30 minutes. I had different issues, but last 3 or 4 times I kept got very good peer to help me, one is really good. Please take a look here, the peer helped me.  And the other one is also good, the peer helped me to pass all test cases in 30 minutes, here is my practice blog. 

Just practice the same algorithm again and again, work on one thing a time. 

Saturday, January 6, 2018

Leetcode 18: 4 sum

January 6, 2018

Introduction


I had a mock interview at 10:00 PM in May 5, 2018. I learned some JavaScript from the peer, but also I had to learn how to help the peer write a brute force solution using JavaScript. I had to write down the four loops and then also write the start index for each loop for the peer.

Brute force four loops


It is the first time I had to show the peer how to write brute force solution using four for loops. And also it is my job to fix the start index for the peer as well.

I made the comment to remove the line beside a while loop, and then line 12 to line 15, I changed the start index to i + 1 instead of 0, likewise to apply k and l.

Code to review


Here is the JavaScript code written by the peer in JavaScript, passing all test cases on mock platform. It is also a brute force solution.

I have to learn how to help the peer write a brute force solution first, and then let the peer understand the solution and get the good feelings to solve the problem.