Saturday, August 11, 2018

Woman to adapt

August 11, 2018

Introduction


I have to learn how to adapt and then help myself to create a good career. I am the dreamer and also hard working.

Woman to adapt 


It is time for me to go back and study my humble beginning. No matter what happen recently, I am much better compared to 3 years ago, 9 years ago.

Year 2009

I like to review one of blogs I wrote for my phone interview algorithm in 2009. Here is the blog called possible triangles.

Year 2015

The second one is called the birth of Julia's coding blog. Here is the link.

Year 2016

Learn a lesson. 450 lines of code can not beat 50 lines of code. I have to learn dynamic programming. Here is the blog.

Year 2017

A cheerful heart is a good medicine. Here is the blog.

Year 2018

I was so busy and learned a few lessons.

Six ways to overcome nervousness

August 11, 2018

Introduction


I had 45 minutes phone meeting on July 31, 2018, and I was asked to solve a design question related to data structure minimum heap or merge sort algorithm. I did not do very well first 10 to 15 minutes because I felt so nervous.

I have to do some research on this topic, nervousness. It may be my weakness of technical skills. But I like to look into nervousness anyway. It is good investment of time to understand the topic. The article I like to study is called six ways to overcome nervousness. Here is the link.

Study 

1. Listen to the gremlin. Then talk back.

2. Choose courage over confidence.

3. Breathe your way through it.

4. Know your strengths.

5. Start developing yourself.

6. Recongnize nervousness as a sign of something good.

Here are the article the contributor Rebecca Newton wrote for sharing.


Thursday, August 9, 2018

Stay hungry, stay foolish

August 9, 2018

Introduction


It is time for me to study the quote called stay hungry, stay foolish. I like to read the article and study on the topic. Now it is 11:10 PM, I like to study 20 - 30 minutes on this topic. Here is the article link.

There is a similar quote from English actor Tom Hiddleston. Here is the quote.

It takes courage to take the advice to work on Leetcode easy level algorithms. I started the practice starting from July 17, 2018.

I could not believe that I made the choice. I thought that I only need to learn to solve hard level algorithms. I tried to find drills to work on hard level algorithms.

Stay humble


In order for me to improve myself as a programmer, I like to work on as many as possible easy level Leetcode algorithms. My goal is to submit the solution on leetcode.com 10 algorithm a week. I know that it is hard for me to stay humble, stay foolish, and write code for basics.

I love to code and also I love to learn new things every day. My job is to relax myself and enjoy the algorithm problem solving. I also like to share my practice on Leetcode discussion, honestly share what mistakes I make in the practice. I try to learn better design of algorithm. I forget the time complexity, I skip the brainstorm and I like to rush to code.






Leetcode 437: Path Sum III

August 9, 2018

Introduction


It is an easy level tree algorithm. I came out the idea to use prefix sum and also hashmap to track any path from root to leaf using O(1) time.

My practice


Here is my C# code. My code failed one test case, and then I added edge case for search value zero. I added two lines, line 46, 47.

Solution without using hashmap 


I did study one of solutions in discussion panel. I have to think and learn to write one solution without using hashmap. But the time complexity is less optimal, O(N2), N is total nodes in the tree.

Leetcode discussion panel


I like to build a new habit to share my learning on leetcode discussion panel. Here is my sharing.


Hard work beats talent

August 9, 2018

Introduction


It is my interest to get some daily reading material. I had such great time on tennis court last night from 7:30 PM - 8:50 PM. I need to go to bed now since it is 12:42 AM.

I like to get some good ideas to cheer me up.

Follow up 


August 9, 2018 8:44 PM

I need to set the goal to finish 10 Leetcode easy level algorithm one week. From August 1 to August 8, I did not submit any code on Leetcode online judge. I learn that I have to push myself hard.

To be a programmer, it is my job to practice coding every day.

August 9, 2018 9:55 PM

I like to share my solution using C# on Leetcode discussion panel. I need to learn more algorithms. I just could not believe that, I had chance to solve two easy level algorithm Leetcode 437 and Leetcode 501 today.

Sponsorship study

August 9, 2018

Introduction


It is very good investment to study tennis sports sponsorship. I like to learn the basics and then it is hard for me to read the article like this - How the spotlight on Serena Williams could change sponsorship of woman's tennis. Here is the link.


Stephens builds global endorsement lineup

August 9, 2018

Introduction

I like to do some sports marketing and then like to learn one or two tips. I do not know what to pay attention to, I just start to read one article a time.

I spent over one hour to study Stephens's interview, 20 minutes practice video in 2017 US open. I try to learn from the tennis star. The sports marketing and sponsorship, Stephens does very good job to present herself.

I also like to learn and use the techniques for my coding blog, quora.com writing, and github sharing, and algorithm practice.

Here is the article for me to read.

Now it is 12:25 AM. I have to go to work tomorrow. It is not healthy to stay too late.

Hard work 


I know that it takes a lot of hard work for me to achieve something.


Hardship and hunger for success

August 9, 2018

Introduction


Hardship and hunger for success is my study topic for next week. I like to read the article called In Tennis, Hardship and a Hunger to Succeed. The article link is here.

Unstoppable book excerpt is here to read. I just copy some notes from the blog:

I have always believed that unforgiving routine and sacrifice are crucial factors in every success, rather than just talent, whatever talent is, and Sharapova absolutely confirms that in describing how people first started noticing her tennis.
It was not my skill that people remarked on. It was my concentration — that I could do it again and again without getting bored.
And also this quote of Masha’s first coach, Yuri Yudkin, whom Sharapova met while living in Sochi.
To be great at anything, you have to be able to endure a tremendous amount of boredom.

My experience


I like to write something about hunger for success. I just could not believe that it is already two months since my last trip to Seattle.


Actionable techniques to get any job offer

August 9, 2018

Introduction


It is 12:04 AM. I tried to search good research topic for me to think about in the day time. I came cross this one by a Facebook product manager. Here is the link. The title is called Actionable techniques to get any job offer.

My notes

Be likable
Interviewers are looking for people who will create value for the company while being fun to work with.

Pitch an idea
Pitching an idea like this is a great way to start an interesting conversation and be a memorable candidate.

Know yourself

Last minute research topic

August 8, 2018

Introduction


It was 11:59 PM and I like to find a research topic for me to have a happy day and go to sleep. The topic is called secret interview technique by a Facebook employee. Here is the link.




Wednesday, August 8, 2018

Why do software engineers change jobs so frequently

August 8, 2018

Introduction


It is 11:41 PM. I like to conduct a small research for 10 - 20 minutes. Here is the article I like to read.


Reasons


1. Because they can
2. Grass is greener
3. Lack of recognition
4. Higher rewards

If you have any interest in computers, software engineer is the best job in the world. Just make sure you take care of your career, because you are the only person whose full time job is to do just that. And that will mean moving occasionally.

Statement to think about


You might think it’s just for fun, but many moves start this way.

Demand is high for good people. Many get several requests a month to interview with other companies. 

10 reasons to hold a USA property over 20 years

