Monday, August 28, 2017

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 pluralsight.com 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.


9/26/2017

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


Saturday, August 26, 2017

Vancouver Island vacation

August 26, 2017

Introduction


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

Introduction


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


Introduction



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

Introduction 


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

Introduction 


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

Introduction


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 quora.com 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.


Argument:


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 booking.com, expedia.com, Airbnb.com 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.

Argument: 

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

Introduction



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.



pluralsight.com - 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

Introduction



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 Hackerrank.com 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

http://www.dhruvrnathan.net/

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

Introduction


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 pluralsight.com 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

Introduction


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

Introduction



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.

Weakness


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

Introduction



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 geeksforgeeks.com set 1. The link is here.
Plan to study the solution on geeksforgeeks.com set 2. The link is here.



My last practice in 2015 is here.

Introduction to Algorithm 3rd edition

August 5, 2017

Introduction


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

Introduction


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 youtube.com, 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.

2.

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, staples.com 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).

7. 

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 codereview.stackexchange.com, and finally this March 2017 I started to practice mock interview on pramp.com 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 pramp.com. 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 pluralsight.com 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 pramp.com, 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 pramp.com and asked me why I chose not to recommend the pramp.com 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 pramp.com.


Mock interview practice on pramp.com 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.




Monday, July 31, 2017

Hard level algorithms (II)

July 31, 2017

Plan to work on Top facebook hard level algorithms. Plan to read those 11 algorithms and think about 30 minutes a time.

Here is the link.

Here is the image.



Hard level algorithms (I)

July 31, 2017

Introduction


It is a good idea to have some hard level algorithm in your mind when you go over routine daily work. You will find yourself to be more motivated and more efficient to live and work every day. Because you are searching the great ideas and read a lot of people's code with various languages, you will certainly appreciate how luck you are to have a software engineer job and always find yourself work on some easy tasks. Do not waste your brain power, get it challenged more often.

Let us work on Top Google Questions on hard level Leetcode algorithms.


Hard level algorithms 


First, it is very helpful to show the image of those algorithm. Plan to spend 2 hours to read those 17 algorithms and think about ideas to solve the problems. 

The link is here. 


Leetcode 632: Smallest Range

July 31, 2017

Plan to work on the hard level algorithm called "Smallest Range".

Leetcode 315: Count of Smaller Numbers After Self

July 31, 2017

Plan to work on the hard level algorithm called "Count of Smaller Numbers After Self".

Leetcode 301: Remove Invalid Parentheses

July 31, 2017

Plan to work on the hard level algorithm called "Remove Invalid Parentheses". Spent over 2 hours to study the leetcode discussion, and figured out what to work on. The most important is to write code using other people's ideas, Julia found one person to summarize the solutions  through the discussion. Julia likes to apply Terse, Expressive, and Do one thing  (TED) principle she learned through pluralsight.com course clean code. She likes to go over the handout of the course and apply some notes to her practice. The handout link is here.

Three code principles are outlined in the article called "3 Core Principles to Write Clean Code".

Depth first search I


1. Plan to study Java solution provided by a Google engineer first. Here is the link.

Spent over 2 hours to study the code, Julia wrote one with three test cases. Here is her C# code. Use readable function name, C# code is here.

Depth first search II



2. Plan to study Java solution provided by dietpepsi. Here is the link.

Spent over 2 hours to study the code, Julia wrote one with three test case. Here is her C# code.

The design idea is to scan the string twice, first scan is to remove the invalid ')'; then reverse the string with removed invalid ')', in other words, scan right to left virtually; this time is to remove invalid '('.

After removing invalid ')' and '(', reverse the search and then add to valid strings list.

Breadth first search ( no pruning )


Plan to study the discussion, the link is here. 

C# practice code is here. 

Breadth first search ( pruning )




Plan to study the BFS solution written in Java. The link is here.

A few ideas are applied to prune the BFS algorithm.

Julia's C# practice is here.

4. Plan to read this review of all solutions. The discussion link is here.

5. Plan to study the analysis written in Chinese:

对于一个字符串,在任何时候如果 ')' 的个数多于左括号,则说明从开始到现在位置必然可以删除一个')'.而这段子串可能包含多个')',删除哪一个呢?当然删除任何一个都可以.

例如对于()())(),从开头到 s[4] 位置构成的子串多了一个右括号,因此我们需要删掉一个,而这个子串有三个右括号,但是只会产生2个结果,也就是会有一个重复值.所以在删除括号的时候,为保证不会产生重复值,需要记录一个最后删除的位置,这样可以使得在接下来删除的时候只删除这个位置之后的值.这样我们可以使得当前这一段子串不再包含多余的右括号了.这样我们可以删除了一个右括号之后合法的子串与后面还没有检查过的子串组成一个新的字符串重新开始检查.直到不再含有非法的右括号.

