Thursday, June 21, 2018

Day four - hard level algorithms

June 25, 2018

It is time for me to read hard level problems 10 algorithms a time. I just could not believe that I will read the problems first, and come back any time if I like to think about more how to solve them.


716
Max Stack    
36.9%Hard
719 27.7%Hard
726 43.4%Hard
727 31.2%Hard
730 35.4%Hard
732 49.6%Hard
736 41.9%Hard
741
Cherry Pickup    
24.1%Hard
745 26.0%Hard
749
Contain Virus    
40.3%Hard

Day three - hard level algorithms

June 25, 2018

It is time for me to read hard level problems 10 algorithms a time. I just could not believe that I will read the problems first, and come back any time if I like to think about more how to solve them.


753 40.8%Hard
757 35.1%Hard
759 53.3%Hard
761 43.5%Hard
765 48.3%Hard
768 43.4%Hard
770 42.5%Hard
772 40.4%Hard
773 46.3%Hard
774 33.0%Hard

Day two - hard level algorithms

June 25, 2018

It is time for me to read hard level problems 10 algorithms a time. I just could not believe that I will read the problems first, and come back any time if I like to think about more how to solve them.

778 44.6%Hard
780 24.0%Hard
782 37.4%Hard
786 32.7%Hard
793 41.8%Hard
798 33.4%Hard
803 22.8%Hard
805 20.4%Hard
810 38.6%Hard
815
Bus Routes    
32.5%Hard

Day one - hard level algorithms

June 25, 2018

It is time for me to read hard level problems 10 algorithms a time. I just could not believe that I will read the problems first, and come back any time if I like to think about more how to solve them.

818
Race Car    
27.2%Hard
827 40.8%Hard
828 33.6%Hard
834 31.5%Hard
839 34.7%Hard
843 33.8%Hard
847 39.6%Hard
850 42.0%Hard
854 29.4%Hard
857 38.4%Hard

A new drill - 10 hard level algorithm on Leetcode every day

June 21, 2018

Introduction


I have to invent some drill to push myself to expose the hard level algorithm on Leetcode.com. One thing I can do is to read 10 hard level algorithm every day, so one week I can finish all hard level algorithms.

I do not need to write code for each hard level algorithm. I just need to read the problem statement, and think about it. That is all.


Goal


My goal is to quickly identify that it is hard level algorithm. When the problem comes out, I can quickly identify it as a familiar problem.

Try to invent something to help myself.


Time to play trick

June 21, 2018

Introduction


As a player to work on data structure and algorithm, I know a lot of issues related to the hard work. I do not get enough social skills when I try to improve coding skills. Sometimes I cannot control my mind very well since I will think about some one unexpected in the past.

A new drill is designed today to train my brain to focus and stay on the ground. One thing I like to do is to memorize all top 50 WTA players, and then choose three of them, do some research how they advance themselves to top 50 ranking.

Here is the ranking web page.

Three players please


I plan to study three players.

Ranking No. 6 Carolina Garcia with her father, coach Louis Paul Garcia


Time to work on github

June 21, 2018

Introduction


It is time for me to be a good and faithful person as a github user, I try to be a writer on github. I can tell a few difference to publish on github compared to publish on blogger.

It is easy to work with other software programmer on projects, source code on github, people are doing that.

When to notice


I notice that cheat sheet is found on github and it is such a nice one. I wrote a blog on data structure cheat sheet on June 14, 2018. I noticed that one of authors is also an engineer from facebook.

How to perform best onsite on algorithm?

June 21, 2018

Introduction


It is true that I have over 300 interviews last 12 months. But in terms of real one, I understand that I only have one this year. How to push myself hard to come out a solution for those 20 minutes?

Think about scalability


It is wise to follow the hackerrank contest format. Set up time limit to 3 seconds, set up upper bound for those given variables, for example, sort a array in two dimension, I can talk about Rows <= 1000, Cols <= 1000, or given 1000,000 instead of 1000. And then I like to target the time complexity based on Rows * Cols, linear or power of 2, preprocessing time for those number, what is space minimum I need. Calculate one in terms of MB. Usually hackerrank space is limited to 300MB.

Try to guess what is limit? Ask and then figure out possible upper bound of time complexity.

I think that will be good start for an onsite and real top one software company.

I stopped playing hackerrank since November 2017. I totally forget those painful and long hours I have worked to try to gain extra few points to scale the problem. I will give one example here later on.

Get organized


Last few days I tried to get organized and checked in past contests into github, I like to review C# code I write before. And then I notice something missing in my daily practice last 8 months. I focus on soft skills, but I lose the desire to scale the algorithm problem.


Follow up 


March 28, 2019

I like to try the idea to work on algorithm problem solving 90 minutes every day. And I like to see how many problems I can solve in one week.

Another thing is to solve all 24 union join algorithm on Leetcode.com first. I need to push myself to learn and work on algorithm daily.

Another thing I can try to do is to get involved in video creating for the algorithm.

Another thing I can try to push myself is to complete another 100 algorithms before June 6, 2019. I like to celebrate one year Amazon onsite with Leetcode solved problems 470 or 500. I think that hard working is most important part of my life.


Hackerrank - practice - problem solving - hard - algorithms

June 21, 2018

Introduction


It is time for me to get organized. I like to check in all my practice on hackerrank.com into github. I did solve 3 hard level algorithms.

Hard level

Matrix layer rotation
Reverse shuffle merge

Medium level


Sherlock and anagrams
Connected Cells in a Grid
Even Tree

Easy level 

Intro to Tutorial Challenges
Pangrams
Funny String
Gemstones
Alternating Characters
The Love-letter mystery
Palindrome index
Anagram
Making angrams
Game of thrones - 1
Two strings
Sherlock and array