August 8, 2018

Introduction


I like to do some research called 10 reasons to hold a USA property over 20 years. I like to find ways to relax and the research and learning is very good therapy for me.

Here is the article I like to read 10 minutes called Consider Consider putting your U.S. home in a cross-border trust. Here is the link. 



10 Reasons to stay at a job for 10 or more years

August 8, 2018

Introduction


I like to do a small research tonight, since I stay at my job over 8 years, and I also find myself too busy to adapt as a software programmer. I like to do a small research and find good ideas what to work on. What I should learn from my current job next two years? Soft skills, what are my most favorite ones to learn first. I like to have more time to practice algorithm and data structure.

Here is the article called 10 reasons to stay at a job for 10 or more years.


Let me count my 10 years


2010

I talked to myself from 2010 to 2015, most important is to get Canadian citizenship. I need a country to retire one day. I cannot go back to China. And also I need to get work experience, I do not know how it feels to stay on a job more than five years.

2011

2012

2013

2014

2015
I got my Canadian citizenship in Nov., 2015.

2016
In July 2016, I learned that I can be a sponsor. I filed the application but I could not complete.

2017
Work on sponsor application, whole year. Filed in October, and approved in December.

2018
Help to work on principle applicant.

2019

2010

Leetcode 501. Find Mode in Binary Search Tree

August 8, 2018

Introduction


It is an easy level tree algorithm. I like to work on the algorithm. It is hard for me to find time to write code today.

My practice


I spent over 60 minutes to write a solution. Here is my C# code.

The code can be simplified and then I wrote second version with less time. Here is C# code.

Leetcode discussion panel


I know that most of hard working people share their work on Leetcode discussion panel. I like to set a goal to share my practice as well. I like to track how quick I can learn from the community. Here is my sharing.


Tuesday, August 7, 2018

It is time to change my attitude

August 7, 2018

Introduction


It is time for me to work on my attitude. I like to do some study how to collaborate with people better. I overestimate the online judge's power but underestimate the power of person. I learn to respect the authority through bible teaching starting from year 2001.

I like to find some study material for me to get inspiration how to work with people better. I like to make people life better by saying sorry, thank you, it is my fault.


Study time


I like to read the article about Roger Federal. Here is the link.

Three moments shaped Federer as a player and as a man


A brash, belligerent teen to a 19-time major winner. Three moments shaped Federer as a player and as a man. One such moment he was powerless to control.

Federer didn't slide down a slippery slope as a young, angry talent, and believes his coach Carter's death shocked him to maturity. Carter died in car accident while on safari in 2002.

Second is to split with the coach Peter Lundgren at age 22. Roger no longer needed a mate on tour. Lundgren was a mate of his. He would sit in a car with him, turn on the music, let him scream his head off on the highways of Miami, play silly games, get all that out of his system.

"Suddenly Roger Federer started to become a man. He didn't need that looking after anymore."

Actionable Items


It is such great story about Roger Federer.

I had same issues I guess as Roger did from 19 years old to 22 years old about loud music issue.

I spent hours to listen the music from June to August 2018, for example, I can listen the same song over 10 times in a week, Duo Lipa, I am the one.

I was busy to study lyrics and meaning of song, but that is all I can do. But I could not be educated too much after those hours long music listening.

I have to learn how to deal with frustration, loss, and failure, and learn how to get comfortable with myself.

Usually it is good for me to study those tennis players, after the first round loss, how they handle the loss. Just move on. Do not overreact.

Also I have to push myself more often and get under the stress of work on design of the algorithm. One thing I can do is to push myself to solve one or two algorithms a day.

I notice that Leetcode discuss is a good place for people to share and get inspiration on algorithm and data structure. A lot of people already share their experience and they are very successful in terms of career.

I also like to share more and see if I can help myself as well in the learning process, I will try to put all 40 algorithms I practiced called two weeks drill and share them one by one on Leetcode discuss.


Donna Vekic on trans world sport

August 7, 2018

Introduction


It is 8 minutes video about a young star. I like to learn from the player, and find out what is new in young generation. Here is the video link.

Here is the article to read who Donna Vekis hired as a coach in 2017.


Four go-to exercises

August 7, 2018

Introduction

It is less than two minutes talk from Madison Keys. Here is the link.

0:25/1:46 Having a strong core is very important. It is kind of protecting yourself. As we twisted, turned, we constantly used it. If it is not strong, then we will get hurt on it.

0:50 Triceps - We use so much triceps on our serve.

The changeover with Madison Keys

August 7, 2018

Introduction


It is five minute videos. I like to take some notes. It is called the changeover with Madison Keys.

Notes

1:25 A lot of hard work.
2:18 How much fun  to beat Serena Williams when you were 16 years old?
3:01 Pep talk: Roger, I believe in you.

First round exit interview

August 7, 2018

Introduction


It is a short study about first round exit interview. Less than three minutes from Maria Sharapova.


1:20 I need some time.
0:58 But I felt that I committed today. A lot of good things I can take away...
1:50 It takes work. It takes time. I am not afraid any of that. Being this position before.
1:55 Of course I want to do well here. That is the mentality of former champion. Some one was very competitive.
2:11 Do well, compete well, no matter what event I attend, where is. ... I love to have long stay. That is not what happened.

A 'tough day' of first round exit

August 7, 2018

Introduction


It is 10 minutes video I choose to watch. Sloan talked about after her first round exit of 2018 Wimbledon.

Notes


I like to take some notes about the interview.
5:11 Each player is different. A lot of things go into it.
5:42 what you will do?
5:53 Focus on whatever you have to focus. Get good shape.
6:28 some player changes new coach?
6:40 I think that we play very long season. No. 1 player loses, it happens. People overreact. You work on yourself. Focus on yourself. Allow yourself to have success.
7:24  Life just going on. I will play. I will have another good result. ..., Give myself best chance. Move forward. Put back my mind. If I do everything for myself, I will allow myself have a good result.
8:00   Do not hang on things too long.
8:11          What I can do next. Move on. There is a lot of pressure. Do whatever I can. Play some tennis.
8:46/10:01 Today is not my day. I wish that I can play better. It just wasnot working.
9:09/10:01 She played well. That is not much you can do.
9:24            What happened. Let us move on. It is over. You cannot take it back.


Monday, August 6, 2018

Count your key strokes

August 6, 2018

Introduction


It is such great topic for me to share. I am reaching the age over the hill. I understand how important it is for me to count my blessings.

I write coding blog and start to understand that it is also very helpful for me to answer so many questions from myself and others. Coding blog is much better to serve people compared to private chatting.

The great article


Here is the great article to read.




Change jobs and careers

August 6, 2018

Introduction


It is such a great topic called change jobs and career. I like to spend 10 to 20 minutes to read first. Here is the link. I will write down my notes here as well.


Growing your developer career: four core skill areas

August 6, 2018

Introduction


It is such a joy to receive an email and then suddenly I found that I am reading a good article. Here is the link from the code pointers.

I like the blog and it is so good to read so many topics.

My notes


