Wednesday, October 17, 2018

Celebration of 960 submissions

Oct. 17, 2018

Introduction


It is time for me to learn how to be a nice player and say thanksgiving to my coach this June. I had chance to find my weakness, I need to work on easy level algorithms first.

After I solved 160 easy level algorithm, I had chance to celebrate 960 submssions on Leetcode.com.

Get smarter


It is easy to get smarter once I learn from my past 300 submissions. I solved 160 easy level algorithms last three months, I had over 300 submissions.

I started from January 2015. From 2015 to June 2018, I only has submissions on Leetcode.com less than 600.

I need to learn those players, every year with over thousand submissions. Without taking any course, any cost of tuition, one player can learn how to write good program through those Leetcode.com algorithms.

One thing I like to do is to take easy level algorithms first. And also I need to learn that it is important for me to build good  habit to write code everyday.

Submissions


I learn to read other people's profile by checking total submissions.

Here is mine.



Here is my role model with over 2800 submissions. The role model solved over 800 algorithms.

What is difference from mine, 260 solved algorithm, 900 submissions. There are  more than 540 algorithms, more than 1900 submissions. Each contest on Leetcode.com has 4 algorithms, so 540 algorithms can be used almost 150 weekly contest algorithms.

In other hand, every onsite interview from Faceook or Amazon, the interviewee will work on 4 algorithms. The extra practice is like a player having more than 100 onsite interviews experience from various software companies, all of those are very focusing on algorithm and data structure as well.



Say goodbye to easy level stack algorithm

Oct. 17, 2018

Introduction


It is very good learning experience to work on those easy level stack algorithms. I finally had time to work on those algorithms one by one. I still remembered that I was told to work on easy level algorithms this June, and I had a coach session with the coach related to next greater element algorithm.

Easy level algorithms


Here is the image to show all easy level algorithms I completed.


Easy level stack algorithm (solved 7/7, shared 7)

20. Valid parentheses
155. Min Stack 
225. Implement stack using queues
232. Implement queue using stacks
496. Next great element II
682. Baseball game
844. Backspace string compare

Celebration of 260 mark

Oct. 17, 2018

Introduction

It is time for me to celebrate 260 mark. I just finished 260 algorithms, since recently I solved another five easy level stack algorithms.

I have to stay humble, and also it is very important for me to put the algorithm practice in the highest priority.


682 Baseball game

Easy level stack algorithm (solved 7/7, shared 7)

20. Valid parentheses
155. Min Stack 
225. Implement stack using queues
232. Implement queue using stacks
496. Next great element II
682. Baseball game
844. Backspace string compare

496 Next greater element I

Easy level stack algorithm (solved 7/7, shared 7)

20. Valid parentheses
155. Min Stack 
225. Implement stack using queues
232. Implement queue using stacks
496. Next great element II
682. Baseball game
844. Backspace string compare

Mock interview experience III

Oct. 16, 2018

Introduction


I learn from my own mock interview experience. After the mock interview on Oct. 15, 2018, I got the complaint from the interviewee. So I decided to spend extra 30 minutes to help and have discussion with the interviewee.

I had chance to work with the interviewee this time, and then we had good discussion how to solve those algorithms.

How to explain the approach? 


Here are the hints I gave in the mock interview. The algorithm is called longest univalue path on Leetcode.com, easy level tree algorithm.



My advice


I also wrote down my advice after the mock interview as the interviewer.


Mock interview experience II

Oct. 16, 2018

Introduction


It is time for me to learn from my mock interview experience. I decided to make changes after the complaint from my last interview.

The algorithm


Here is the algorithm the interviewee wrote. I will write a similar solution and submit it on Leetcode.com.


Mock interview experience I

Oct. 15, 2018

Introduction


I like to write down my own learning experience as an interviewer on interviewing.io. Recently I interviewed one young graduate student, and I did not like to take extra time after the first 45 minutes. But I got some good advice from the anonymous interviewee.

Feedbacks


Here is my review as an interviewer.


Here is interviewee's feedback.


Actionable Items


I decide to take the advice and work with the interviewee, give hints and have some discussion how to think and analyze the algorithms if the interviewee does not come out the optimal solution.

225 Implement stack using queues

Easy level stack algorithm (solved 7/7, shared 7)

