Thursday, August 31, 2017

Leetcode 18: 4 sum

August 31, 2017


Plan to continue to work on 4 sum solution, using hashtable to store all possible two sum, and then look for 4 elements with the given sum. I chose to write the solution instead of using a two for loop for the first two elements, and then two pointer technique to find a sum value. This is the first time I wrote the idea and I like the adventure.

30 minutes practice code is here.

In the mocking practice, I explained to the peer that I have to write a function to determine that 4 indexes are unique. In other words, assume that 4 indexes are a, b, c, d, then at least 4 comparisons are needed, a != c, a != d, b != c, b != d. Actually there are a lot of duplicated pairs for a < b < c < d four numbers to a given sum, (a, b) and (c, d) are two pairs with sum a + b + c + d, or (a, c) and (b, d)  with the same sum, etc., to simplify, we can enforce that the pairs to look for are (a, b) and (c, d) only.

I thought that it will take a few minutes to write the logic, and gave up the writing in the mocking. Since in the mocking interview, I was not sure that I should simplify the search, enforce the rule to apply a < b < c < d, therefore the checking will be very simple as b < c, in other words, the second element in the first pair is smaller than the first element in the second pair.


The C# code passes all test case, I did fix the grammar error, and also simplify the search. I try to search two pairs in the ascending order. First sort the array, and then iterate any pair less and equal half the given value, find another pair with index of array (start, end), the start index is bigger than the pair's second argument's index.

C# code is here. Last practice is on April, 2017, the blog is here.

A very competitive peer 

A few things I learned from the peer. If I am the interviewer, I should explain the problem to the interviewee, and then let interviewee ask questions to clarify the problem. I do not explain the algorithm to the peer when I am the interviewer, but this time the peer asked me to explain the algorithm at the very beginning, and I was told that I should explain the problem as the normal interviewer does.

The fact is that only two or three peers out of 80 mocking experience did explain the algorithm to me at the beginning. Now I knew that it should be always the case.

Do not just let the interviewee to read the problem statement and then figure out the algorithm.

Try to simplify the algorithm, otherwise I cannot finish it in 30 minutes. The peer thought that it is better to have a working solution instead of having a solution not completed.

Write test cases by yourself first, instead of using "Run tests" feature embedded in the browser.


Leetcode 10 - regular expression matching

August 31, 2017


It is my most favorite algorithm in 2017 called regular expression matching. I spent over 20 hours and over 3 months to work on the solution, and today I met a peer through mocking. And the peer showed me to solve the algorithm using dynamic programming, pass all test cases. Amazing talent!

Algorithm practice 

Here is Java code for me to study using dynamic programming. I watched the performance in 30 minutes meanwhile I went over my previous practice using dynamic programming code as well.

I did ask a few questions about the design.

Wednesday, August 30, 2017

No Shows offensive actions

August 29, 2017


It is the second day to practice 10:00 pm mocking practice, I made a mistake and fell sleep around 9:20 pm and woke up at 10:10 pm. I just made an offensive action called "No show".

It is the first time I made a mistake through past 20 interviews. I got very good rating 4.6 out of 5 stats, reputation score: 100 points, No Shows: 1.

Here is the graph to document my achievement:

I highlighted the score I got for 5 out of 7 stars, I still had score on talk with ranking 5. Hack, craft and talk 3 categories I got ranking 5. What should I do to improve and get rid of those 5. I believe that if I do give good advice and code review, the peer will appreciate my help and reward me the good ranking, therefore I can meet the strong player as my next practice. The hard I work on the current peer, the more rewarding is down the road.

After 30 mocking practice, I have to get back to build up my credit and meet strongest players in mocking practice.

Algorithm learning 

I did learn an algorithm and practice Leetcode 532The C# code in practice has a few issues, and the code was updated with a few changes in order to pass all test cases. The code is here.

Based on C# code standard, the practice I did fixed the issue in my last practice, the rule should be followed. The rule is called "Do not change a loop variable inside a for loop block".   

Actionable Items

Plan to remember C# coding standards all rules one by one. 

Catalan number

August 30, 2017