Developer skills is the multiplication of four areas, fundamentals, technology and shipping experience, soft skills.

Foundation vs technology


Related to myself, I just stopped subscription of pluralsight.com and fronendmaster.com last month since I like to focus on fundamentals of computer science, algorithm and data structure. I choose to work on more on fundamentals instead of technology for the time being.

Shipping (experience)


Let me copy the list of examples here from the blog:
Importance of good logging
Risk/ value tradeoffs when adding dependencies
Long term maintainability of a code base
Value of good API design and documentation
Not over or under designing
The value of simplicity

Related to my experience, I learn how to have a good API design and documentation as a solo programmer since Nov. 2016. I started to ask questions on codereview.stackexchange.com, and got feedback on my coding style, C# language skills, and other problem solving area. Small things like English writing and make the question as simple as possible.

The value of simplicity is my top rating one. I understand how important it is for me to keep thing simple. I have to cover so many areas as a full stack web programmer, I know that my time is limited and I have to make tradeoffs.

Soft skills


For some reason, it is easy to neglect developing your soft skills at some stage. Don't fall into that trap.

I like to copy the advice from the blog, areas you should pay attention to:

Communication
  Listening
  Presentation
  Writing

Leadership
  Empathy
  Influence
  Integrity

Team work
  Conflict resolution
  Collaboration
  Motivation

Time management

Let me think about three areas related to soft skills.

I like to add a personal story here.

Learn to appreciate what you have


I like to explain to appreciate what I have, a small career holding on my hand called a programmer lasting eight years working for a Canadian manufacturer company. It takes so much effort for me to be independent, and also learn to contribute the economy through my current job, I went through so many years education and research in United States.

So many people helped me in the past, specially in United States, Florida from 2000 to 2010, I do not want to let those people down. I also like to try to do my best to contribute something in Mathematics, Science and computer science. There are so many things I like to work for and make the society much better to live and enjoyable.

“I have learned the secret of being content in any and every situation, whether well fed or hungry, whether living in plenty or in want” (Philippians 4:12, NIV). A spirit of thankfulness makes all the difference.

Sunday, August 5, 2018

Swing analysis - Madison keys forehand

August 5, 2018

Introduction

It is the time for me to learn some swing analysis from this eight minutes video. I like to learn some terms and try to improve my tennis game.



Secrets behind real interviewer

August 5, 2018

Introduction


It is my research topic this long weekend. I had over 60 interviewer experience on interviewing.io since this January 2018. And I have over 350 mock interviews and 30 minutes each time as an interviewer. Recently I experienced with professional interviewers, I learned so many lessons and will pay the lesson of my mistakes.

I like to write down some notes and will come back to look into. I may not make it sense today.

Difference is huge


I do not know why I choose this research topic. It is hard for me to write on this topic. I will write very carefully and see if it makes sense.

Professional interviewer working for giant software company may not have thousand interview experience. But those working for phone screen may have thousand experience. They know what they are looking for. They like to evaluate so many things in those 45 minutes.

There are two algorithms in 45 minutes.

20 minutes for a hard level algorithm 


Normal structure I like is to write down keywords, and write down constraints, and write down asking. And write down possible time complexity for the function I like to write, what is my target to get the optimal. And then I start to talk about brainstorm ideas. This can be easily processed with an amateur interviewer. But it may not work very well under the stress.

There are two algorithms in 45 minutes for top software programming companies.

You have to communicate your ideas instead of writing. I guess that 20 minutes for one hard level algorithm first. First five minutes is for brain storm and come out multiple ideas. And then next 10 minutes I should write code for brute force or optimal idea.

Topics to study


I like to do some study:

1. How do I find the interviewer's personality through the first two or three minutes?
2. How do I know if nervousness comes in? How should I overcome the nervousness?
3. Do not write down code if you do not have ideas. Try to push hard for one more clarification by yourself.
4. How to focus on the algorithm itself? Do not focus on what you feel.
5. What to say? Time complexity! Think about optimal solution. Talk about brute force solution first.
6. Go over one example.
7. How to follow the structure the interviewer layout for you? It is important to follow the instruction. It is different to work with amateur interviewer.
8. It is zero percentage to try to do something you like to do.
9. Need to find ways to expedite some code using abbreviation or test case handling etc.
10. It is hard to perform with professional interviewer. Expect to perform 50% of normal performance. Really train hard and work on more depths and widths for any algorithm.
11. Need to learn what professional interviewer will communicate with you. When the tip will come in, what is final and nonnegotiable.
12. Very strict on the timeline. There are some estimations for those 45 minutes. I should figure on those structures as well.
13. Why I as an experience amateur interviewer, I still have so many difficulty to perform with professional interviewer.
14. How to approach the algorithm and also work with professional interviewer?
15. What is maximum range I can go up-and-down because of impulse behavior in the interview?
Top 20% to bottom 20%. Hard level performance range?

How far I can improve 


I like to write down some notes to help me work on when I practice as a mock interviewer next 10 or 20 mock interviews as an interviewer. I know that I have so many personality weakness, in order to be a professional interviewer or get to understand better and work better with professional interviewer. I need to learn how to plan, how to prepare, how to discipline. I like to write down a list of things to check.

As a professional interviewer working for giant software company, they are more responsible and more disciplined.

1. Do not write down my personal email and name on the mock interview.
2. Try to give some instructions what to next. Learn how to guide the interviewee to next step.
3. I need to practice more as an interviewee instead of interviewer.

Follow up 

August 6, 2018 9:44 AM

August 6, 2018
It is hard to say it. I may be slow to comprehend the algorithm in the first 10 minutes. I recalled the article what to look for. Here is the article.

August 19, 2018, 11:45 PM

I have to learn to work with people, specially on algorithm and data structure problem solving. In order to stimulate good conversation and discussion, I should be well-prepared. I think that it is best for me to work on 190 easy level algorithms first, and then work on 100 to 200 medium level algorithms.

With 400 more Leetcode practice, I definitely will learn a lot of things include hard working people, how they train themselves using Leetcode, how many ideas I can come out to solve an easy level algorithm. How comfortable I am to meet a person and discuss solutions for an algorithm problems.

August 31, 2018

I study one young graduate who solved over 800 Leetcode algorithms today. Here is the profile I studied.

I need to figure out ways to solve at least 20 easy level algorithms on Leetcode.com a week.

Sept. 22, 2018

I start to play Leetcode contest, and also study Leetcode contest global ranking. I like to improve my global ranking from 14000 to top 5000 as soon as I can.

I continue to practice mock interviews on interviewing.io. I just had my fourth interview as an interviewee.

I learn how to adjust my feeling using data, Leetcode data. I have to read the data first and then figure out what I can work on.



Sept. 5, 2019

I wrote the blog after facebook phone screen back in August 1, 2018. I just could not believe what I wrote down, and there are some good ideas for me to think about again.

This year I went to Facebook onsite on August 20, 2019. I like to write down something better.

Prepare like any other interview

August 5, 2018

Introduction


It is time for me to review one of my answers on quora.com. Here is the link. I could not believe that I wrote it nine months ago.