20. Valid parentheses
155. Min Stack 
225. Implement stack using queues
232. Implement queue using stacks
496. Next great element II
682. Baseball game
844. Backspace string compare

232. Implement queue using stacks

Easy level stack algorithm (solved 7/7, shared 7)

20. Valid parentheses
155. Min Stack 
225. Implement stack using queues
232. Implement queue using stacks
496. Next great element II
682. Baseball game
844. Backspace string compare

IELTS test

Oct. 17, 2018

Introduction


It is time for me to do some research on how to improve reading skills. I review the test result I did in 2008, I did three tests.

I like to work on my English reading skills, in order for me to improve my performance on Leetcode weekly contest, and also I like to solve more algorithms on Leetcode.com.

My IELTS test 


Here is my test result in 2008. I like to work on reading skills once I have 30 minutes.


Actionable Items


Work on those videos, IELTS reading skills/ writing skills as well. Here is one of videos.

34 easy level algortihms

Oct. 17, 2018

Introduction


It is time for me to write more code and also prepare for medium level algorithms on Leetcode.com. I have 34 algorithms to work on, each of them is easy level algorithm. 

34 algorithms


Here are the details:

2 back tracking, 784, 401
2 Binary search tree, 783, 530 
9 Bit Manipulation, 9 algorithms
2 Breadth first search, 2 algorithms
4 Depth first search,  897, 690, 733, 743
1 Graph, 743
3 Greedy, 860, 455, 874
2 Heap, 703, 743
8 Linked list, 876, 206, 237, 21, 83, 141, 160, 707
1 Two points, 141



Tuesday, October 16, 2018

The score will take care of itself - My Philosophy of Leadership

Oct. 16, 2018

Introduction


It is time for me to read some Chinese article. Here is the article. I like to learn something from Bill Walsh

Here is the notes from the article: 

The score will take care of itself

其实呢,写了这么多,我想和大家分享我当manager以来读到的最喜欢的一句话
是NFL橄榄球队49ers的传奇教练Bill Walsh的写的关于管理的一本书的书名
The score will take care of itself
什么意思呢?就是你只要好好训练,好好练习,专注你该专注的,那么比分会自己出现在那里的
同理,我看career,也觉得,管好我自己,不断提高自己,那么 
The money will take care of itself





Monday, October 15, 2018

Why Vancouver's real estate price goes up?

Oct. 15, 2018

Introduction


It is time for me to read some articles related to topic of real estate price. Here is the article.


Leetcode ranking and progress report

Oct. 15, 2018

Introduction


It is my idea to record the numbers from Leetcode.com every two weeks. I found out that last two weeks I only solved xx algorithm with 30 submissions.

My status


Here is my status today. Now it is 9:50 PM.




Based on the blog written two weeks ago, I can easily tell how many submissions I did and problems solved.

Comparison after two weeks


                     Ranking    Submission  Solved      Contest Global ranking  Contest Rating
Oct. 15         29200          533              256/917     13292/72190                      1673
Oct. 5           30987          507              249/909     12026/71276                      1692                             

I solved 7 algorithms, 33 submissions. My ranking advanced over 1700.


Leetcode weekly contest 106

Oct. 15, 2018

Introduction


It is the weekly contest and I was so busy with the first three algorithms. I could not solve the third one, and I did not have time to read the problem statement of the fourth one. There are over 400 people scoring full score, and there are over 1000 people to solve the first three algorithm.

My performance


I like to list all first three algorithms' discuss link in the following.

922. Sort Array By Parity II

921. Minimum Add to Make Parentheses Valid

923. 3Sum With Multiplicity  dynamic programming solution

923. 3Sum With Multiplicity


Comparison to top five



Here is my performance.



Third algorithm struggle 


I like to show how many submissions I had to work on in order to pass online judge. It took me one hour to pass online judge. I tried at least 20 minutes in the contest, and then after the contest, I tried another 40 minutes.



The algorithm is my favorite algorithm, and I came out the optimal idea in the contest. Since I worked on three sum so many times, I also asked the code review here.

My short term goal


I like to work on 100 medium level algorithms, so I can perform very well on the first three algorithms in the weekly contest. And then I will have chance to work on hard level algorithm with 10 or 20 minutes if possible.