但是还有一种情况是包含了多余的左括号,一种直观的方法是从右向左再按照上面的方法处理一遍左括号.但是将数组逆置之后就可以重用上面的算法了.

所以总的思路就是先对字符串进行处理使得其不再含有非法右括号,然后将其翻转以后再检查是否含有非法的左括号.最后左右括号都检查完之后都合法就是我们要的答案了.

时间复杂度应该是O(n^2).

Plan to study C++ source code. Here is the link. The blog link is here. 

Leetcode 85: Maximal Rectangle

July 31, 2017

Plan to work on the hard level algorithm called Maximal Rectangle. 30 minutes a time.

Julia studied one of discussions, and then she wrote a C# solution based on the C# solution shared. Here is her C# code.


Update C# code, move currentRight variable declaration just before use. The code is here.

Leetcode 42: Trapping Rain Water

July 31, 2017

Plan to work the hard level algorithm called Trapping Rain Water.

Work on the algorithm 30 minutes a time. Go over the discussion section and make sure that Julia learns as many ideas as possible.


Leetcode 4: Median of two sorted arrays

July 31, 2017

It is the hard level Leetcode algorithm. Julia likes to learn some hard level algorithm.

First review C# practice Julia did 2 years ago. Plan to work on the algorithm. 30 minutes a time.


One hard algorithm a day

July 31, 2017


Introduction


It is time to do some short research. Today Julia chooses the research topic is "One Leetcode hard algorithm a day". Because the leetcode algorithm has more than thousands submissions and also over thousands views, it is good practice to go over the discussion every day.

It is also the research Julia likes to work on, how to keep herself motivated to improve problem solving on algorithm and data structure. One thing she finds is that she spends at least one hour to go over wechat or wenxuecity.com every day, she is very interested in the entertainment news and keep update with friends. But she has to limit the consumption of those news and entertainment stories. She has to set cap on the time on those activities. Instead she started to go back to church every Sunday and meet people, have more grounded activities instead.

To be a successful competitive programmer, Julia has to get into the community of Leetcode discussion group more often, think and practice algorithm more often.

First step is to read all hard level algorithms first. At least Julia starts to think about the algorithm. Do not read discussion, think about the problem first.


Algorithm practice


Here is the webpage to list hard algorithm on Leetcode. There are less than 150 hard algorithms.

Here is the list of hard level top liked hard algorithms.

Here is the list of hard level top Amazon algorithms. (7 algorithms)

Here is the list of hard level top Google algorithms. (17 algorithms)

Here is the list of hard level top Facebook algorithms. (11 algorithms)

Plan to read about "Serenity prayer".

Sunday, July 30, 2017

Leetcode 72: Edit Distance

July 30, 2017

Introduction


It is such great mocking experience for Julia to work on edit distance algorithm again in 30 minutes this afternoon around 4:00 pm. Since Julia was tired and kind of sleepy, she could not hear the peer because of her speaker was turned off. It took her 5 minutes to find out, both tried to login again. The fact is that if you are tired, your will have some issues to work on the small thing.

It is good to observe that when you are tired, the thing can go out of control once a while. Julia remembered last time that she was very tired and then she worked on week of code 34 over 5 hours and did not score anything. Always get ready for the mocking!

The algorithm is hard to write. Even though it is not the first time to write it. Her last practice is documented here.

Design of Memoization


The peer helped Julia to come out the idea to design the key for memoization. Julia worked on design by going through the simple case, "heat" to "hit",  how to express distance("eat","it") using the key? Julia thought about loud, one way is to concatenate two keys like this "eat it", and she said that "it eat" should be the same as "eat it". Because Julia was too tired, she did not have a good idea. She was given a hint to use the array, use index of string, then she asked the idea using int[2] and define the comparer function.

The peer gave her hint to use jagged array memo[i][j], whereas i and j are the index of start position of substring.

Algorithm practice 



C# practice code is here. The code runs with a test case and the result is correct. The peer reminded Julia line 71 and 72 having an issue. Julia forgot to increment one to the distance. At the end with a test case, the peer applaused  Julia, and it was unbelievable 71 lines of code no bug.


Editorial Notes:

9/22/2017
I practiced again this algorithm through mocking interview, I met a senior developer who has very good managing experience. He asked me the time complexity about brute force solution, I stumbled on the question.

Based on the above experience, I did not learn the algorithm very well in theory. The dynamic programming is not easy to figure out. I need to relate to a simple life experience for this algorithm. I did one later on. Here is the blog link.

July 6 2023
I am working on Meta phone screen in two months, so I have chance to review Edit distance. 

Saturday, July 29, 2017

Clean code: Writing Code For Humans (II)

July 29, 2017

Introduction