I like to learn from tennis player Madison. How hard the tennis player train and work hard as a professional sports player.

Related to algorithm problem solving, I like to train myself using Leetcode easy level algorithm again.

Rush to work on algorithm


Last two days I relaxed and I did not write any algorithm. I will have one more holiday to spend time at home. I like to write some leetcode easy level algorithms.


More videos to watch

Madison Keys - here is the link.

2:00/5:20 save money, one purchase one bag.
3:00/5:20 one cheat meal a week - french toast. East very healthy.

2:25  Are you surprised the pro's life?
3:02 
3:10  Junior has a lot of days off. Being a pro, there is a lot of hard work. If you practice, you are doing fitness. It is very busy, but a lot of fun. 3:17
3:14  A lot of training -

3;34 Do you have any moments thinking about quitting, how do you stay motivated?
3:40 For sure every one some point has. It is one of things ...
3:49 - 3:55 How much you really love the sports. You are not out there for other reason. Just love the game. That kind of getting you out of bad place.

Any tip for junior?
4:29/5:20 Just having some fun. So many times after junior matches, I feels that it is the end of world because I lost. Now looking back on that, 4:34, it is ridiculous. I thought that.



Enjoy time to teach tennis

August 5, 2018


Introduction

I went out to play tennis around 7:30 PM, and spent over one hour 30 minutes on tennis court until dark.

It is so easy to teach two Chinese, 13 years old daughter and her dad to play tennis against the wall today. I taught them first lesson of tennis.

How to pick up a tennis ball without bending the knee?
How to hold a tennis racket using shaking hands?
What is top spin?
How to move for tennis sport? Basic tennis footworks.
How to hit tennis ball and get good sense of tennis ball?

30 minutes is such a joy to play with two beginners.



Waterloo math undergraduate program

August 5, 2018

Introduction


I went out to play tennis and had a chat with a friend. I learned something about waterloo math program for undergraduate. I like to spent 10 minutes to look into the program.

The admission is so fierce. There are over 8,000 people applying, but only around 300 are accepted.

Here is one link.

Two hours SDE skills

August 5, 2018

Introduction


It is time for me to spend two hours to watch this video called Recursion and dynamic programming. Here is the video link.




Anonymous peer coaching vs ex-coach coaching

August 5, 2018

Introduction


I like to write a blog to compare two coaching, one is 45 minutes from Tsinghua master graduate student, the second one is 30 minutes from Waterloo, anonymous one I met this weekend. One is in the city of Beijing, one is in Toronto Canada.

Anonymous peer coaching



I met the graduate from interviewing.io last Friday 10:00 PM - 11:00 PM, the interviewee time was 1:00 AM - 2:00 AM. The interviewee was very good to communicate using English. He is not a Chinese. He told me that all the students are doing is to work on algorithm problem solving and prepare for the interview. He had a lot of interviews before, at the beginning he did not do very good, after a lot of practice, he is much better. He needs to get back to practice interview again.

He recommended a book called elements of programming interview, one video site on youtube.com called SDE skills. He also showed me how he solved the problems since I was his interviewer on interviewing.io.


I did not expect to meet this Google intern until he decided to share his experience after 30 minutes mock interview. I felt so good since some one helped me to share his understanding of the algorithm I like to get more input.

Here is the showcase on my blog about this mock interview.


Ex-coach coaching


Surprisingly I got an email back Saturday evening. I got invitation to talk to ex-coach again.

I just could not believe that I had chance to get second opinion on this algorithm again called write an iterator for lists of iterators.

Here is the transcript for this 45 minutes coaching.


Three musketeers


I like to write a story similar to the famous story like "Three musketeers". How I write something valuable and make sense in 21 century.

Here is the conversation between first two musketeers (Julia and anonymous intern):
interviewing.io - August 3, 2018 10:00 PM PST - mock interviewing platform

Julia: I noticed that you are junior developer. How many years do you have experience?
Google intern: Interviewing.io saying that
Julia: Yes. Sometime it shows senior developer.
Google intern: I am graduating this year.
Julia: How do you like your interview questions? I have a lot of options.
Google intern: I like the one similar to the real one.
Julia: Let us start from easy one, and then we extended to a hard one.
Julia: I already gave this algorithm to over 10 people here on interviewing.io.

......
Julia: You are the best performer so far. I wondered how good you are. What kind of job you are looking for?

Julia: I had a coach who worked over 500 leetcode algorithms. I just finished over 100, and last two weeks I finished another 40 algorithm.
Anonymous peer: I do not like to work on so many leetcode algorithms. You are supposed to work on a subset of algorithms.


Around 40 minutes/ 60 minutes
Anonymous peer: Do you have another algorithm for the interview?
Julia: This hard level one should be good enough for the interview.

We talked about the algorithm called list of iterators design.
Anonymous peer: You should work on leetcode question with tag: design

Anonymous peer: I believed that I met you twice on pramp.com. (Julia ? is this possible? interviewing.io voice masking? no idea the voice familiar?)

Here is the conversation between another two musketters (Julia and his ex-coach):

wechat.com - August 5 8:00 AM PST

ex-coach: 你发的问题我没有搞懂。 (潜台词:把问题解释一遍, 用自己的话)


Conclusion


It is so much fun to work on one algorithm with two friends this weekend. I will take one algorithm a time, and continue to learn more algorithms in the future.



算法故事多

August 5, 2018

Introduction


The blog title is written in Chinese since I like to market more Chinese readers on my blog. The title can be translated into so many stories about algorithms.

I like to appreciate myself living in the society with so many ways to connect to each other and so many resources. 我觉得自己还是有收获的。 至少我和教练沟通比较通畅。 四十分钟我们可以把好几道难题都讨论清楚。 找到下一步训练方案。我的博客在这。

一个月时间刷四十道题。刷一年可以刷四百道题。

期待明年的夏天。

45 minutes coaching from Tsinghua coach

August 5, 2018

Introduction


It is Sunday morning 8:00 AM. I had chance to talk to my ex-coach forty minutes about a few algorithms and he also gave me his analysis. He is in the city of Beijing and I am in the city of Vancouver.

It is so surprising to have a coach and then I know what to do next. I like to write down the conversation by the time.

Time line

8:00 - 8:10
I described the algorithm called to define an iterator for list of iterators. He said that he did not really understand the problem, so I explained the problem to him. There are two possibilities, one is all lists are sorted, second one is not sorted. If all lists are sorted, then define a minimum heap. If all lists are not sorted, then put everything in the minimum heap. The time complexity should be nlogm, n is total nodes in all lists, m is number of lists.

He said that if the list is not sorted, it can be sorted using in place, like quick sort as well. ( I like the idea and did not think about it at all. )
你也可以把一个 iterator 排好序, 用 inplace, quick sort.

I told him that I studied the algorithm one day before, called Merge k sorted lists in Leetcode.

The coach said that you have to calm down, work on more Leetcode easy level algorithm. You can finish 40 algorithms in one month (July 10 - August 5), one year you can finish 400 algorithms. Overall, if you do not practice enough, you will be nervous, or all kinds of problems.