Sunday, October 14, 2018

7 common mistakes in the coding interview (for software engineer)

Oct. 14, 2018

Introduction


It is time for me to learn something daily. One thing I find out valuable to do is to work on those coaching video. Today I went to Hackerthon, I found out that I may have some problem about team work. I felt that it was hard for me to push myself and then I may waste time by not pushing hard enough.

Here is 7 common mistakes in the coding interview.

7 mistakes


1. Get a referral
2.


Saturday, October 13, 2018

Does my failure on Leetcode 150 easy level algorithms has a name?

Oct. 13, 2018

Introduction


It is time for me to spend 10 to 30 minutes to go over those failed submissions on 150 easy level algorithms. I like to identify what I should be careful, the growth pain of the algorithm and data structure problem solving. Like a baby growing up in the first year, there are numerous stages an infant can continuously develop. This is the first time I intensely work with the online judge, and work with those problem statements and problem setters, and also work with those hidden test cases which may never be released but may explode any time.

Common mistakes 


I make common mistakes very often. I just could not believe that I learn so much and so quickly through those easy level algorithms.

Sometimes the algorithms are labelled by the mistake as an easy level, but then I just fell in love with the algorithms and continue to learn from my experience. I choose the algorithm to be my mock interview algorithms more than five times.

Most surprisingly I learn a few solution with such elegant solution. I just could not believe that I need to refine my thinking process, and then rework the problem after my first submission by working independently.

I will list over 5 mistakes and lessons I learn in the following later.

687. Longest univalue path with design flaw, pass 43 out of 68 test cases
687. Longest univalue path copy the idea from most popular post
Array easy level algorithms (solved 44, shared 24)

867. Transpose matrix - pass 29/36 test cases
Math easy level algorithms (solved 27/ 32, shared 12)

415. Add Strings recursive version - memory limit exceeded
415. Add Strings Iterative solution - learn to use for loop creatively
String easy level algorithms (solved 32, shared 15) 
680. Valid Palindrome II 418/460 test cases passed Time limit exceeded
686. Repeated String Match memory limit exceeded for last test case
686. Repeated String Match memory limit exceeded for last test case
Hashtable easy level algorithm (solved 25, shared 21)

204. Count Primes verbose code
204. Count Primes elegant version

242. Valid Anagram One more mistake to remind me to work on easy level

500. Keyboard Row do it myself
500. Keyboard Row use HashSet API IsSubsetOf

645. Set Mismatch first submission - XOR
645. Set Mismatch elegant one using XOR two places
645. Set Mismatch use bit manipulation trick

720. Longest Word in Dictionary use hashset
720. Longest Word in Dictionary use Trie data structure
720. Longest Word in Dictionary use Trie data structure
720. Longest Word in Dictionary use Queue data structure
720. Longest Word in Dictionary use recursive function
Medium level (solved 53, shared 4)


915. Partition Array into Disjoint Intervals use three iterations
915. Partition Array into Disjoint Intervals one pass idea discuss
916. Word Subsets using counting sort
916. Word Subsets discuss
918. Maximum Sum Circular Subarray pass 98/108, in the contest
918. Maximum Sum Circular Subarray after the contest, working code
919. Complete Binary Tree Inserter O(1) insert
919. Complete Binary Tree Inserter Using Queue
919. Complete Binary Tree Inserter Using Queue
923. 3Sum With Multiplicity
923. 3Sum With Multiplicity dynamic programming solution 
Medium level tree algorithms (solved 14, total 39, shared 12)

102. Binary Tree Level Order Traversal submitted in 2015
102. Binary Tree Level Order Traversal submitted in 2018
Hard level (solved 33, shared 5)

37. Sudoku Solver
76. Minimum Window Substring One thing a time
85. Maximal Rectangle
239. Sliding Window Maximum optimal solution using LinkedList
239. Sliding Window Maximum All submissions, SortedSet, timeout

A name


I like to give those mistakes a name to encourage myself to work hard, work on more algorithm problem solving.

The name is called in Chinese, "这需要托大家的福,托大家的福就要吃百家饭、穿百家衣". The custom is to help raise a healthy child to eat and wear in so many families. The link is here.


Sports watch

Oct. 13, 2018

Introduction