It is so much learning to go over the lectures again after 2 months. The lecture on pluralsight.com is three hours 10 minutes long. The first time study is documented, the blog link is here.

In order to practice those principles like TED principle, Julia has to write down and try to have some workout first. It is also good practice to go over some lecture note before taking another mocking interview in the weekend.

To be a better programmer, stay competitive, the mocking interview is the great opportunity for Julia to learn how to work on small things each time, learn to communicate with the peer to solve problem. More practice will help Julia learn and have some creative ways to solve the problem.

July 29, 2017  10:30 pm - 11:30 pm
Go over the lecture video again

TED Principle (remember it, repeat three times! TED Principle, TED Principle, TED Principle)
Terse, expressive, do one thing
Don't repeat yourself

How to write Self-document code?
clear intent
layers of abstraction

Assign Booleans Implicitly 
Magic Numbers
Dirty                  Clean 
if(age > 21)        const int legalDrinkingAge = 21
                         if(age > legalDrinkingAge)
                         {
                         }
Encapsulate Complex Conditionals
Principle: Favor expressive code over comments (expressive vs comments, two choices, a principle?)

Be declarative if possible 
Dirty 
Clean -> Use LINQ
return users
   .where(u => u.AccountBalance < minimuAccountBalance)
   .where(u => u.Status == Status.Active); 
Interesting? Call it "Be declarative if possible". It is hard to related to LINQ example. 

Table Driven Methods 
- great for dynamic logic
- avoids hard coding
- write less code - Avoids complex data structures
- Easily changeable without a code change/app deployment


Friday, July 28, 2017

How will you measure your life?

July 28, 2017

It is the good habit to share a testimony when you read a book or watch a video. The book is called "How will you measure your life". The video talk at linkedin is very detail and 75 minutes. The video link is here.

It is hard to relate my life story with this book and video talk since I only spent less than 2 hours to study them. Right now, I am still watching the video and listen the talk. But I had a lot of small group meeting from 2011 to 2015, I learned and practiced a lot of talks through small group meetings.


How will you measure your life?

July 28, 2017

Plan to watch 20 minutes talk by Harvard professor Clay Christensen. The link is here. The book link is here.

Julia has a habit to check wechat once a while, every time she saw an article about the professor in business, she will google and then spend 10 - 20 minutes to do some research. First, she can learn English and improve her research skills; she can compare her research to the wechat article and see the difference.

The Chinese article link is here. The better Chinese article with more supporting arguments is here.

It is good website to read more about book while watching the video second time.

More reading is much more fun:

15 Business Theories that will improve your life - business insider article link is here.
75 minutes talk at LinkedIn, the link is here.
5 minutes reading about the book, link is here.

Becoming an outlier: Reprogramming the developer's mind

July 28, 2017


Plan to watch another course on pluralsight.com provided by Cory House, which is called "Becoming an Outlier: Reprogramming the developer's mind".


Follow up 



August 30, 2017
Read the transcript, and then look into a few ideas shown in the transcript. 


Read the short essay written by Peter Novic, the topic is "Teach yourself programming in ten years". The article link is here. 




C# coding standard by tiobe.com - the link is here. 

Seven ineffective coding habits of many programmers

July 28, 2017

Plan to watch 46 minutes video called "Seven ineffective coding habits of many programmers". The link of youtube.com is here.

It is better to go over slides while watching the video. The slideshow link is here.

Programmer may like to watch this course on pluralsight.com called "Code For human".

Wednesday, July 26, 2017

Find first ancestor

July 26, 2017

Plan to study the algorithm called "Find first ancestor". The blog link is here.

Ways to climb a stair case

July 26, 2017

Plan to study the algorithm called "Ways to climb a stair case". The blog link is here.


Parentheses

July 26, 2017

Plan to study the algorithm called Parentheses. The blog link is here.


Flood fill algorithm

July 26, 2017

Plan to study the blog about the algorithm "Flood fill algorithm". The blog link is here.

Practice depth first traversals

July 26, 2017


Plan to study the algorithm blog called "Practice depth first traversals". The blog link is here.

Can a blog make a difference?

July 26, 2017

Introduction


It is so much fun to have a new school once a while. Julia spent over three months to learn from codereview.stackexchange.com, she was kind of getting lost in the code review but she received a lot of valuable review from JS1. The internet is big world and she never met the person and contacted him personally, the anonymity of user makes internet more interesting.

From March to July, Julia started to meet a person one by one. But she met too many people, sometimes she could not prepare very well for the algorithms used in the mocking. The experience was amazing, this mocking website machine learning algorithm really did great favor to Julia, she could not believe how she connected top talent in the world. It is like inviting people to give you guest lecture every day. Julia learned that good personality really makes life easy as a programmer, so she works hard to reduce her accent, discipline herself to prepare early, learn to be super patient.