Julia: 我感觉紧张。 我照你说的去做, 刷了四十道题。 二道题都在里面。
Coach: 刷题没有刷够。 就会出各种问题。 就像高考, 你没有考好。 不是再考一次, 应该准备一年, 基本功练好。 中国人就只能刷题。
Coach: 你现在一个月刷了 40 道题, 一年就能刷400 道题。你可以写邮件要求第二次,但是只看现场表现。
Julia: 刷题感觉累。 周六就刷了五道题。
Coach:不能赶速度。 有时候我刷题也感觉累。 动脑太多。

8:10 - 8:20
我开始讲bad version 这道题。 我想用数值, 提醒用数组, 预处理就用了时间 O(N). 我用了二个变量, 好的和坏的version。 用二分法, 找中间值。 如果是坏的, 看左边的邻居是好还是坏。
这道题从开始到结束就用了20分钟。 我就没有给机会回到第一道题。 不停地提问题。

8:20 - 8:30
我开始讲 infix expression to construct binary expression tree. 用堆栈来做。(1+2), 把(1+2推进栈, 碰到), 开始出栈。
其实我想拿一部分分数, 没有用堆栈。不管如何,用堆栈。postfix 用堆栈。但是infix也是可以用堆栈, 你自己多用几个左右括号,就自己搞定规则。

coach: 可以转换成 postfix expression.
Julia: 不用转。 直接用堆栈。 反正用多余的左右() enforce priority. 多余的左右() 便宜。

8:30 - 8:40
Julia: 我开始讲刷题把一个BST转换成链表。 我开始把左子树换成链表, 连到右子树链表。 花了一个小时。 通不过。 换一种思路, 用二个变量, 前一个和当前, 五分钟写出来。 觉得不对, 把第一个思路做通。 用中序做了, 想想后序也有可能做通。
coach: 刷题把几种思路都做了。 有时刷了100道, 其实就刷了10道。 你把多个思路都刷了, 下一道就可能有同样的思路。

Julia: 我觉得这次刷四十道题, 刷出兴趣来了。 以前刷题少, 因为没有体会到乐趣和好处。 还有就是刷题好的多的, 就不在朋友圈里。


Julia: 我又讲一道难题, 一年前刷了, 几个月前又研究了, 写了十个博客。各种想法。 结果还是不会做。 这次我就记住一个例子, 自己解释如何用这个例子, 解释如何除去多余括号。链接在这:去除多余的左右括号。

Julia: 我还在做面试, interviewing.io, 我最近碰到一个Waterloo本科生, 做过二次谷歌实习。他解题就比较有策略。把问题弄清楚。

Julia: 我沟通问题, 一问一答。我有时回答问题。接着说。
coach:这个不好指导。只能靠多刷题。 题目见的多了,自然就会轻松应付。

Saturday, August 4, 2018

40 algorithm two weeks drill

August 4, 2018

Introduction


It is two weeks Leetcode easy level algorithms drills. I had the drill from July 10 to July 31, and then I had chance to work on more than 40 algorithms, most of them are easy level, a few of them are hard level. All two algorithms asked in 45 minutes was in those 40 algorithms.

My research topic is why I still fail to answer the first one. How should I learn to cover my nervousness first a few minutes on the algorithm?

Here is my github folder including all my practice. Here is the blog about the algorithm I practice in July 30. 2018.


Possible reasons


I think that I should be able to explain why I am selected first. And then I should stay confident and perform the best I can.

The algorithm is called merge k sorted lists. The time complexity is lowered down by apply master theorem, divide and conquer. The minimum heap is same time complexity using merge sort to solve the algorithm called merge k sorted lists. I was asked this algorithm more than three years ago by another company as well.

I should learn to define several options first, preprocessing allowed/ not allowed, one iterator has to be called using HasNext or Next, extra space should be used or not, how big the space can be allowed, space O(1) or O(N), define a few variables in the problem and try to estimate possible upper bound of the algorithms.

Actionable Items


I like to have another two weeks drills, work on Leetcode easy level algorithms.

I need to do research how to approach a problem I have not seen before. The interviewer also tries to identify if you see the problem before. Next time I should be happy because I have not seen the problem before. Right now it is the perfect for the interview algorithm. Choose not to be nervous instead of happy. Just apply normal analysis I can and then use some kind of structure to approach the problem.

Follow up


August 5, 2018 10:08 PM
一道题有很多解法。 iterator其实就是一个单链表。
可以从时间复杂度讲起。

HasNext O(1) -> O(m)
Next -> O(1) -> O(logm) -> O(m)



The 30-minute guide to rocking your next coding interview

August 4, 2018

Introduction


It is the article for me to read advised by the interviewee I met on August 3, 2018 10:00 mock interview. The interviewee is so good to share the information, since I was the interviewer, and I will definitely recommend him to next round. I was served so well by a former Google intern, waterloo undergraduate new graduate.

Here is the article link. I like to write down some note here.

Software engineer vs domain experts


One statement is the following:

At companies like Facebook and Google, the people are software engineers first, domain experts second.



How to break the ice on algorithm problem solving?

August 4, 2018


Introduction


It is the first ten minutes and then I have chance to break the ice with the interviewer and get warm up the algorithm I have to work on. Since it is top ranking software companies, usually the first one is hard level. How to break the ice? I like to write something related to this topic.

One idea


I like to promote the idea to enumerate what variables in the problem, and how many possible time complexities for the solution? Which is optimal one? How can we lower down? Do we have limitation of time and space complexity? What is upper bound?

One algorithm as an example


Let us give the algorithm called "write an iterator for list of iterator with HasNext and Next two methods interface". We can denote that there are n list, maximum length of lists is m, and then let us try to use those variables to define Hasnext, Next time complexity. What should we target for the optimal one?


Stay open


It is much better to stay open when I have to write some code. Even if I do not know what I should write, I just ask one more question before I write the code. I have to give myself last chance to clarify the problem. I always forget to use data structure, extra space to exchange time for optimal time complexity. Queue, stack, heap or binary tree, what ever. It is always to scan through the list and find one to apply.

Do not write code until you have an idea how to solve the problem? I should say that please wait one more minute to let me think about the idea.

Do not be shy, and just say it. And also say that do not worry. The idea is more important compared to write the code.

Do check the time. First algorithm I should have at least twenty minutes. I will have time to write if I come out the good ideas.

Tell the interviewer I will have this structure. Go over keywords, and then write down what is asking. And then go over possible time complexity. And then brainstorm the ideas to solve the problem.

It will take a few more minutes but it is necessary in order to find the optimal solution. No rush to write the code.


Most efficient way to gather the nuts and deposit it at a tree

August 4, 2018

Introduction


It is one hour video related to the algorithm called most efficient way to gather the nuts and deposit it at a tree. Here is the link.


Sliding window minimum

August 4, 2018


Introduction


It is the mock interview algorithm I gave to the interviewee. The interviewee went through several steps and then I like to document the discussion, one of his ideas is related to Binary search tree, and we had discussion about time complexity of delete a node in BST.