It is one of my research area in hackerthon hosted by Microsoft called ""complex health needs". I work with a small group, I was told to read the article related to withings steal HR-up to 45 days, I found the article to read. Here is the link.

Case study of 150 easy level practice

Oct. 13, 2018

Introduction


It is the first time I dedicated three months to work on more than 150 easy level algorithms on Leetcode.com. I like to compare this study with 2 weeks paid coach session with my ex-coach, any course I took in graduate school, independent study, pluralsight.com course study, webfrontend.com course study, and any other things like project at work.

It is a learning process 


I like to make this learning process public for people to access, so I came out the idea after 2 months work. I decided to share as many as possible leetcode algorithm C# code I wrote. Here is the github page I created for myself, to stay organized. It is easy to access for public as well.

I also move my writing from my coding blog to Leetcode discuss. There is nothing to be afraid, I wrote down what I like to share, what will be helpful for others to learn from my experience.

My reputation starts to increase the value, when I started to work on easy level algorithms, my reputation is 3, now it is 13. Although it is 10 reputation gain, I like to apply customer obsession leadership principle. I constantly review my publication, and also need to rewrite and revise. I definitely am more active to read other's sharing, since it is in the community. It is so easy to go to other's sharing compared to my blog, instead I move to my other blogs, I read my own blogs again and again, or hours long, it is time waste. Instead I learn new ideas quickly, I become Leetcode discuss reader, I am more open to new ideas, quickly find good role models in those players.

It is over thousands view quickly from my post on Leetcode.com, those views are more specific for those algorithms players. Compared to the view I get from my blog, I directly serve the community of Leetcode discuss. I think that is more efficient and also push myself to the next stage to serve the community.

Easy level algorithms training


I have rough ideas how to strength myself in algorithm and data structure. The idea to hire the coach and work with the coach in two weeks, I understand the idea to follow the leadership of those hard working people, submission over thousands, solved more than 500 algorithms. I like to be one of them.

My target is changed, I am aiming to how good I can practice and communicate through Leetcode discuss or public, instead of aiming at top software companies interviews, nice and challenge job positions.

I also like to compare last three months training comparing to the last three years. What I did last three months are more focus, easy level only. I also work on the algorithms by category only, I have more focus and also enough training for one specific area.

It is also a good habit to build, I have to pay attention to my submission, my solved algorithm. I have to define those metrics to watch, and learn how to compare to role models with thousands submissions in last 12 months.

I like to learn that I am more confident and also stay on the track. I learn to monitor my stress level or emotion about the hard work, long hours study and problem solving. I learn to adjust my expectation based on my metrics.

One statement is to let me make over another 500 submissions, show the world I am working on the basics. Even though this time I have to work on medium level algorithms instead.

Comparison highlights


The practice is easy to work on, easy to track the progress, easy to reach out the community, and also easy to get feedback from online judge. I also find that it is also very helpful for me to find my weakness, in terms of reading skills in English, how to evaluate the use cases and also simplify problem solving.

I am definitely more confident to work on things so easy, also I learn to how to craft my code much more elegant ways in a few cases through hundreds of cases. I do find that talent do make big difference, there is big gap between me and top talent in the world.

The practice is no fee associated. And the time I spend on the practice, I find that it is more rewarding in terms of problem solving, coding craft skills. I definitely have ideas how to make better decisions and learn to evaluate my way of education resources and challenges.



Friday, October 12, 2018

I think that I am ready to be a super interviewer

Oct. 12, 2018

Introduction


It is my 10:00 PM mock interview as an interviewer. I gave the algorithm to the interviewee to work on, the algorithm is called binary tree inserter. I worked on the algorithm last Saturday, I came out the idea but I was not able to implement the idea. I had excuse since I played four hours tennis before the contest, I was too exhausted and I did not eat an orange, I had some headache when I worked on the contest.

Today I came cross the interviewee and observed the first eight minutes her performance. And she told me that she likes to try to use level order traversal, using kind of math to figure out how to do insertion, or using a Queue to implement the idea. She wrote the code and asked a few questions, I definitely could tell that she was very competitive and very good at communication.

The most important words I heard from the interviewee was the following:
I have two ideas to solve problems. Let me go over two of them.


Good programmer