Now Julia likes to conduct  a small research on the blog written by Aviad Ezra. Julia likes to go over around 20 algorithm one by one.


Blog study 


First one is about boggle algorithm. Julia wrote a blog on this algorithm. Julia just learned the trie again in June, 2017. The blog is here. 


Tree contains linkedlist

July 26, 2017

Plan to study the algorithm called "Tree contains linkedlist". The blog is here.

Design cache with auto deletion

July 26, 2017

Plan to study the algorithm called "Design cache with auto deletion". The blog link is here.

Algorithm: Possible Triangle

July 26, 2017

Introduction


It is a good practice to document personal growth in terms of coding skills. Julia looked up her gmail box and found an email to read back to October 2009. Julia read the code she wrote 8 years ago, and there are so many issues in her code. What she likes to do is to review the code and write down her feelings.

Proverbs 24:16, for the righteous falls seven times and rises again, but the wicked stumble in times of calamity. 

Just be super patient to yourself. The bible teaching always use seven, or seven of seven to allow thing happen. Learn from the past mistake, it is the first step to move forward.

The problem statement is the following:

How to determine if three numbers can be a triangle, which is one with three lines with same length, two of them with same length.


Algorithm practice 



Here is the code written in October 2009, the link is here.

Plan to write the function and give some code review compared to the previous one.

It is a long journey, after 8 years, Julia went back to her gmail box and found this algorithm. She did fail the phone screen with the code; so she reviewed her own code, and wrote a new one. Here it is the new version, it took her 10 minutes to write. Julia will write down some code review as well.

Code review



Code written in October 2009, the link is here.
Code written in July 2017, the link is the new version.
Highlights of code review:

1. Function name should be meaningful. PossibleTriangle function name is better than the name called "test". It should be more than just to check if the numbers can form triangle, afterwards, it should be checked if the three edges are the same length, called equilateral; or two edges are the same length, called isosceles; or none of two is the same, called scalene.

2. edge case, exclude negative values;

3. Line 40, declare an array, line 41, sort the array. We like to make it simple to check any two edges's sum is bigger than the third edge.
We only need to compare two smaller edges's sum to the largest edge.

4. line 44, add comment to explain the checking and the logic of trigonometry.

5. line 51, line 52, declare two bool variables, check the triangle is isosceles only if it is not a equilateral.

6. Add some test cases to make sure that code works, pass unit test cases. C# Code is here with 4 test cases.
Julia learned a few thing after watching the pluralsight.com course: "code for humans". Julia also learned to use Array class to sort the number first, and then use explicit bool variable to define two things.

Actionable Item


Plan to watch another course on pluralsight.com provided by Cory House, which is called "Becoming an Outlier: Reprogramming the developer's mind".

9/11/2017 8:58 pm
Review the blog possible triangle and get some ideas about the algorithm.

6/22/2018
I created a gist based on the email I found related to this phone screen. It is very interesting to read what I wrote back in 2009. Here is the gist.

Tuesday, July 25, 2017

System Design - Designing a URL Shorten Service like TinyURL

July 25, 2017

Plan to read the system design preview on this site.

It is the important to be specific, not be vague. Julia starts to learn system design from this easy one.


Data structures and algorithms

July 25, 2017

Introduction


It is always a good practice to write down something everyday, maybe 10 - 20 minutes, work on a small research topic. Today Julia likes to review the post from Aviad Ezra on the question.

A small research 




Designing a URL Shorten Service like tinyURL - a very detail preview on https://www.educative.io

Vacation planning 2017

July 25, 2017

Introduction


It is very exciting project to work on 2017 vacation planning. Last year Julia fled flied to China and spent a lot of time to watch China open tennis. She actually did not go anywhere in Beijing a few days, only spent time to watch China open all day long from October 1 to October 3, from morning to the evening 8:00 pm. Most of her favorite time was to watch tennis professional practiced in the evening.

After a short stay in the city of Beijing, Julia will fly back to her home town and visit her family over there.

Vacation talk 


Vacation is fun but also Julia had to deal with jet lag; it is best to live in a nice hotel, and then spend a first 2 - 3 days vacation to overcome jet lag, and also enjoy some sightseeing. The October weather in Beijing is perfect, and Julia has good time to enjoy the city. 

But it is also good to get prepared better, it is very important to get China cellular phone setup, the taxi service through cellular phone will make things so easy and convenient. 


Monday, July 24, 2017

System design: a chat system

July 24, 2017

Plan to read the article written by Aviad Ezra. The link is here.

Power Set

July 24, 2017

Plan to study algorithm blog called "power set" written by Aviad Ezra.

Plan to study Leetcode 78: Subsets, medium level algorithm. The discussion link is here.