Sliding window minimum


I like to talk about things I learned from his analysis of sliding window minimum algorithm.

The problem statement I wrote is here.

Here is the transcript to show the algorithm to get range sum using dynamic programming.

Extended algorithm is to get the minimum value of the sliding window.

The interviewee had two Google intern experience, and he is just a new graduate. I like to share his transcript. 

Iterator for list of iterators

August 4, 2018


Introduction


It is the discussion in the mock interview with a peer who had two Google intern experience. He did very good explanation on his understanding of the algorithm called iterator for list of iterators. 

Discussion detail



We did talk about the iterator, and what is size of minimum heap? If all iterator's lists are not sorted, then the minimum heap will load all elements into heap or binary search tree.

Here is the discussion of transcript. The main idea is that all lists are sorted then it is easy to use a minimum heap with size of count of iterators. If all lists are not sorted, all elements in all lists can be put into the list first.


C# Minimum heap using SortedDictionary

August 4, 2018

Introduction


There is no C# class like Java PriorityQueue for minimum heap. I learned to write a minimum heap using SortedDictionary since I read the source code to study the problem solving of the algorithm called Merge k sorted lists recently.

I like to write a blog to document my experience.


Source code 


Here is C# source code to write a minimum heap using SortedDictionary. Also the folder is here to access my practice for the algorithm 23 Merge K sorted lists.


Challenge 



Here is the fact:

Julia, you spent 10 rounds of mock interviews from March 2017 to June 2018. You could not come out using SortedDictionary to write a simple minimum heap for K messed sorted array algorithm.

Give a few arguments to defend yourself:
I do not spend time to read SortedDictionary source code.
I do not know how SortedDictionary class is designed, why it is needed.
I do not try to memeorize all APIs from SortedDictionary.
I do not have chance to read the code using SortedDictionary to solve the problem.
I did search why C# does not provide PriorityQueue like Java, but I do not find alternatives with source code using SortedDictionary. 
I got so many choices to continue to study and improve. I just move on other problems to solve.


Give a few advice how to break through the problem:

Please provide a possible three solutions you can approach to come out a written solution like using SortedDictionary.


Follow up


March 26, 2019

I reviewed the solution written for union find algorithm, and then I will write new version using SortedDictionary as well.

Here is the folder to contain my practice.

Here is the union find algorithm using SortedDictionary

Follow up 


June 4 2020
I like to work on 215 Find kth largest element in the array using SortedDictionary. The idea is to write a solution using minimum heap.


SDE skills - bytes and nybbles

August 4, 2018

Introduction


I was advised to watch the video on the website. Here is the link.

First video 


Here is the first video I choose to watch.




leetcode 450: Delete Node in a BST

August 4, 2018

Introduction

It is the medium level algorithm. In my last mock interview, the interviewee talked about using BST and we had discussion what is time complexity to delete a node in BST. Here is the blog about mock interview.




Tell a friend to tell a friend

August 4, 2018

Introduction


It is a good idea to join interviewing.io for mock interview practice. I choose to be an interviewer on the platform since this January, 2018, I have more than 60 mock interviews as an interviewer. It is so nice to get on the platform and meet and talk about algorithms. Tell a friend to tell a friend is the title of my blog.

It is most rewarding job to be a mock interviewer. I like to showcase one of my mock interview as an interviewer here.

One showcase


Yesterday I had chance to interview a new graduate from Waterloo,  and I learned from his performance how good he can perform. He enjoyed the multiple solutions and then took hint to go for the optimal solution based on minimum sliding window.

After we finished 30 minutes interview, I talked about my favorite algorithm last 3 days. He gave me his analysis, such great sharing.

Sharing feels so good 


I like to take some time to write notes for this mock interview 60 minutes. I had recording, transcript, code. I like to document how good it should be. I will work hard to get myself there. It is on interviewing.io, we do not choose to share the video as showcase this time.

The peer does not advocate too much to practice a lot of Leetcode algorithms. Just work on basics subsets of problems. I can tell from his talking and analysis and he has good talent. Of course, he can improve a lot in terms of coding and other things if he invest a lot of time to complete a lot of Leetcode algorithms.

Sliding window minimum


I like to talk about things I learned from his analysis of sliding window minimum algorithm.

The problem statement I wrote is here.

Here is the transcript to show the algorithm to get range sum using dynamic programming.

Extended algorithm is to get the minimum value of the sliding window.

Here is the blog with more detail, I will work on and make it complete.


Second algorithm - Iterator for list of iterators 



We did talk about the iterator, and what is size of minimum heap? If all iterator's lists are not sorted, then the minimum heap will load all elements into heap or binary search tree.

Here is the discussion of transcript. The main idea is that all lists are sorted then it is easy to use a minimum heap with size of count of iterators. If all lists are not sorted, all elements in all lists can be put into the list first.

Here is the blog I wrote for the discussion.

The advice from the interviewee


It is better to study leetcode by the tag called design. Here is the link.

Two more links:

//https://www.youtube.com/channel/UCPumyEKs86w-GtWDd2XQYtg
//https://www.youtube.com/channel/UCDHkPnEcrEf3B9-isB4jXIw

Learn dynamic programming

I chose to learn dynamic programming using Leetcode 10: regular expression matching over 10 round of mock interviews.

The interviewee suggested me to work on 10 dynamic programming on elements of programming interview, and then work  on easy level dynamic programming on leetcode.com

Summary


I had chance to meet a strong undergraduate student on mock interview. I learned from his performance. We had discussion over one easy, two hard level algorithms. And also we had exchanges of ideas how to work on interview, and how to prepare.

One of statement May be an argument or fact:

Waterloo undergraduate computer science students, all they do are working on algorithm problems and prepare for interview.


References


Feedback from the interviewee


Interviewer feedback


Friday, August 3, 2018

Leetcode 23: Merge k sorted lists

August 3, 2018

Introduction


It is a hard level algorithm called Merge k sorted lists. I could not believe that I had to learn the algorithm again in such a short time. I spent over 30 minutes to study one of Leetcode discussion and wrote first time using SortedDictionary to implement C# minimum heap.

My practice


Here is my C# practice of the algorithm called Merge k sorted lists.


Related algorithm


I spent 30 minutes to rewrite mock interview algorithm called K messed array using minimum heap. It is so excited to learn how to write a minimum heap using C# using less than 20 lines of code.

Here is the algorithm code written for K messed array.


100-hard level algorithms 2018 summer campaign


Here is the hard level algorithm folder. I like to document the learning of the algorithm.


Challenge 

Here is the fact:

Julia, you spent 10 rounds of mock interviews from March 2017 to June 2018. You could not come out using SortedDictionary to write a simple minimum heap for K messed sorted array algorithm.

Give a few arguments to defend yourself:
I do not spend time to read SortedDictionary source code.
I do not know how SortedDictionary class is designed, why it is needed.
I do not try to memeorize all APIs from SortedDictionary.
I do not have chance to read the code using SortedDictionary to solve the problem.
I did search why C# does not provide PriorityQueue like Java.
I got so many choices to continue to study and improve. I just move on other problems to solve.