How can I tell that the programmer is a top talent programmer? I can tell from what she said, how she approached the problem? And how she handled the problem solving in general. Of course, I also can tell from the code she wrote.





Can I find time to solve 100 medium level algorithms?

Oct. 12, 2018

Introduction


It is hard for me to find time to write code recently. I was busy to review my bank statements last 8 years from Chase bank in USA, and I like to review my rental history.

But if I do work hard, and I can solve another 100 or 200 medium level algorithms in next 45 days or 3 months. I do believe that I will find ways to solve another 100 hard level algorithm as well.

So my short research is how I can find time to solve 100 medium level algorithms on Leetcode.com.

Find time to study first


It is a good time to study 10 medium level algorithm a day. And also I like to encourage myself to learn one algorithm a time. 




It is tough but more submissions will help

Oct. 12, 2018

Introduction


I cannot wait to work on new technology and try all kinds of web technology, and write very fashion website for the business. But I like to hold on learning new technology. I like to spend next 45 days to work on over 100 medium algorithms first.

Medium level algorithm


It is so hard to build a good habit to write code every day. I think that it is easy and very enjoyable experience to work on Leetcode algorithms for me. Every 10 or 20 minutes I will learn a new idea through Leetcode discuss panel, all I can do is to rewrite the code.

Sometimes I do not think about carefully. I have to submit multiple times in order to understand the idea. I did this one using binary tree inserter, I submitted three times using Queue idea.

This year we have 78 days left. I really like to write code for a lot of algorithms. I like to learn various ideas  to solve medium level algorithms, so hard level algorithm will not be so tough later on.


Can I learn react in one day?

Oct. 12, 2018

Introduction


It is my research how to work on react in one day. I like to read this post carefully.

Leetcode algorithm analysis

Oct. 12, 2018

Introduction


It is a good habit to study leader board after Leetcode weekly contest. I did spend half hour to look into top 50 profiles of Leetcode weekly contest 105. I found one profile with Leetcode algorithm analysis. Here is the github page.


Good practice


I believe that if I can practice very good, the performance in the contest or onsite interview will definitely very competitive. So my goal is to work on my practice.

The player did some work, and then categorized the algorithms by topics. I plan to study some algorithms later.



How to work on Leetcode algorithms?

Oct. 12, 2018

Introduction


It is my favorite topic how to work on leetcode algorithms. I found a blog on 1point3acres.com, and then I like to share some notes here.

How to work on Leetcode algorithms?


I like to share some notes here. Here is the gist I created based on the blog. 

Easy 10 minutes, medium 20 minutes, hard level 30 minutes. If I cannot complete, then I plan to use easy level 5 minutes, medium level 10 minutes, hard level 15 minutes to read discussion board.

Thursday, October 11, 2018

Canada retirement research

Oct. 11, 2018

Introduction


It is time for me to study more about Canada related to retirement income. I came cross this article and I like to write a blog about it.

Understand the basics


I like to copy some content here in Chinese. I like to find some keywords and then look into more details.

 1,加拿大退休金计划(CPP)---要上班才有的,CPP是计入年收入的。
  · CPP是根据以往工作时缴纳的费用而定的, 最高是$1012.5/月.最早可以于60岁的时候申请, 但比65岁申请,要按比例扣减. 也可以70岁再申请,同样将按比例增加。CPP的领取不限身份和居住地, 只要你缴过, 够年龄后,你就可以申请, 哪怕你到时候居住在外地都可以.
  · 你能领取多少退休金取决于你向CPP供款额的大小和时间的长短。 如果你在2013年65岁退休, 每月可领取的最高退休金额是$1012 。但很多人那不到这个最高值。实际上加拿大人今年所得的CPP平均值是$528。我们估算了一下,这个平均值大致相当于过去十五年每年按最高许可额供款的情况。
  · 此外,你也可以在60岁时就领取退休金,但退休金将比65岁的减少约30%。反之,如果你在70岁退休,退休金将比65岁的增加30%。
  · 由此看来,我们能从CPP得到的退休金十分有限,期望值高的人要调整一下了。
  · CPP是公共退休金,主要是给了给低收入者提供退休生活保障,这是加拿大社会保障制度的一部分。
  如果你终生的工薪收入都高于社会平均水平,那么可能你退休以后领取的CPP价值总额会低于你工作时为CPP所做贡献总额。
  除退休保障外,CPP还有其他一些重要的保障功能:
  如果你不幸因伤病失去工作能力,你可以从CPP领取最高每月1,212.90,你的孩子还可以领取最多每月228.66。
  如果你不幸早逝,你的家人可以从CPP一次性领取最多2,500,你的孩子可以每月领取最多228.66。
  这个一个提倡扶老携幼的社会。
  如果你收入很高,缴纳很多的CPP,身体又很好,那么恭喜你,你不需要社会的帮助,还有能力帮助他人,你很幸福。