It is the classical algorithm and also I like to practice again and again. It is called Catalan number. When I am tired, my brain stops working partially but I do not know which part. Today, I had a mocking practice starting from 10:00 pm, and I was very tired after one day coding at work, and then I asked the peer which one is row and which is column. I looked at the graph and I did not know where the row is. The peer told me that row should be horizontal. You see, when I am tired, I still can tell quickly the horizontal and vertical, but I could not tell which is row and column. I have to ask the peer and get some assumption based on the common sense.

I practiced the algorithm before more than once, one time I was the interviewer and one time I was the interviewee.


Here is C# practice. I wrote the code to pass all test cases in my first writing.

Actionable Items

Try to figure out the tough situation, when I am tired and physical sleepy, after one day work, 10:00 pm, what is my best strategy to work with peers to solve data structure and algorithm problems.

Yesterday I booked 10:00 pm mocking, but at 9:30 pm, I laid on bed to read wechat and fell asleep, when I woke up, it was 10:10 pm, I missed the mocking practice.

Never lay down and I should sit up and keep myself wake until 10:00 pm.

Top 100 C# interview questions

August 30, 2017

Plan to study those websites about C# questions. It may be a good idea to start a day to learn C# as a programming language.

I like to invent some ways to get more motivated to go over those C# interview questions. Here is the blog.

Plan to write down  a few keywords to learn, mark it a first time/ second time/ x times to learn.

10 steps to master C# programming (I)

August 30, 2017


Recently I was asked to evaluate how good I am in C# using ranking from one to ten, I actually give myself 7 if six is the minimum level to play C# as a professional. I do have a lot of chance to learn C# programming language last 7 years full time work, but I never set up a goal to work on C# programming as highest priority.

C# coding standard

Plan to read C# coding standard, and the C# coding standard with examples I got from the course study on

Plan to read 36 pages Aviva Solution coding guideline for C# 3.0, 4.0 and 5.0. The link is here.

My favorite learning time (30 minutes in 8/31/2017) is to read the C# object and collection initializers. The link is here.

Teach Yourself Programming in Ten Years - Peter Norvig

August 30, 2017


It is the first time I read the article about 10 years to learn programming. I did the course "Become an outlier: Reprogramming the developer's mind" study on, and then I chose to study one of arguments in the course.

Monday, August 28, 2017

Recursive solution - Julia's most favorite game

August 28, 2017


Recursive function is my most favorite game as a software developer starting from 8/28/2017 10:00 pm. I think that I reach the threshold of number of failures, and then today I had great experience to write a recursive function. 

It is hard for me to find the time to practice mocking interview in August. I was busy to catch up so many things in August, vacation, outdoor activities like tennis, walking after dinner, so in August 2017, I only practice six mocking interviews so far. Today I like to go back to mocking interview and choose 10:00 pm instead of 8:00 pm. I only had two mocking experiences using 10:00 pm.

Algorithm practice 

Here is my C# practice code, the code passes all test cases, in 30 minutes limit. The peer type two wow to express the surprise, excellent performance. The only thing was last 10 minutes the peer lost video connection, the peer typed the text to continue the process.

My last practice is documented here, and the C# code is here.

Highlights of issues:

1. How to handle edge case?
case 1: "a.b.c", last key should not be followed by the dot char
case 2: if the key is empty string, then dot char should be skipped.

line 36: design of variable newPrefix, first writing is newPrefix = key + ".".  The design has flaw, if the key is the last one, the dot char should not be concatenated.

It is 11:50 pm. I turned on the computer and then added some notes about the compile errors in my writing. Write down the compile error, and then work on type issue, in the next practice, I should not write any code on this algorithm with type compiler errors. I am really tired and sleepy.

The corrections are in three places:
1. Line 38, add Dictionary<string, object>
2. Line 45, add (string)

The advice I got from the peer:
1. Move static variable into the function, line 9;
2. Empty key should not be concatenated by dot char '.' by observing the last test case.

Actionable Item

It is very important skills to learn how to work with various levels of software programmer, I decide to reserve 10:00 pm as my mocking interview time every day. I believe that 10:00 pm is hard choice, too late and it takes extra work to get focus. It will be good choice to simulate tough situations in the work place.

Bible verse encourages me to work hard, specially when I am tired.

Github plan for developer

August 28, 2017

It is so important to catch up some skills to use github version control system. I subscribed the developer monthly plan $7 us dollar in last week of August, and then started to learn one thing a time using github.