Give a few advice how to break through the problem:



Please provide a possible three solutions you can approach to come out a written solution like using SortedDictionary.


Wednesday, August 1, 2018

Morris traversal review

August 1, 2018


Introduction


It is the most classical traversal using O(1) space called Morris traversal. I had a discussion with a friend starting from 8:30 PM and then we discussed the algorithm more than 20 minutes.

Here is the transcript.

I also like to review one of blogs I studied a few years ago. It is written by a facebook engineer in Chinese. Here is the link.


Tuesday, July 31, 2018

Summer is the great time

July 31, 2018

Introduction


It is my turn to congratulate my two classmates to become computer science department head this year. I cannot believe how hard people are working and then make such great career success.




Being an interviewer is such great experience

July 31, 2018

Introduction

It is so interesting to know that I start to change quickly once I start to work on as an mock interviewer this 10:00 PM. I took longest break after 2:00 PM, and I let myself enjoy youtube music from 5:00 PM to 8:00 PM three hours.


Summer is such great time for a programmer

July 31, 2018

Introduction


I like to do a small research titled "Summer is such great time for a programmer". I have experienced so many great things this year, I just could not believe that the world can be so connected and every time I like to reach out the world, I got response.


Follow the procedure 


I learn to be patience for my personal growth on algorithm and data structure problem solving. Every time I have real time experience, I learn that it is so important for me to calm down, and get into the problem solving first. After those one hour, I need to quickly get out and go back to hard working and  training on data structure and algorithms.

I can tell there is something missing in my training. I have to listen carefully and also follow the advice.





Need an excuse

July 31, 2018


Introduction


We will have a get-together in the city of Vancouver this Thursday with our college statistics teacher who taught us Probability course. I still remember the time he gave us a coaching session how to work on probability. He was our probability teacher when he was only less than 25 years old, we were math undergraduate students in Shanghai Jiaotong university.

It is time for me to meet the statistics teacher back in 1985, over 33 years ago with my two other classmates of Shanghai Jiaotong University this Thursday. We three of us are in the city of Vancouver, and we will meet our teacher, who is department of head of Statistics department in the Connecticut ranking 44. Here is the link and here is the professor link.

I like to write a blog about "Need an excuse", since I try to give myself 20 minutes therapy to talk about how mathematics teaches us to prove things. I like it as an excuse to help myself out today.

Why I need an excuse?


I have to learn to take risk and then solve given problem in less than 15 minutes; most of important I have to quickly identify what are my concerns. In order for me to do that, I need to communicate with the peer what my concern is, how to get into the success of problem solving.

The problem is that my object-oriented programming skills is kind of weak; and then I have to relate to iterator to sorting. I did not question that every lists are sorted and will be iterated on. I need to get the sorted list based on multiple lists, merge a sorted list based on multiple sorted lists.

So many things are under my investigations. I did not come out what problem I should solve in first 15 minutes.


If one of lists is not sorted then the whole plan will be problematic


My argument is if one of lists is not sorted in ascending order, then the whole plan will not work.





Talk about money and confidence

July 31, 2018

Introduction


Money and confidence can be talked together. How will I make a story to connect the dots?

Here is the summary. Stock market is all about confidence. I like to write a blog about it. I also like to talk about economy, immigrant, backup plan, Canada, Canadian.

It is time for me to relax after two weeks drill about algorithm and data structure training. I like to get messy about the blogging, add some spice about my blog. Money is such a great topic, if I can master how to make good friends, keep good relationship at work, and get along with young generation in my family, all I need to learn is how to make a lot a lot money.

Up-And-downs


I did check USA most popular zillow website last Satuday, since I am the owner of a small condo near Florida Atlantic university. I slowed down my training and put together all the paper work. I suddenly realized that USA economy is heading so strong I never imaged before, I did not know what is going on there.

My zillow.com web page shows that last 12 months the sales of condo goes up a lot in total asking price. $50,000 us dollar in one year. I cannot take it too seriously since it goes up and down a few times already last 20 years.


What-if


I still could not believe that I sold all the stocks I hold in 2008 since I could not handle so many things if I can not settle down a corner in the earth. At that time, I was searching the whole world where is my next destination.

I had a very good friend starting from 2006 who gave me lesson how stock market is the confidence. For me it is not easy to understand her teaching. She worked for a wall street firm and we worked so closely together for a few projects.

I remembered one time in 2009 she decided to vote with her husband, her family will give me 100% support for me to go over the paper work of immigration, and share her past experience. I have to file a lawsuit to reopen my immigration case...

Every immigrant and family in United States has their own story, they back up so many plans in order to make it succeed in United States. Canada is their backup plan. Canada immigration is easy case for them. Usually they get first and land first. I decided to go for Canada option.

My friend gave me encouragement, just think about travelling to Canada for a tour, and visit different people and have a different life.

What if I have confidence on the stock market, specially on Amazon, Facebook, Microsoft. In 2008 I already got phone screen from Amazon and I knew that people are so hard working since I was asked if I graduated from computer science Ph.D. degree.


Confidence


I try to apply confidence concept in my software programmer pursuit. What is confidence? Why I will have scare? When I deal with the new task or new project related to coding?

Last time I talk to myself that I need to bring a coach to work, and this time I tell myself that I can do it all by myself.


Serve the best 



I could not believe that I am in strong economy in Canada over last eight years. I do not know how business works. I try to focus on algorithm and data structure basics.

Proverbs 30: 7 - 9

Two things I asked of You,
         Do not refuse me before I die:
8Keep deception and lies far from me,
         Give me neither poverty nor riches;
         Feed me with the food that is my portion,
9That I not be full and deny You and say, “Who is the LORD?”
         Or that I not be in want and steal,
         And profane the name of my God.

Leetcode 314: Binary tree vertical order traversal

July 31, 2018

Introduction


Image that you only have five minutes for one algorithm, what I do is to read the explanation written in Chinese. Here is the blog for the medium level algorithm called Binary tree vertical order traversal.

My note in Chinese 


这道题让我们竖直遍历二叉树,并把每一列存入一个二维数组,我们看题目中给的第一个例子,3和15属于同一列,3在前,第二个例子中,3,5,2在同一列,3在前,5和2紧随其后,那么我们隐约的可以感觉到好像是一种层序遍历的前后顺序,那么我们如何来确定列的顺序呢,我们可以把根节点给个序号0,然后开始层序遍历,凡是左子节点则序号减1,右子节点序号加1,这样我们可以通过序号来把相同列的节点值放到一起,我们用一个TreeMap来建立序号和其对应的节点值的映射,用TreeMap的另一个好处是其自动排序功能可以让我们的列从左到右,由于层序遍历需要用到queue,我们此时queue里不能只存节点,而是要存序号和节点组成的pair,这样我们每次取出就可以操作序号,而且排入队中的节点也赋上其正确的序号,

Quick sort technique study

July 31, 2018