Wednesday, October 10, 2018

Review my research about Vancouver area house market

Oct. 10, 2018

Introduction


It is time for me to review all past eight years activities related to house research, and then it is also important for me to write a blog. I like to write some topics and help myself to understand better about business, life and career.

I moved to the city of Vancouver in 2010, and started from 2010 I rented a small place in the house in the city of Vancouver last nine years.

A complete research


I like to define a complete research. It should include down payment, house market research, loan research and also new immigrant loan policy, and it can include more activities.


Actionable Items


I like to mark this day Oct. 9, 2018 as day one of my personal finance research. It starts with a seed, an idea to look into.




Business management

Oct. 10, 2018

Introduction


It takes hours for me to review my Chase bank statements from 2011 to 2018 last few days. I did study those bank statements, and then looked into my last 8 years rental management every year by going over all emails in Gmail.  I did so many things related to rental business, I learned so many lessons and worked so hard to make it a successful small business.

It is a small business, in order for me to improve my management skills, I like to write a blog as well.

Small business


I do think that the small business keeps me active in Chinese community and also helps me to be a person with Christian faith.

I did a fantastic job to learn to run a small business. I will write down a few things I did very good first.

Good things 


I do not waste the resource. The most of time the two bedroom are rented from 2010 to 2018.

Mistakes 


I also made a lot of mistakes.

One of my biggest mistake is that I can make big difference to save $6000 US dollar interest in the home equity loan from 2010 to 2017, since I can pay it off, the money saved in Canada bank did not generate any meaningful interest.

I am lack of confidence to live a life from paycheck to paycheck in Canada. Even though the saved interest is such a great reward right away.

I should spend at least 40 hours every year to review all the bank statements first, and document very well all activities.










Monday, October 8, 2018

Jeff Bezos shares his management style and philosophy

Oct. 8, 2018

Introduction


I like to take some notes from the video sharing. Here is the video link.

My notes


Here are my notes.

Gift, study hard, your choice, hard work


Look back your life, you will be very proud of yourself. Your choice to work hard. Gift is given to you.


Leaders are right a lot

Right a lot, listen a lot, change a lot. Work very hard, unnatural, trap you anything you set in the path. The life is complicated, reanalyze the situation.

Dramatically underestimate the complexity of the work we are living.

Innovation and failure

It is not an experiment. Most innovation is through trial and fail.

Two pizza a team

Tell each other a story. 10 or 12 people is a perfect size for human interaction without a good structure.

6 pages of memo, no powerpoint

Run a meeting. Come in, first half hour study, study 30 minutes together. After half an hour, we talk together.

Author clarifies his own thinking to write a memo.


919. Complete Binary Tree Inserter

Oct. 8, 2018

Introduction


It is a medium level algorithm in the weekly contest 105. I decided to write a few ideas after the contest.

My practice


Here is the discuss link I posted using the idea learned from one of discuss after the contest.
Here is the discuss link I posted using Queue.
Here is the discuss line I posted using Queue. It is so easy to learn the idea, but it was so hard for me to write the code and I failed four times before the code passed the online judge.


Let us get some data


Here are my submission record. Today is Canada thanksgiving holiday. I spent time to stay in my home office, I practiced the algorithm using three ideas.



Here is the discuss line I posted using Queue. It is so easy to learn the idea, but it was so hard for me to write the code and I failed four times before the code passed the online judge.

I submitted four times from 33 minutes ago to 11 minutes ago. 


918 Maximum sum circular subarray

Oct. 8, 2018

Introduction


It is a medium level algorithm. I had chance to work on it in the weekly contest. And then I spent time to fix the bug and submitted another solution.

My practice


Here is my submission.