Plan to write down the challenges and plan to study some courses on for a few hours.

Github for windows developer - the link is here.

Spice up learning interest, read the blog about codeplex saying goodbye. The article link is here.


Start to watch the github tutorial videos on, based on views, choose top 3 videos and then watch one by one.

Saturday, August 26, 2017

Vancouver Island vacation

August 26, 2017


It is a beautiful trip to visit Vancouver Island.  My best time is to take the ferry this morning to Victorias island from 1:00 pm, 90 mintes on the boat, and then spent a few hours in butcher garden, during 3 hours road trip to Nanaimo island Ramada Inn, beautiful viewpoint at top of mountain. We checked in around 10:00 pm.

I enjoyed so many things. It is the friend to remind me, we used to study in Florida, worked at Motorola from 2001 to 2002.

I did nother plan the vacation. All I had to do is to listen, and follow the instructions. Bible teaching is most efficient in my last 7 years, I still remembered that the elder washed my feet in the ceremony 4 years ago, in the small group I volunteered. The small group taught us how to be leaders, serve others with humble spirit.

Tuesday, August 22, 2017

Ransom ware attacks

August 22, 2017


It is so busy to work on a few things recently that I did not catch up update about most popular virus and attacks more than 6 months. Today I like to catch up and spend one or two hours to get educated.

It is the first time in the summer to go home around 1:00 pm, it was so hot to drive to home. I am staying at home and like to choose the topic for my research.

Attacks and virus

Plan to read the virus article called "Ransom ware attacks".

Plan to read another article called "WannaCry ransomware: What you need to know". The link is here.

Plan to watch 30 minutes video called "Q&A: WannaCry ransomware attack with Mattew Braga".

This is a video to explain in detail about the attack, called "Wana DecryptOr (Wanacry Ransomware) - Computerphile".

Microsoft update on the virus - the link is here.

Actionable Items

It is never too late to purchase a github business account. 

Top 5 free hosted version control sites compared - the link is here.

Monday, August 21, 2017

Merge Sort Tree and Persistence in Data Structures

August 21, 2017

Plan to spend 1 hours 20 minutes to watch the lecture video. 

Lecture 1 : Persistence segment tree with its applications and merge sort tree. By Sergey Kulik.

The lecture video is here, 1 hour 23 minutes. 

Need to go over the merge sort tree tutorial first, the link is here

Snackdown training camp

August 21, 2017


It is the first time to look into the training camp. The lecturers are the top players of competitive players. The link is here.

Lecture 1 : Persistence segment tree with its applications and merge sort tree. By Sergey Kulik.

The lecture video is here, 1 hour 23 minutes. 

Sunday, August 20, 2017

A competitive programmer

August 20, 2017


Now it is 10:45 pm in the Sunday evening. I like to spend 20 - 30 minutes to do a small research, and write a blog about it as well.

How to train myself to be a competitive programmer?  I spent over 90 minutes this morning to go over a talk and plan to learn an algorithm, the blog is Square root decomposition in competitive programming, and the algorithm is called Mo's algorithm.

I played the codesprint yesterday, and my ranking is 2900 out of 9000 players. I solved one easy two medium algorithms. There are three hard level algorithms in the codesprint, I will practice after the contest in the weekdays.

I can talk about a lot of things, but let me share my reading about this post "How Anudeep Nekkanti answers the question to rank 35th in the world through 6 to 7 months training?".

Plan to read more answers from Miguel Oliveira.
Read Egor Suvorov.