Introduction

It is time for me to review the algorithm using quicksort technique. Here is the gist.


Leetcode 40: combination sum II

Leetcode 47: permutations II

Leetcode 46: permutations

Leetcode 90: subsets II

Leetcode 78: subsets

Monday, July 30, 2018

378. Kth Smallest Element in a Sorted Matrix

July 30, 2018

Introduction


It is a medium level algorithm and I think that I worked on the algorithm a few times before. It is better for me to write one and try it using Leetcode online judge.


Leetcode 39: Combination sum

July 30, 2018

Introduction


It is a medium level algorithm called combination sum. But I felt that it is so hard to come out a solution with well-defined time complexity. All I can think about is brute force solution. I like to sort the candidate numbers and then brute force minimum value in the combination sum.

I have the idea but how to write a workable code. I really think about getting general ideas about the algorithm.

It is time to look into Leetcode discussion related to the algorithm. One of C# solutions is here to study.

My practice


I also like to write C# code this time to learn the algorithm again. I also wrote some analysis in the code, I like to help myself to understand the algorithm better this time.

Here is C# practice code in July 2018.

Here is C# practice code in June 2017.



My goal of research 


I came cross this algorithm last night, and I did spend over 10 minutes to think about the algorithm. I could not believe that I wrote a solution just one year ago. I was nervous, and I thought about a few things. I asked myself what is brute force solution. Let me sort the candidate first. What is the minimum number in combination? Can we brute force on this minimum number? How many steps to take to calculate all possible choice for a combination?

In order for me to get comfortable on the algorithm problem solving, I did look into and answer the question when I practice this time.


116. Populating Next Right Pointers in Each Node

July 30, 2018

Introduction


It is a medium level algorithm. I like to think about the algorithm using 10 minutes.


Algorithm review II

July 30, 2018

Introduction


It is time for me to read some algorithms and also read a facebook engineer's notes about algorithms. Here is the link.


Algorithm review

July 30, 2018

Introduction


It is time for me to go over the notes again. Here is the link.

Leetcode 44: wildcard matching

July 30, 2018

Introduction


It is a hard level algorithm called wildcard matching. I like to review the algorithm. I also like to think about an extended algorithm based on wildcard matching.


Say goodbye to another weekend

July 30, 2018

Introduction


It is 12:34 AM and I like to call it a day, and ready to go to sleep. I like to write down something here to document this weekend for my algorithm practice.

You do not practice, you do not deserve to win. Andre Agassi

Leetcode 23: Merge K Sorted Lists

July 30, 2018

Introduction


It is hard level algorithm and I like to review the algorithm. I like to review the topic and get the idea what to work on next. Here is the blog.

Based on one in 2015



What I did is like a teacher to help a student, and review her home work after more than two years. Since my last practice is two years 11 months ago, it was August 2015.

1. One sample test case is added from line 26 to line 50.
2. The code is reviewed and make it more readable.
   The merge of two lists is in place. The result will be saved in one of lists. So no extra space is needed.
3. The desgin of function MergeKLists is added in the comment. The main idea to apply master theorem to beat the time complexity of naive approach O(n * k * k), the optimal time complexity is O(n * k * logk).
4. Line 91 variable name is called dummyNode to remind me to go to next one to return at the end of function.
5. add two pointer technique, and write comment to help understand two pointer technique to merge two linked list.
6. edge case handling - it is to append to unfinished linked list to the first list. No need to create a new node and copy the value.


Here is C# practice in 2018 with optimal time complexity.
Here is C# practice in 2015 with optimal time complexity.
Here is the brute force solution - O(n * K * K) - not optimal time complexity, written in 2015

Here is the blog I wrote in 2016 for the practice of Leetcode 23: merg k sorted lists.




Sunday, July 29, 2018

Leetcode 87: scramble string

July 29, 2018

Introduction


It is hard level algorithm called scramble string. I like to review my past practice, and then write a C# solution if I have time.

Here is my last practice. I have not submitted any solution yet.


My practice


I just quickly reviewed the code I studied more than two years ago, and then tried to submitted them using online judge. I will catch up more in the detail later.


recursive solution is here.

dynamic programming solution is here.





Leetcode 97: Interleave string

July 29, 2018

Introduction



It is hard level algorithm called interleave string. The algorithm can be solved using dynamic programming. I like to take 10 to 20 minutes to write the solution for the algorithm.

Also, I start to watch the video from basketballwangcoding, I like his teaching.

Here is my practice using C#, based on dynamic programming.

Leetcode 105: construct binary tree from preorder and inorder traversal

July 29, 2018

Introduction


It is a medium level algorithm. I like to write code for the algorithm.


My practice


I spent over one hour to debug the code and ran into index-out-of-range error, and I finally fixed all the issues.

Here is my C# code.

Leetcode 337: House robber III

July 29, 2018

Introduction


It is the medium level tree algorithm called House robber III. My learning experience covers a few areas. I chose to listen video lecture, and also I read some blogs related to the algorithm, one of blogs I read is served by grandyang.

I spent time to work on the video served by basketwangcoding, and I like to get some help from his lectures.

Plan to write C# code for House robber III.

My practice


Here is my C# code which is verified by Leetcode online judge.


New attitude


I understand that it is very important for me to submit as many algorithms as possible on Leetcode. So I slowed down everything and wrote a solution after I spent over 30 minutes to learn from video teaching from a Facebook engineer and also blog reading.

Algorithm training should be a science, I should understand the idea how to solve the problem first, and then also need to 100% follow the idea by applying my code against online judge.

What is science?


follow up on July 31, 2018
Do  not spend too much time to read the algorithm, once I understand the idea, I should move on the implementation. How quick I can write, how complete solution I can come out to cover the problem? How to find edge case, interesting subproblems through online judge.

I am training myself to be a good programmer.

Leetcode 213: House robber II

July 29, 2018

Introduction


It is the medium level algorithm called house robber II. It can be solved using dynamic programming and also house robber I algorithm can be applied to the algorithm as well.

My practice


Here is my C# practice.

Leetcode 112: Path sum

July 29, 2018

Introduction


It is an easy level tree algorithm called path sum. I spent 18 minutes to work on the algorithm.


My practice 


Here is my C# code.


Saturday, July 28, 2018

Leetcode 111: minimum depth of binary tree

July 28, 2018


Introduction


It is an easy tree level algorithm called minimum depth of binary tree. I like to consider two ideas, one is to use breadth first search and then shortest path and then terminate search early. Another one is to use recursive function to do depth first search, to prune the search, if the current depth is bigger than minimum depth found so far, then current path should be terminated.

My practice


Here is my C# code. My first practice failed on one test case. My base case is wrong. I should consider the base case with a node not null, but left child and right child both are null. Null node should not be considered as a base case.




weekend planning - 80 facebook algorithms on Leetcode.com

July 28, 2018

Introduction


It is time for me to make my summer weekend special one. I choose to work on facebook algorithm 80 of them on Leetcode.com.

I will plan to work on a few hours based on the list of algorithms

Here is the list I prepared before.