It is also a good idea to review the code I wrote 2 years ago. It is so exciting to read the code I wrote two years ago. 

Will come back to write more here. 


Tangible goals

June 21, 2018

Introduction


It is time for me to set up some tangible goals. I like to learn something and also prepare for more challenging things.

Tangible goals


1. Solve a few algorithm and gain 200 points on hackerrank to get a gold badge. I need to get 800 points.

2. Play a contest on hackerrank and try to get a medal.

3. Play some sports and lose 4 lbs in next 30 days.

4. ...

Wednesday, June 20, 2018

Informatics olympiad

June 20, 2018

Introduction


It is a normal day until I come cross the algorithm I worked on before. I was amazed about editorial note, and writer's profile. So I decided to do a small study on the player. The first time I learn how good a informatics olympiad player can be.

Here is the article about hackerrank profile I study today.

My argument


It took me more than 12 months to get my first Gold medal on week of code 33. And then I had hard time to get medal again. It takes me so many hours to work on those algorithms for week of code.

I just could not believe that the algorithm problem solving can be so easy for the informatics olympiad player.

Time to get back on Hackerrank contest

June 20, 2018

Introduction


It is time for me to work on hard level algorithms on hackerrank. I can choose some algorithms I worked on the contest before. I like to get motivated and understand how difficult the algorithm can be in terms of scaling.

I spent half hour to write an algorithm and I just could not believe that I love the algorithm and it can be so easy.

One algorithm a day


This is my algorithm for the day. I wrote some code to figure out how to design API based on given classes and one API.

Here is the transcript. Let us call the algorithm sorting problem in two dimension array.


Bonetrousle

June 20, 2018

Introduction


It is such a great idea to go over all hackerrank contests I played last two years, and review the algorithm. Today I came cross this algorithm called Bonetrousle, I wrote more than hundred lines of code, but score 0. It is time for me to study Editorial note, and then write a correct solution.

Very good suprise


I like the learning from the editorial note. I could not believe that I had chance first time to check code writer's profile. I could not believe that the person has such great performance, and he is ICPC team.

Specially I like the quote he shares on his profile.

Don't beat yourself up, no need to run so fast, sometimes we come last, but we did our best.

It is a medium level algorithm, and it is related to loops. I plan to work on the algorithm again. 

summing pieces - dynamic programming

June 20, 2018

Introduction


Life is not easy for a software programmer.  Since it is hard to master data structure and algorithm. Technology is updating so fast, I try to make my work very easy for me to handle.

I notice that I need to get organize and check in all algorithms I wrote into github. I came cross one algorithm, one editorial note, one hackerrank profile. It inspired me so much.

Here is the algorithm called summing piece. I wrote complicated code in the contest.

Here is the editorial note with some math, my favorite part.

I plan to write a dynamic programming solution for the algorithm.



Linkedin profile update

June 20, 2108

Introduction


It is the first time last 5 years I updated my linkedin profile. I just added some projects to my linkedin profile, and also updated my twitter account.

Projects added


I added a few projects I did last two years, mock interview, code review, hackerrank, quora.com writer.

Here is my linkedin profile for your reference.


Tuesday, June 19, 2018

Leetcode 632: Smallest range

June 19, 2018

Introduction


It is a hard level algorithm called Smallest range. I like to spend 10 - 15 minutes to read the problem statement first.


Monday, June 18, 2018

Leetcode 239: Slide window maximum (series 10 of 10)

Leetcode 239: Slide window maximum (series 9 of 10)

Leetcode 239: Slide window maximum (series 8 of 10)

Leetcode 239: Slide window maximum (series 7 of 10)

Leetcode 239: Slide window maximum (series 6 of 10)

Leetcode 239: Slide window maximum (series 5 of 10)

Leetcode 239: Slide window maximum (series 4 of 10)

June 18, 2018

Introduction


It is time for me to calm down and play with one algorithm with more detail.

Here is the discussion I like to study. And here is the blog I like to read and write down my study notes.

I just quickly copy the statement from the above blog:

Given an array of element a0, a1, a2,..., and queries Q(i, i + L) which means "find the minimum element in ai, ai+1, ai+L". How can we answer such queries efficiently?

We can have an O(nlogn) complexity by using a minimum priority queue, RB tree, or a binary tree representation of multiset, but there in this setting we can implement a data structure called monotonic queue which only requires O(n) in construction. The implementation of this data structure requires a deque.


Leetcode 239: Slide window maximum (series 3 of 10)

June 18, 2018


Introduction


It is time for me to study discussion panel of the algorithm. I chose this one with keywords: Sliding window minimum/maximum = monotonic queue

Here is the discussion link. 


Mock interview talk 


I used the algorithm in my mock interviews a few times last 2 weeks. I had chance to discuss the algorithm with more detail. 

Of course, I like to write down some discussion and help me to develop good thinking process and reasoning skills with the interviewee. 


I did give hint about sliding window, do we have to make the sliding window fixed size? Can we think about the way to reduce the sliding window size? How to approach the problem?



When to add an element into the current sliding window, we can do comparison using current element to the last one in the window. 

Leetcode 239: Slide window maximum (series 2 of 10)

Leetcode 239: Slide window maximum - (series 1 of 10)

June 18, 2018

Introduction


It is hard level algorithm. I like to learn this algorithm starting from June 18, 2018. I like to read at least 10 discussion, and also write code for a few ideas.

Every hard level algorithm takes at least 10 practice for me to master. It is hard level, I like the challenge.


My argument


It is important to stay humble and very cautious. Play at least 3 test cases before I choose one of ideas to solve the problem. It does not matter if there is only five minutes. Most of important is to be curious, and also stay at the moment.