Invariant explanation is short and clear: (Julia's ranking 10 out of 10)

6 months to prepare for facebook/ google's algorithm problem solving?

Plan to watch the videos, the link is here

Transaction Certificates - Goldman Sachs Codesprint

August 20, 2017


Summer is here in the city of Vancouver. One of entertainment is to get involved with the contest, and learn some hard level algorithm. This algorithm is related to rolling hash, and I think that it is great to warm up hash function, and taste the problem solving using rolling hash as well

So excited to play something, and get my hands dirty on the code, and feel so busy for a few hours. There are 594 submissions in the contest, score 60.

I like rolling hash.

Algorithm study 

Currencies - Goldman Sachs Codesprint

August 20, 2017


It is the first hard level algorithm. I did not spend time to read the problem statement in the contest. There are 1452 submissions, I like to get connected with those talents, one thing I can do is to study the algorithm, and find some C# solution, and then share my review here.

Algorithm study 

The problem statement is here. Plan to spend 30 minutes to read the problem statement first. 

Square root decomposition Algorithm

August 20, 2017

Plan to study the algorithm called square root decomposition. Choose to read the following blogs:

Codeforce blog about the algorithm's link is here.

First, I need to understand the algorithm by going over the geeksforgeeks blog. The link is here.

Square root decomposition in competitive programming

August 20, 2017

Watch the video 1 hour 44 minutes, the video link is "Square Root Decomposition in Competitive Programming".

Anudeep Nekkanti was a googler who presents the talk.

I spent time to go over all the questions he answers on while listening to the video.

A lot of questions and answers about competitive programming and intern, and other things.

45:00/ 1:44:40
Question: How to code fast?

He talked about how to write code, the expert writes the code slow, white board testing. Compared to write code first, and then spent time on debugging. The expert chooses the first choice. Debugging takes a lot of time.

Be accurate, be more thoughtful, it is not the typing fast.

47:11 / 1:44:40
Google interviewer even does not understand your code. He keeps saying, check your code 5 minutes, make sure that everything is correct.

50:14 / 1:44:40

Google interviewer tried to see how you solve the problem.

1:12 talk about the algorithm and then give some examples:

Unbelievable, I finished the video at 1:02 pm. It took me over 110 minutes. Last 30 minutes, the presenter gave talks about algorithms related to square root decomposition, like Mo's algorithm.

Minimum Cost algorithm warmup

August 20, 2017

I reviewed the algorithm called minimum cost on Hackerrank in order to prepare for an algorithm in Gold Sachs codesprint.

I spent over 30 minutes to go over the test case. Here are the detail.

            var prices = new Int64[] { 20, 7, 8, 2, 5 };
            var minimumLoss = calculateMinimumLoss(5, prices);

Purchase at price 7, sell at price 5, and the minimum loss is 2.
Go over the test case, and get hands dirty on this test case:

Walk through the test case, backward iterate the array, and add element one by one to the SortedSet object called sortedSet.

First, sortedSet is empty, visit 5, search sortedSet a binary search tree for value from [5 - minLoss + 1, 4], empty set is found. Add 5 to SortedSet object.

Next, visit the element 2, and then search [2 - minLoss + 1, 1], empty set is found. Add 2 to SortedSet object.

Third, visit the element 8, and then search [8 - minLoss + 1, 7], find {2, 5}, get max value 5, then the loss is 3. Minimum loss is updated to 3. Add 8 to SortedSet object.

Fourth, visit the element 7, and then search [7 - 3 + 1, 6], in other words, [5, 6], 5 is found, and then, minimum loss is updated to 2.

Here is the C# code.

Saturday, August 19, 2017

Time Series Queries - Goldman Sachs CodeSprint

August 19, 2017

Plan to work on the hard level algorithm called "Time Series Queries". The problem statement is here.

Try to use binary search tree related data structure in C#, SortedSet.

10:07 pm
Review "Shorted Job First" using SortedSet. The blog link and last practice is here.

10:32 pm
Review Hackerrank - woman codesprint minimum cost. The code review link is here.

11:15 pm
Warm up the algorithm using SortedSet with a test case. The warmup code is here.

Stop here at 11:41 pm, and get up 6:00 am, work another 3 hours for the algorithm. Morning time is better for the hard work.

Data structure design, what is needed to expedite the search? First is to find the time, using binary search is better than linear scan. And need to find the first one with value bigger than the given value.

Need to pre-process the data and then the data are stored to fit for the queries.

6:00 am
Wake up. Thought about the algorithm but my idea to find kth larger one has timeout issue. Could not find the correct data structure to handle, went through heap, linked list, space concern etc. Continue to sleep. Set timer for 30 minutes

6:30 am

7:00 am

8:00 am
Only one hour left, I had hard time to get up. So good sleep. I could not come out the pre-processing idea.

9:01 am
The contest ended at 9:00 am. Check editorial note, haha, so easy. My sleep therapy with a problem solving did not work, I did not choose to stay late in the morning for my health concern.

I tried to change the style to define a good fight for this hard algorithm. At first, I choose the good night sleep, wait for the inspiration through the sleep and thinking.

Get up around 9:10 am, talked to the friend about next weekend Vancouver island road trip. I delayed the discussion in Saturday night 9:30 pm, told the friend my contest ended in the morning 9:00 am.


I have to train my brain with hard level algorithm. I am getting lazy with brain storming. Work hard!

Actionable Items:

Need to work on better logistics for codesprint. Friday night I should have started the codesprint, but I spent over 2 hours to book a hotel, and then I spent time to study,, websites.

Saturday morning 10:00 am - 12:00 pm I visited a burnaby church, and were very interested in the structure of the service.

Trader Profit - Goldman Sachs Codesprint

August 19, 2017

Plan to work on the medium level algorithm called Trader Profit. The link is here.

Now it is 5:43 pm, 15 hours left for the contest to Monday morning 9:00 am.

It is 7:19 pm. The algorithm is solved and then ranking is 2414.

Note after the contest 

I reviewed Leetcode 121, 122, 123 algorithms, and then used Leetcode 123 algorithm solution, my last practice to submit the code.

I did read the solution for Leetcode 121. The link is here. I also read the solution for Leetcode 122, the link is here.

Things found in the contest

I found issues in the contest, when I reviewed my practice of Leetcode 121 and Leetcode 122 in the contest, I found out that my blogs does not have anything, only source code code link. In order to understand the algorithms, I have to lookup Leetcode discussion. My last practice does not help me at all.


A hard working programmer should be diligent to write down more helpful notes for herself to use next time in the contest.

Here are the links of my last practice.

Leetcode 121 link is here.

Leetcode 122 link is here.

C# Code submitted in the contest is here.

Wimbledon Champion Garbiñe Muguruza (Full Interview)

August 19, 2017

Watch the video Wimbledon Champion Garbine Muguruza.  7 minute video link is here.

1:45 Beat Serena?  They are tough opponent.

2:15 Superstition?  Be confident. Very nervous, shaking. 2 years ago I lost. This one is mine. Trying so hard to win.

2:27 Feel nervous? Once you get to the court, you are sweating. When you get there, you are good there. The best is that crowd is equal.

4:20 How to celebrate? kind of lost here.


Inspiring Stories: Garbine Muguruza

August 19, 2017

Watch less than 3 minutes videos about an inspiring stories: Garbine Muguruza.

Plan to write down some notes, what are the key points in the story. How the video is presented? The gentle voice and the story about going to No. 1 in the world, young player age 23.

0:00 To be the best player at the top, you have to be very demanding. Everything you do has to be perfect. It is very demanding. There is no room for imperfection. I love to compete, so be able to go out there, have an opponent in front of me, it makes me hanging there to win.

0:25  It is a game, I have to earn my victory.

1:11/ 2:28 Try so hard, and play without fear, and just give it all.

1:26/ 2:28 Focus on the match, forget about where are you. Concentrate what you have to do.

1:51 I feel that you like to do something, you just go for it. For me, it is to play tennis, be the best I can.

By Maximum Stocks - Goldman Sachs Codesprint

August 19, 2017

Plan to work on the medium level algorithm called "Buy maximum stocks".

I started to work on the algorithm from 3:37 pm, and solved the problem at 5:32 pm.

Plan to go back to study string.Split function StringSplitOptions Enumeration. The msdn link is here.

Here is the progress report. I took 36 minutes to review the code, and fixed bugs, and then read one of discussions to get the bug fixed, solved all test cases from 1 to last one run time error issue.

Now the ranking moved from 7xxx to 4xxx. Good job!

Follow up 

Code submitted in the contest is here.

Friday, August 18, 2017

Leetcode 532 - K-diff Pairs in an array

August 18, 2017


It is the challenging task to complete the algorithm in 30 minutes, without a bug. I had a mocking experience 6:00 pm with a peer who is a master graduate student. The peer worked on a hard level algorithm, and I worked on easy level algorithm similar to Leetcode 532. Here is my C# practice with a bug.

Whiteboard testing 

Plan to look into the edge case. It is easy to fix the bug, here is the C# code with a bug fix.

I like to figure out how to make my white boarding testing more efficient.

Pay attention to white boarding testing, make sure that test cases are listed and also I do my best to examine the possible mistakes before I run test cases.

Follow up 

August 29, 2017
The C# code in practice has a few issues, and the code was updated with a few changes in order to pass all test cases. The code is here.

Algorithm Practice 

I practiced the Leetcode 532 and failed a few test cases. Need to go over discussion section and then search for great discussion.

Goldman Sachs codesprint on Hackerrank

August 18, 2017

Plan to start to play the codesprint starting from Friday 7:00 pm, and I like to get myself excited to improve problem solving.

Now it is 3:01 pm on August 19, 2017, I just completed the first easy algorithm, my ranking is 7887/9070.

Now I like to continue to work on the codesprint. - C# Language Internals - Part 1

August 18, 2017

Plan to spend 5 hours to watch the course called C# Language Internals - Part 1 by Bart De Smet.

C# 3.0 Design Patterns

August 18, 2017


Compared to social website, reading a C# book is very rare for me this summer. I like to read a C# book called "C# 3.0 Design Patterns".

Book reading 

Plan to read the book 30 minutes a time. 

Wednesday, August 9, 2017

Openbracket Delaware - Online Trials

August 9, 2017

I was so busy and I missed another contest on on August 4, 2017. I  looked up the leaderboard of open bracket Delaware - online trial today. It is a good idea to study the leaderboard and then get to know top 100 on the leaderboard in united states.

Mark gordon  ranking 4 -

Ranking 5 Dhruv Ranganathan

Ranking 10 - Jingbo Shang

One of top players is here, rank 16 out of 2863. His USACO - Posts is here, quora link is here.

Plant to read wiki page of computer scientist: Manuel Blum.

An advice by Manuel Blum to beginning graduate students: "Brains are muscles. They grow strong with exercise. And even if they're strong, they grow weak without it.".

Ranking 18 - Tiancheng Lou - Who is ACRush?
interview at google

Ranking 28 Calvin Lee

Actionable Item

Write a blog with my own voice speech.
Plan to speak something for each algorithm I love to practice.

Monday, August 7, 2017

Software developer as a professional research

August 7, 2017


It is 10:00 pm Sunday evening. It is also a good time to do some research. I choose the topic the software developer as a career. What should I study as a software developer?

Recently I did study the course on how to be an outlier. I plan to review the course again.

Software developer tactics 

I have completed over 80 mocking interview since this March. First time I had mocking interview with a peer and we talked about 2 hard level algorithms after completion of mocked algorithms. I liked the discussion of the algorithm, it helped me to understand Leetcode 85: Maximal Rectangle. Compared to my last practice over 3 hours, the peer gave me 10 minutes lecture and I understood the algorithm in a new perspective.

I was so surprised that I am a new learner since I learn from a topcoder player who is willing to share his practice. I just chose a hard level algorithm and asked the peer to solve it.

Narrow down the research, choose a few articles to read:

The 13 developer skills you need to master now. The article on inforworld link is here.

Safeguard your code: 17 security tips for developers. The article on infoworld link is here.

Quora discussion - how many years can a programmer survive in India? The link is here.

The painful truth about age discrimination in tech, the link is here.

Quora question - sofware development is a dead end job after age 35 - 40 ?

System design: facebook chat

August 7, 2017


It is very good learning experience to do system design practice. Today  I chose to study the topic: How to design a facebook chat.

Design Talk

Plan to read system design website 30 minutes a time. Link is here on github in English.

Plan to read system design article on palantir. The link is here.

Harvard lecture video about website system design: the link is here

Lecture notes is here

First, go over the transcript found on one website mixed in Chinese:

Here is the link.

Here is the link about basic questions about spec and requirements.

Step1: 先問所有requirement, spec 這個系統需要提供什麼功能
Step2: Constrains: 問他我們需要處理多少traffic, 多少data, latency重不重要 A和C選哪個
Step3: 計算需要多少機器 要用什麼storage
Step4: Abstract design: 先畫出大架構! 每個會出現的component都要畫出來 再看面試官希望你深入講哪個component
Step5: Scale: 讓你的system有fault tolerance, scale成大公司的系統架構

String search algorithm practice

August 7, 2017


It is the British Columbia holiday and I booked another mocking practice at 12:00 pm. The practice hours is a very happy time to learn how to work on one algorithm.

Algorithm practice

C# practice code is here. I spent over 10 minutes to fix so many compile errors, but I stopped after running into the execution errors.

After the practice, I found the two problems, one is null pointer error (4 lines of code are added from line 44 to 47), second one is missing a loop (a for loop is added on line 58), I fixed them after mocking practice.


There are two issues in my writing in mocking interview. First one is null pointer issue. Second one is to separate the collection from one single item. Need to go over each item in collection, and append each of them.

Plan to do some research on common mistakes in C# code. Using strong typing is a good tip to allow the compiler to help, avoid error in run time checking.

Sunday, August 6, 2017

Leetcode 76: Minimum Window Substring

August 6, 2017


It is the hard algorithm and it is very challenging one. I practiced more than 3 times recently and then I still had some issues to write down the ideas today. I had a mocking experience and then it is the first time I like to explain the advanced idea to the peer, the one I just learned less than 2 month ago, but the peer had issue to follow. The mocking is kind of teaching and learning when I tried to apply this special idea to handle the minimum window, I failed to engage the peer when I wrote the implementation, I did not talk when I wrote and made sure that the peer was following me.

The last practice is documented here. And I did some practice in April 2017, the blog is here.

Algorithm practice 

Saturday, August 5, 2017

Leetcode 84: Largest Rectangle in Histogram

August 5, 2017

Plan to work on hard level algorithm Leetcode 84: Largest Rectangle in Histogram.

Plan to study the solution on set 1. The link is here.
Plan to study the solution on set 2. The link is here.

My last practice in 2015 is here.

Introduction to Algorithm 3rd edition

August 5, 2017


It is the Saturday afternoon. I just had a mocking interview 4:00 pm, so I asked the peer to solve a hard level algorithm called Leetcode 85: The Maximal Region. So the peer explained to me Leetcode 84: Histogram algorithm first, and then use a simple test case to show me how it is related to Leetcode 85. In less than 10 minutes, I fully understood the relationship between two algorithms. This is by far most strongest programmer I met so far.

The peer recommended me to read the book called Introduction to Algorithm, third edition, and also watch the MIT 6.046J/ 18.410J Introduction to Algorithms.

Book reading 

Plan to read the book and write down some notes. 

Mitt Romney's advice

August 5, 2017


It is so busy every day and every year. Julia only remembered the advice "The secret to advancement is to do current job very well". Julia spent over 30 minutes to look into her blog and, and she found the advice is from Harvard graduate Mitt Romney.

The fact is that Julia has to watch out how she spends her time. She spent over 10 minutes to look into the Burnaby central park a murder case through the facebook two weeks ago, and then in 2 weeks her facebook was flooded with all kinds of news. She immediately removed all those news feeds from her facebook account.

It is better for Julia to do her own research and study, what to watch, what to read. Today, she likes to slow down her daily activity, watch some videos from Mitt Romney.

Watch and learn

The first video is called "Launch Out Into The Deep".

The second video is called "2016 Trine University Commencement Speech". Time 13:00 - 15:00 talk about how to do your current job very well.

7 happy habits from 50 years working experience:

1. Keep your friends

The friends can enrich your life. Make a habit to stay connected.


3. Do your present job very well.
How to have a successful career? (13:20 - 14:44)
Mitt got the advice from his dad. Do not complain. Don't just get by. Dig in. Learn everything you can. Learn everything about business and industry. Be worth more than what you are paid, that way, open up the opportunities for promotions, also open up new ideas, new enterprises.

Example, founder Thomas_G._Stemberg.

4. Do not swallow a hook.

5. Take responsibility.

Blame things you cannot control, you will have more. Take responsibility and put yourself in control.

6. Live something large than yourself.
Education is an investment for you.
Give a talk about the founder Domino's pizza in 1960, Tom Monahan (18:00/ 25:16).


Sponsor application project

August 5, 2017

It is a long weekend called British Columbia day. Julia likes to work on the sponsor application and prepare to send out the application package in the long weekend.

Thursday, August 3, 2017

Leetcode 282: Expression Add Operators

August 3, 2017

Plan to work on the algorithm called expression and operators. The problem statement is here.

Leetcode 273: Integer to English Words

August 3, 2017

Plan to work on hard level algorithm called Integer to English words. The problem statement is here.

Leetcode 218: The Skyline Problem

August 3, 2017

Plan to work on hard level algorithm called The skyline problem. The problem statement is here.

Leetcode 297: Serialize and deserialize a binary tree

August 3, 2017

Plan to review Leetcode 297. Last practice was in May 2016.

Leetcode 42: Trapping Rain Water

August 3, 2017

Plan to work on the algorithm called trapping rain water. The problem statement is here.

Wednesday, August 2, 2017

About mock interviews - facts and tips

August 2, 2017

Motivation talk 

My favorite success rule is "Secret to the advancement is to do your present job well". I like to use this rule to explain why I practice a lot of mock interviews on a free platform starting from this March. It is one of Mitt Romney's top 10 rules for success, a Harvard graduate, Mitt Romney, rule No. 9.

 I tried to advance my skill level and enjoy my adventures outside my current job. The current job is the first place I apply if I add some new weapon to my arsenal. I have started to write a coding blog since 2015, and since November 2016 I got involved a small community called, and finally this March 2017 I started to practice mock interview on again. I did practice mock interview 9 times in 2016 from March to April, and I practiced a lot of times this year.

One of complaints I got at work is that I do not talk to people about my work in 2015. Usually the common sense is that you are good at until you talk about a lot. Since then, I work hard on the feedbacks.

It is not easy to be creative and stay grounded. I started to borrow the ideas from my tennis sports hobby, learned from WTA professional players, philosophy about mental toughness. My favorite ideas can be summarized in the following 3 quotes, "train insane or remain the same", "I tasted the success and hunger for more", "If you are behind, focus on one point at a time. Don't focus on the score. Don't focus on anything else. Just focus on that one sole point.".

I learn to write efficiently, and document the growth of good thinking in algorithm. I write a coding blog every day and look into some ideas from professional tennis player WTA player training and coaching. My most favorite idea is to journal the practice, write down my feeling and know the importance to write down and be part of practice. One of examples is a twitter I published to share my hats. More details, I asked over 30 questions through codereview website and so excited to get reviews from people all over the world, through profile statistics: near 11k people reached, I was excited to have 9 hats in 2016 holiday bash and my favorite hat is called trendsetter. That holiday season was so special because of those 9 hats.

Here are 9 tips I plan to use to prepare for mock interview on I like to share them and get some feedback from you as well. I already completed the first round of algorithms but I am still practising the mock interviews.

1. Review the book "The art of readable code" for 10 minutes, learn to practice a new art in your next mock interview.
2. Review three hours course on called "Clean code: Write code for humans". Memorize some keywords on the clean code handout, google one of keys a time. Julia's favorite is The Outline Rule. The course summary is here.
3. Always remember that train insane or remain the same. Work on a hard level algorithm and taste the success of learning a hard level algorithm one a time.
4. Hold on high standard. Learn one hard level algorithm a day. Some of mock interview algorithms are hard level, I did not solve the algorithm and failed a few times.
5. Review some tips about real interview advice on bloomberg. I have the favorite one from Amazon on bloomberg site called "Do not be vague".
6. Try to be a good scholar, I do some small research very short time. People are smart and learn quickly on, also it is a good practice to try to share a book or an article or extend the algorithm to a hard level, also focus on how to relate to improve performance of problem solving.
7. Spend a few minutes to review 10 tips to help you perform to highest potential.

Share my favorite quote from Microsoft manager Aviad Ezra.

"Practice: Nothing beats mock interviews. It will boost your confidence and you’ll learn a ton from having someone watching you and listening to your explanations while you solve coding problems. You can pair with a friend or use one of the free peer-to-peer mock interviewing platforms. You don’t need to sacrifice your first interviews just to get hands-on practice."

I like to end the blog using one of my real experience. I almost thought about quit in the first few mock inteview this March. One of peers gave me the review and I could not handle the frustration, one is to handle my technical weekness and another one is about understanding the mock learning experience. Surprisingly, I got an email from the founder of and asked me why I chose not to recommend the to friends. Through the communication, and I recalled in 2016 the founder spent half hour to interview me and gave me 3 great advice, I really felt at home when I use mock interview on

Mock interview practice on is like my favorite tennis sports - I don't feel fear when I am on court. That's where I feel at home.

Tuesday, August 1, 2017

Hard Level Algorithms (III)

July 31, 2017

Plan to work on those Top 100 liked algorithm 18 hard level algorithms.

The link is here.