Wednesday, June 6, 2018

Ownership - story III

June 6, 2016

Introduction


It is the task for me to integrate my experience with S.T.A.R structure. I like to write 20 Hackerrank contest experience. Why did I start to work on it? What have |I found through those practice? What is the result?

Situation


I worked on my current job 5 years. I make things work but I know that the problem solving skills are not that good. Let us make it a situation. Actually there are a lot facts to tell that. I could not handle the stress of changing, constantly requirement update etc.

Task


I need to improve my problem solving skills. I like to know where I am in terms of coding skills, and overall challenging problems may have in software industry.

Action


I started to play hackerrank contest in 2016. I played over 20 contests afterwards, I got 7 bronze medal, two silver, one gold.

After that, I played again a few more times, I found that it is hard to get medal if I do not spend a lot of hours to work on.

Result


I understand that my weakness. I know how super talent players and their performance. I tried to solve the hard level and advance level algorithm but I learned a lot of lessons.

One weekend I only have a few hours to relax, all other time I play contest continuously.

System design: Music stream online store

|June 5, 2018

Introduction


It is the first time I know that I can make difference by preparing early and also preparing with best resource I can get. I already know the power of coach to work on the algorithm and data structure, but I did not start to work on system design until last two weeks.

How can I make it in such a short time? I know that I should not read too many contents and end up by just reading and ending up fruitless. I like to form best possible partnership with one of my friends. I have strong algorithm and data structure, I can offer the free coaching and also very good mentoring as well.

So I finally got myself to have a coach, system design is just to learn from the old friend, ask questions, and read more content.

One more practice


I asked help to work on grokking system design. My coach told me that the content is kind of out-of-date. So we two jumped on carerrcup website, and worked together a few design together. I just watched how the coach approached the design.

Here is the webpage to get the questions asked. Design a music streaming service like Pandora.

Here is the design given by my coach.






Tuesday, June 5, 2018

Leetcode 122: Best time to buy and sell stock II

June 5, 2018

Introduction


One of best things to do is to follow my coach. I spent 10 minutes to review the algorithm called Leetcode 122  Best time to buy and sell stock II. I| wrote a blog for this review.

Algorithm


Here is the gist I created for the algorithm.

I have a mock interview to work with a young graduate with five years work experience as a recruiter, she took some coding boot camp.

The interviewee did very good. I tried to explain to her that the code she wrote is not very readable, too complicated and can be simplified.

I let her advance to next round.



A trip to USA

June 5, 2018

Introduction


I felt so excited to visit United States again in less than 3 months. I felt total different since I never imagine that I may have small odds to get back and enjoy some time as a software developer.

I play all kinds of small tricks, but none of them works. I share one story here.

I used to stay in Florida over 14 years, I have a good friend who supported me over 10 years. First thing he surprised is that I decided to choose Julia instead of using Jane in 2010 when I started my first job in the city of Vancouver. He talked me every year using Jane last 10 years in Florida, USA, how come I can change it to Julia in a day? He asked me who is Julia?

I like to have a brand new life in the name of Julia. That is in 2010. Now it is in 2018.


Travel to USA


One trip to USA the city of Seattle makes such big difference. I know that sometimes the world is so connected that people may be open to new things as I do every day. I try to meet one programmer every day on mock interviewing platform. Last night I was so busy and still tried to meet a new person. Guess who I met. Best talent programmer who stayed anonymous, work on the three algorithms in a row with me, he used to work for Zenefits, and also in the city of Vancouver.


Can a programmer make it? 


Sometimes I understand that it is important for me to give up something and continue to pursuit my interest as a software developer. I like to meet people and also talk about the algorithm and data structure. I can write code, write blog, play as a mock interviewer, give people support to help them develop their career.

Can I be a super talent programmer as well? Do I see the hope when I get stuck on one algorithm, one approach? Can I find ways to hack the problem and quickly settle down a solution?

Let us see


I like to see how the world can bring to me as a software programmer, I like the challenge and the business world makes me feel so relax and excited.



Leetcode 98: Validate binary search tree

June 5, 2018

Introduction


It is my most favorite algorithm to apply recursive solution. To simplify the solution, we can pass the maximum value and minimum value for each node; The rule of maximum and minimum will also take care of the binary search tree property, the root value is bigger than left node and smaller than right now.

Algorithm


I just quickly read the recursive solution. I put together a gist for the solution I like here.

Time spent: 9:00 PM - 9:10 PM



Leetcode 23: Merge K sorted list

June 5, 2018

Introduction

I had a coach last 3 weeks and we discussed how to make the thing work out. One of my ideas is to go over some Leetcode algorithm together last minutes for me to warm up. Because my coach thought that it will not work. He thinks that it usually takes two hours to work on something, a few minutes will not work. I think that it is like gambling, guessing what will be asked.

Instead I asked my coach to give me 10 algorithms to work on for last night before the big show. I worked on Leetcode 23: merge K sorted list. It is hard level, I am glad to see that my coach selected a heap solution for me to practice.

I have worked on the heap solution more than 30 times on mock interview platform. I just quickly go over the discussion 10 minutes.

Statistics:  8:20 pm - 8:40 pm

How can I be successful?

|June 5, 2018

Introduction


It is most challenge job to prepare something last minute. I cannot push myself too hard. I just chose one of algorithms my coach selected for me, Leetcode 456, and then I enjoyed the time to hack the algorithm.


How to analyze the algorithm?


I read the algorithm and then try to figure out the best way to analyze the algorithm. I read the story about the search is out of order, s1 < s3 < s2. It just tells us that we have to think about different ways.

Best time complexity is O(n). We have to maintain maximum possible s3 value. Can you image that? I tried to analyze the brute force solution, and preprocess the array to maintain the value of each index right side maximum or minimum value. But it does not work.

We have to simplify the problem?

We like to handle s2 and s3 before s1, and also we like to keep the track of maximum s3 value. Every iteration the current visited element has to play s1 role first, see if it can play s1 < s3; otherwise, it will be considered to be candidate of maximum s3.

I am writing a novel here. Just because I spent more than two hours to try to reason the solution while I am sitting in a hotel, in a steak dinner.

Here is the discussion panel which has everything I try to put together a story here for Leetcode 456: 132 pattern.

Statistics:

Time spent: 2:30 PM - 2:50 PM
6:00 PM - 8:20 PM




Monday, June 4, 2018

Leetcode 399: Evaluate Division - from my coach

June 4, 2018

Introduction


It is the last session of my training. I sent the algorithm I am interested to my coach, and he told me the graph algorithm is Leetcode 399: Evaluate division.

Last lesson 


The coach gave me his analysis about the graph using this algorithm. I did not fully follow his idea.

Here is the transcript.


Leetcode algorithm

June 4, 2018

Introduction

I got the list to work on from my coach. I like to work on the algorithm.

Hi Jianmin,

I just took a look at those problems on leetcode. Here I recommend some problems you should take a look.



Best wishes!

Say goodbye to my coach

June 4, 2018

Introduction


It is hard for me to work on algorithm back to alone, and try to find another best algorithm player along the mock interview practice. I did find very good friend to practice with through blogging. I could not believe that power of marketing of each blog, I can easily get all the important information at my finger, and find a strong algorithm player to bounce ideas and work together to reach a new target.

Say goodbye!


I did write an email to say goodbye to my coach.

hi, 

  I wrote a blog to put all coaching session together, and like to share with you. 

  Here is the blog link.

  I also spent a lot of time to think about the coach I like and guess what you look like, my favorite tennis player Dimitrov's coach. I wrote blogs to share with you, but I was too busy to send too many emails. 

  Here is the coach's advice. 

 "Trust your instinct. You already practice all patterns. Figure out ways to solve the problem, make mistake and let it go." The coach talked about how to mentor the player mentally. I think that you are kind of the style, on dynamic programming solution coaching. 

  Here is blog I wrote to send to you. 

  One more coach I like and I thought about is Rob Kentlay. 

  The coach is my favorite.   

  Daniel is my favorite coach, and you must look like him. 

Leetcode 85: Maximal Rectangle - from my coach

June 4, 2018

Introduction


I talked to my coach that I had some difficulty to come out dynamic programming solution idea in the first five minutes on my last practice with the peer. My coach told me to check algorithm Leetcode 85: Maximal Rectangle.

careless whisper

June 4, 2018

Introduction


I had mock interview this morning with my coach, 8:00 AM. This is our goodbye meeting. I talked to my coach that the dynamic programming solution is hard to come out in the first five minutes. I just named this algorithm as careless whisper. I did hear the word coming out my mouth when I discussed with the peer yesterday, using dynamic programming.

Algorithm is called to find maximum flower. Given a matrix with cells three options: empty, wall, flower, find maximum flowers cell.

Let us say that two dimension grid contains empty cell (S) or flower (F) or wall (W). A person standing in a cell can see north, south, east and west. But all flowers behind wall are invisible. Find the cell with maximum visibility.

S   F   S  F
W S   F  S
F  W  S  F
S  F   F  W
S  F   W S

output: 3


Algorithm practice


Here is my C# algorithm.

I do not have time to put those four functions into one function, avoid code duplication. 

Follow up

June 20, 2018
The friend just shared with me the discussion panel on this algorithm. 
Discussion of maximum visible is here. 

Follow up 

March 5, 2019

I asked the algorithm in mock interview on interviewing.io. I learned from the interviewee that the algorithm can be simplified by checking left/ upper two directions only.



March 6, 2019

I spent time to work on the example again. It cannot be simplified. 

Sunday, June 3, 2018

Leetcode 493: Reverse pairs

June 3, 2018

Introduction


It is hard level algorithm called Reverse pairs. My peer asked me to solve the algorithm.

Mock interview


Here is the transcript.

Booking reading: Microservices from design to deployment NGINX

June 3, 2018

Introduction


I like to read the book 30 minutes a time in next few days. Here is the book titled "Microservices from design to deployment NGINX".


Count how many palindromic substring - from my coach

June 3, 2018

Introduction


It is my ninth mock interview with my coach. He gave me the dynamic programming solution to work on. It can be described "Given a string, you task is to count how many palindromic substring in this string."

I tried to get help from my coach, I like to see how he developed the solution using dynamic programming. Actually I found out that I missed the target.

Target


What is time complexity to solve the problem. The brute force solution will take time complexity O(n^3). The algorithm can be solved using dynamic programming with time complexity O(n^2).

All we have to do is to get dp[i, j] for any i, j from 0 to n where n is the length of string.

And then I can use O(n^2) to calculate the count of palindromic substring using O(n^2).

Flatten a list - from my coach

June 3, 2018

Introduction


It is the algorithm my coach gave to me on mock interview June 1, 8:00 AM. I like the conversation we had and then I had some conversation with the coach. My idea is that there are so many ways to solve the problem.

After I solved the algorithm, the coach asked me to write the solution of preorder traversal of tree using iterative solution. And then he told me that the solution to write iterative way for flatten a list is the same idea.

The coach helped me to clear up the confusion of preorder traversal. The order is always defined from the root node's position.

Mock interview 


Here is mock interview transcript.

Here is the code I wrote for preorder traversal iterative solution.


Follow up 


June 3, 2018


Ownership story II

June 3, 2018

Introduction


It is ownership leadership principle. I learn the lesson how to be owners.

I need to write two stories today.

Story II

Ownership

----------------------------------
Situation:

I do not have people to work with in terms of software developer. I am the only developer.

I am too busy to work on so many projects. I do not know what is most important in the long run. 

Task

I need to find ways to improve my soft skills, and also write code every day.

Action

I worked on the same 30 algorithms last 12 months with 300 mock interviews on mock interview platform.

Here is detail:


I spent one hour to work on algorithms every day; and I followed up more coding and study after each mock interview. 

Result

I learn so many things through various peers. After each mock interview, I push myself to write code for one algorithm. I have done this 300 times. That makes me a super powerful programmer. 

I never have favorite algorithms. Now I have 30 algorithms. I learn to master all of them, even hard level ones. 

Ownership story I

June 3, 2018

Introduction

It is hard for me to learn leadership alone. I had a conversation with my friend, he kept telling me to follow S.T.A.R structure. I like to write two stories and share with him. Now it is 12:15 AM. I just finished the story.

Ownership

Leaders are owners.

Ownership

----------------------------------
Situation:

No one gives me technical code review at work

Task

I need to improve my code quality

Action

I asked 40 questions on code review stackexchange.com from Nov. 2016 to Now

Result

I found out that I need to work on C#, clean code, coding style, OO design applied in C#; after last 12 months to work on feedback, I can write much better code

Here is the story one. 

Saturday, June 2, 2018

What I wish I had know before scaling Uber to 1000 services

June 2, 2018

Plan to watch 40 minutes video. The link is here.

What is microservice architecture?

June 2, 2018

Introduction


It is my research topic today "What is microservice architecture?". I had a coach to coach me one hour how to understand Netflix microservice video and pdf file, and then I like to print out something and make sure that I can understand basic terms.

Microservice architecture


I like to print out this article and read the article. At least I ask three questions and see if I can learn from the reading.

It is hard to quickly understand a new way to do software and I have to learn from the person who has strong industry experience.

Here is the article.


Netflix's Viewing Data - System design study

June 2, 2018

Introduction


I plan to spend 20 - 30 minutes to read the article and then I like to have some discussion with my coach about this article and learn how to understand system design article.

Taking notes first


Being a good student, I need to learn how to read the article carefully. Take some notes first. I like to do something small, and also start from there.

Here is the article link.

Netflix Microservices Talk


Please watch the video 48 minutes called Microservices at Netflix Scale: Principles, Tradeoffs & Lessons learned. R. Meshenberg

Pdf link is here.


Friday, June 1, 2018

Scaling time series data storage - one hour coaching

June 1, 2018

Introduction


It is my idea to get help from my Canadian coach to help me understand the article called "Scaling time series data storage". We spent one hour together to go over the article, I asked a few questions. Since I found out that there are too many new concepts in the article, I need some coaching from the friend.

System design


I like to write down some notes about this one hour coaching. First time I have luxury to enjoy best coach in the world, who helps me to understand the article word by word.

The coach told me that he spent at least half year to understand Cassadra and related technology.




Thursday, May 31, 2018

Personality challenge

May 31, 2018

Introduction


I like to talk about software programmer personality as today's short research topic. I met a friend Tony today on tennis court, he knew me over 8 years. We talked about how he trained his daughter to be a professional tennis player. She is 14 years old.


My personality


I was given a lesson how to be a coach. Give room to the person. Let her grow and then figure out things by herself. Do not overdo.

I like to confess that I was too shy to make a mistake 8 years, one year ago.  I definitely improve a lot after I play hundreds of hours tennis. I learn from tennis sports.

I definitely get better after I had conversation with tennis coach.

Tennis workout

May 31, 2018

Introduction


It is time for me to go to tennis court and enjoy outdoor sports. I went out and had a good time on tennis court. I need to relax myself and work on some sports training.

My friend showed me how good his daughter is on tennis. His daughter is champion of 2018 ROGERS JUNIOR OUTDOOR NATIONAL CHAMPIONSHIPS. He showed me the website with her ranking point 9.

How to train a tennis player professional?


We chatted more about how to train the kid from age 5 to age 14, and how to train her to be a professional player.

I have known the tennis dad over 8 years. I saw how dad trains his daughter since she was less than 7 years old.






Sleepless in Bejing and early bird in Vancouver

May 31, 2018


Introduction


How can two people meet with such busy work and life? A young graduate will sacrifice sleep and meet 11:00 PM to 1:00 AM in Beijing, and an early bird in Vancouver will get up before 7:30 AM and prepare to be coached for three weeks drill. I think that the blog should definitely be called "Sleepless in Beijng and helps early bird in Vancouver".

It is such great experience to have a series of mock interviews from May 12 to May 31, 2018. We have met over 8 times in total connecting from Beijing to Vancouver. I could not believe that it is such an enjoyable thing to do. I will write down a few things I learn through the series of mock interviews.


Good partnership


I know that a good coach will work with different players. I enjoy the time to work with my coach. I start to know his personality and also very good hard working stories now. My coach is cool as the youngest tennis coach Daniel Vallverdu  who coaches ten 10 ATP player Dimitrov.

I always follow tennis professional players, one of favorites, Safarova, and think about getting a coach like Rob Steckley. My research topic is similar to surviving after 30. One practice I am done!



First blog:

Introduction to get help from a coach is written in a blog called special three weeks drill.


836 minutes working together


It is definitely a big number, 836 minutes, close to 14 hours. There are eight mock interviews in total up to May 29, 2018.


First interview ( 71 minutes)

Detail see my blog called first mock interview from my coach.


Second interview (108 minutes)

Minimum cost using dynamic programming - mock interview

The transcript is here written in mock interview. And the code is written after the contest.

Find least number of perfect square, the blog is here.



Third interview (101 minutes)

Next large element in the array, the blog is here.

Height of tree, the blog is here.


Fourth interview (114 minutes)

The mock interview is documented here. The algorithm is called ....


Fifth interview (124)

find string s2 containg s1 permutation, the blog is here.


Sixth interview (105 minutes)

Suggest a char with maximum occurrence at the position with the given prefix. The blog is here.

breadth first search algorithm - processed by layers. The blog is here.


Seventh interview (96 minutes)

union find algorithm is documented here.


Eighth interview (116 minutes)

Leetcode 91 Decode ways is documented here.

Isomorphic strings is documented here.

Extra algorithms discussed:


1. Second mock interview

My past practice on dynamic programming is here. Manhantan 2 booking woman is the algorithm to apply dynamic programming.

2. Ask code review for my mock interview performance on trapping rain water.

3. Discussion about hard level algorithm maximum disjoint subtree product




Get lost in a depth first search, DP, tree algorithm again

May 31, 2018

Introduction


It is my favorite thing to do if I have luxury to spend a few hours. I like to learn the algorithm again called Maximum disjoint subtree product.

I read my own blog written after the contest in May, 2017. I read the code I wrote in the contest, and I like to make any point above zero. I wrote more than one hour and three hundreds of lines code, but I still scored zero. The hard working spirit really touchs my heart again.

I do have to get a coach and learn better way to think in terms of depth first search, dynamic programming and tree.



Algorithm study


Here is the code I spent time to play with. I need to get some help from my coach. I like to learn how he solves a hard level algorithm.

Getting smart after 12 months

May 30, 2018

What I like to do is to solve a subproblem first. Assuming that there is an array, we need to find two disjoint subarray with the maximum product. I like to define two dynamic programming solutions, and then I solve the problem first.

Here is C# solution I write. Time complexity is O(N), N is size of the array.


Leetcode 205: Isomorphic Strings

May 31, 2018

Introduction


It is one of my mock interview algorithm given by my coach. I wrote a C# solution. I got hint to use array instead of using hashset.


Follow up 


July 20, 2018

I ran the code against Leetcode online judge using Leetcode 205. There is index out of range error for test case: "13", "42"

Need to fix the issue. The C# code is here to pass online judge. 

Cassadra Netflix case study

May 31, 2018

Introduction


I like to spend 30 minutes to study Cassadra Netflix.

Learning is so surprising. Originally I plan to read grokking system design lecture notes, and then try to memorize the solution.

But surprising my friend offered me coaching and then I had chance to go over complicated web architecture by first hand sharing. I was asked to read Cassadra Netflix after May 30, 2018 one hour coaching.

To be a good student and be coachable, I find that I am so enjoying to read Cassadra database and totally forget the time.


Scaling Time Series Data Storage — Part I


Reading is getting hard.

https://docs.datastax.com/en/cassandra/2.1/cassandra/dml/dml_manage_ondisk_c.html

write down new terms I need to learn:

Log-structured Merge Tree vs B-Tree

Read-before-write

statement: Cassandra never re-writes or re-reads existing data, and never overwrites the rows in place.

hard disks (HDD)
solid-state disks (SSD)

Tuesday, May 29, 2018

Being an interviewee : Insert intervals

May 29, 2018

Introduction


It is the interval algorithm but it is not easy for me to come out elegant idea to write simple code. I had some ideas, but before I came out the idea, I already wrote the code. The interviewer told me stop, and told me that I should make it simple.


Ideas 


Here is the transcript of the mock interview.

Hints pouring down 


I like the interviewer. He just quickly coached me through mock interview. I like to exaggerate how he did. He poured down hints one by one. I really like young talent Chinese graduate student, how hard he works, and he is willing to coach me. He did 3 times mock interviews with me, and this is the third time. I like his good collabration skills. I do believe that the future will be better with those young gradautes.

A few hints are given by the interviewer and the interviewer helped me to get the optimal solution and also very clean implementation:

1. About inserted interval, it can be replaced by current visited element
2. inserted interval can be replaced by the merge interval of two overlapped intervals.
3. Write simple code, I wrote the code to check next interval and logic is too complicated for the interviewer to follow. It may work, but the interviewer told me that it is better to discuss with the interviewer first.
4. The interviewer told me that it is better to ask hints, instead working on complicated solution. I do not totally agree on this.
5. If I am too busy to work on the code by myself, the interviewer may not have chance to work with me.

Follow up 


I wrote C# code and also I found a bug. Actually if I check my coding style and I should find the bug. Those two lines of code with variables insertedStart, insertedEnd, the scope should stay inside for loop. Now they are moved to line 60 and line 61.


Leetcode 94: Binary Tree Inorder Traversal

May 29, 2018

Introduction


I could not believe that I finally can write working solution using recursive solution today. It is quick and fast. I still remembered that I did choose to write a recursive solution, instead I wrote an iterative solution with some bugs on important meeting. This past 12 months I definitely have done some good training. I CAN write a recursive function very easily on binary tree.

I like to submit as many algorithms as possible on Leetcode.com.

Recursive solution


Here is my recursive solution.

Iterative solution


I like to go over the algorithm with tag stack. I wrote an iterative solution using stack, and it is good workout for me to master stack algorithm one more time.




Leetcode 91: Decode ways

May 29, 2018

Introduction


It is my eighth mock interview from my coach starting from 8:00 AM to 9:40AM on May 29, 2018. He asked me to work on Leetcode 91: Decode ways.


Mock interview


Here is code I wrote in the mock interview.

Follow up


I wrote the C# code and then tried to pass online judge. I made a mistake to put 0 which should be '0' on line 80.


Coach's advice


Please consider to define the array using extra one space. Let the first element of the array be empty, therefore in your solution line 80 index >= 1 can be removed.


Follow up 


May 2, 2019

I chose one of online mock interview on Leetcode.com and had chance to practice the algorithm one more time.

I spent 30 minutes to write and used debugger to help me to fix a few bugs in order to pass online judge.

Here are highlights:

91 Decode ways
I came cross three bugs and I had to use debugger to help me to figure out
1. mix char with integer, s[i] - '0' is to convert to integer
2. all results are zero, forget to increment one for the start
3. apply step 1 for all instances, miss a few place
4. missing edge case, tenth digit should exclude 0, 3 to 9. 0 is not considered by mistake.
5. missing edge case, 00 is not valid

And the code written is here to look up.




Monday, May 28, 2018

Deliver results

May 28, 2018

Introduction


It is one of Amazon leadership principles. I like to learn from the Amazon leadership.


Hava backbone: Disagree and commit

May 28, 2018

Introduction


It is one of Amazon leadership principles. I like to spend at least 30 minutes to study the principle first.


Dive deep

May 28, 2018

Introduction


Dive deep is one of Amazon leadership principles. I like to learn the principle and plan to spend 30 minutes at least.

Earn trust

May 28, 2018

Introduction

Earn trust is one of leadership principle. I like to spend 30 minutes to write a blog for this principle.

Frugality

May 28, 2018

Introduction


I like to write a blog for frugality principle. I think that frugality is hard to practice, it takes a lot of wisdom and determination. I like to apply the frugality principle to my daily job.


Bias for action

May 28, 2018

Introduction


I like to write a blog for Bias for action principle. I will start to work on it 10 minutes first.


Sunday, May 27, 2018

Find a system design coach

May 27, 2018

Introduction



I had this past Saturday system design study, I had a few times to feel so tired and sleepy. I know that I may have problems down the road. I need to find a coach. I start to search who will be my best coach.


First two hours learning 

May 28, 2018

I just could not believe that I had two hours training from my friend. Two hours learning makes big difference.

Here is my notes I took in the training.


Second time coaching


May 29, 2018

It takes time for me to get ideas how things work out. I need to work on one thing a time. That is the reason I got a coach No. 3, who has a lot of industry experience. Basically he went over grokking system design lecture notes and discussed with me. If I have any question, he gave me answers and make sure that I can understand the concept by his explanation. He could explain things so clearly and I totally quickly understand.


Content dilivery network:  CSS, spritemap

Amazon S3/ cloudfront

CDN -> Amazon /cloudfront

Shard -> horizontal/ row/ databases
range-based shard

sharding - horizontal, columns
Direct-based partition
partition key values
Index - sacrife the space to get shortest time
Explain SQL plan -> look up index needed or not
Proxy - reverse proxy
enforce/ request/ rule/ login information / map/ API - url reroute

Queue - RabbitMQ, producer/ consumer

Data/ service   logging shipping/ database server
microservice
Horizontal
encyms   Deployment/ encyms

SQL/NoSQL JASON    redis
NoSQL, structure/ unchange
Cassandra/ couchDB

HDFS or cluster FS

RAID - redundant array of independent disks

I/O in parallel - read/ write

RAID - cluster / Redundancy

I was strongly advised to look at open source tool called Swagger / OSI open specification

Go over netflix stream system design

7.  File processing workflow
8.  Data Deduplication

2. Range based partition

10 caching   Least recently userd (LRU)

RAID - partition key -> 256 buckets
Blob - save image

Elastic search - NoSQL search , document - tuning score, criterias: two words how close they are, subject

high speed cache - google CDN

8. Metadata sharding
Partition
user id    cassandra

Memcache   k-V memcache


Given an example about tag on video, threshold > 3,
caching 20%

Redis - can be applied to anywhere
Cluster -
Elastic search
Cassandra - big data handling, very good write speed
build index x ( problem to build index)


Storage - log/ by minute/ 60 seconds
search

Overall, learning is much better with a friend to go over the system design of Netflix stream, and I had chance to ask a few questions. I was not afraid to ask questions, and then the friend gave me very good experience based on his work experience. The time spent is 60 minutes.


My task is to understand those tools, and be able to freely apply them in the system design. Redis, swagger, Elastic search, Cassandra, load balancer, Amazon/ Google/ F5 load balancer. The coach shows me how easily he can come out ideas how to design step by step.



Sascha Bajin - my favorite coach

May 27, 2018

I like to learn from the coach and then share with my coach of algorithm, a young Tsinghua university graduate.

https://www.youtube.com/watch?v=1D_bj0YFEWc

Darrell Cahill - coaching philosophy

May 27, 2018

Introduction

One of things I like to do is to do some research and help my coach to give me coaching time. I like to write down notes from this three minutes coaching video. After that, I will send my coach an email.

https://www.youtube.com/watch?v=LyRJ5IvWjss


Best coach I knew and met in China open 2017

May 27, 2018

Introduction


I like to share some document with my algorithm and data structure coach. So I like to share this great coach talk video.

https://www.youtube.com/watch?v=LyRJ5IvWjss

https://www.youtube.com/watch?v=Pd5HRQWzB0I



Work with my coach (II)

May 27, 2018

Introduction



I need to write an email to my coach today. He gave me a coaching lesson this morning 8:20 AM to 10:20 AM. He did good job to coach me tough algorithm.

I need to send him a good video about Safarova about her coach - my favorite one Rob Kentaley.

https://www.youtube.com/watch?v=oI4ug17z1kA


union find algorithm - 7th mock interview from the coach

May 28, 2018

Introduction


It is my most favorite algorithm called union find algorithm. My coach asked me to solve the algorithm to find maximum group. We had discussion around 100 minutes. Through the discussion, the coach showed me how to do time complexity, and then we had good time to discuss a few topics. At last, I asked the coach to write two function, one is to quick find, one is to union.

Transcript


Here is the transcript of mock interview on May 27, 8:00 AM.

Follow up


I spent a few hours to review my past practice on this union find algorithm, and then I wrote C# code for review. Also I was asked to write a depth first search algorithm, and I will write one.



Breadth first search distributed algorithm - 6th mock interview from the coach


Introduction


It is my most favorite algorithm May 2018. I was surprised to spend more than one hour to write the C# code and also fixed my original design issue. My design was kind of weak until I tried to test the third test case with 4 x 4 matrix. I found out the answer is not correct. For some reason, the current layer of node will get into next round when I apply breadth first search. Later, I added a hashset to exclude the current layer node to get into next round.

The algorithm is so ineresting and I remmebered that I worked on the similar algorithm called shortest distance to all building.


Algorithm 


I wrote a breadth first search algorithm based on my coach's hint. Find all elements in the matrix with zero value first, put all of them in the queue, and then process breadth first search on those elements in the same time.

It is kind of distributed algorithm. I like the challenge. I feel excited after I complete the algorithm.

Here is my mock interview transcript.

Here is my C# code after mock interview.



System design

May 27, 2018

Introduction


It is time for me to read grokking system design articles. I spent a few hours this Saturday and I read a few system design, one is instagram design.

What I like to do is to design some drills to help me read carefully, think carefully, learn something as well.

It is not easy for me to learn something if the content is not very well prepared. So I chose to purchase grokking system design with payment over $100 Canadian dollars. I like to focus on the lecture notes and do some research based on the reading material.


Argument of day


Julia, do not be silly. You work so hard and finally can do very well on algorithm and data structure problem solving. Then you should work hard on system design. It should be easier compared to algorithm and data structure.

Prepare some notes, follow a few simple steps.

Study notes







Saturday, May 26, 2018

Think big

May 26, 2018

Introduction


It is my favorite thing to write a blog for one leadership principle called think big. Thinking small is a self-fulfilling prophecy. Leaders create and communicate a bold direction that inspires results. They think differently and look around corners for ways to serve customers.

Word by word


leaders -> directions -> results
customers -> serve customers -> ways to serve customer ->  look around corners for ways ...

a bold direction -> how to define a bold direction?

Relate to my experience


First I like to read the engineer's blog about Think big. Here is the link.


Insist on the Highest Standards

May 26, 2018

Introduction


It is time for me to learn leadership principle one by one. I like this one most since I know the difference to insist on the highest standards. 

Leaders have relentlessly high standards - many people may think these standards are unreasonably high. Leaders are continually raising the bar and drive their teams to deliver high quality products, services and processes. Leaders ensure that defects do not get sent down the line and that problems are fixed so they stay fixed.

Principle wording


rentlessly - 
high standards

unreasonably high 

leaders are continually rasing the bar

their teams to deliver high quality products, services and process

Insist on the highest standards

- highest standards -> what is the standards? how to define the standards? highest? How about high -> higher? 

leaders vs many people 

leaders -> their teams -> deliver high quality products, service and processes. 

How do leaders make the transition from insisting on standards level to delivering high quality ...

Relate to myself


I need to hold on highest standards. 

1. Push myself to master C# programming language from my own ranking 6 or 7 to 9. What I do is to read the C# book, ask questions, and memorize API. 
Every time I write C# code in mock interview, I ask question what problem I have on C# coding. I like to learn C# by checking the thinking process of basic problem solving. 

2. I like to ask questions on code review website and also make sure that I can easily get help if I need to work on some algorithm. I need to find out areas I can improve on C# code. 

3. I like to keep writing code every day, this way I can master the data structure and algorithm one by one. 

4. I believe that once I master the data structure and algorithm, I start to know how to make the products I architecture and code to high quality. 
Security - against attack
Code - readable, clean code
Code - simple code 
Code - object-oriented principle - try to apply to my own work 
Test coverage - 


Highest standards

- relate to my practice on Hackerrank contest, I continuously worked on the contest until I got my first gold medal. I documented every practice so that I review and find things to work on. I also try to train myself. 

- 

Highest standards 

Hire and Develop the Best

May 26, 2018

Introduction


It is important that I have a friend who checks with me daily about my progress about leadership principle study. We have short chats through Facebook messengers. We started to chat more about leadership since I started to work with my coach. The friend used to be my hitting partner to work together on algorithm a few times. 

Hire and Develop the Best
Leaders raise the performance bar with every hire and promotion. They recognize exceptional talent, and willingly move them throughout the organization. Leaders develop leaders and take seriously their role in coaching others. We work on behalf of our people to invent mechanisms for development like Career Choice.


Understand the leadership principle first


Let us go over terms in the principle. 

raise the performance bar
every hire and promotion

recognize exceptional talent

exceptional talent -> how to recognize, how to measure exceptional? talent? what talent? basic talent or special talent. 

Leader move them throughout the organization. 

Organization -> business -> what kind of management in the business? 

Leaders vs coaches -> coaching others -> what motivations stay behind? 

on behalf of our people to invent mechanisms for development like career choice. 

It is hard to relate to my own practice. 

Please list a few mechanisms for development like career choice. Career choice, what other options do we have besides career choice.

Relate to my personal story


I hired best coach for my data structure and algorithm since May 12, 2018. I start to build some experience to have a good coach.



Follow up 


Oct. 18, 2019

Back in May 2018, I decided to hire a personal coach from one of top performers I met through pramp.com. I practiced over 300 times, and then one of players has super performance. He was a graduate student in Tsinghua university. So I decided to ask his help to prepare onsite interview from Amazon. 

Learn and be curious

May 26, 2018

Introduction


It is my most favorite topic of leadership principles. It is straightforward. Learn and be curious. As I am getting old, I do not see any improvement until I had chat with one of shanghai jiaotong university alumni - my classmate back in 2015. 

Learn and Be Curious
Leaders are never done learning and always seek to improve themselves. They are curious about new possibilities and act to explore them.


Learn and be curious


Do not learn. Do not be curious - the opposite is not good!

Leaders are never done learning and always seek to improve themselves. It may be a wishful thinking. It is hard to find time to learn and actually be able to learn. Seek to improve themselves. It is not 

easy to keep improvemnent. There is a plateau. Once you reach the plateau, it is hard for you to acquire new skills. 

Curious about new possibility - 
Act to explore them - 

How to apply sports coaching on this leaders or being leaders? 


I know that I have to stay to be coachable. It is hard for me to do that. Since I have to spend most of my time to learn the basics, work full time to make a living first. I notice that curiosity is ok but I have limited time. I have to find ways to get training on interview skills daily, get soft skills to be improved. 

I was coached in 2015 by my shanghai jiaotong university classmate from 1989 to 1992, who works for Simens in Michigan. I was told to take courses on pluralsight.com. I also try to get involve in the community as possible. I join Hackerrank community, I play contest, and post comment and also document my journal of practice. 

I learn from sports coaching. I follow all seeded tennis players. I learn from their up and downs. I start to follow them and get to know more sports traing, coaching and practice and drill, and I also attend the event, practice by myself as well. 

I like the individual sports like tennis. But it is not individual sports anymore. I like the way how the professional players handle the ....

I know that it is important to be competitive in tennis sports. I know the difference. If I walk on the tennis court, people will come to me and offer me a practice together. 

Are Right, A Lot

May 26, 2018

Introduction


It is time for me to do some study on leadership one by one. It is not easy to come out the principle, but it is also very hard for me to look up those principles without a few good references. 

The principle is called Are Right, A Lot. The explanation is "Leaders are right a lot. They have strong judgment and good instincts. They seek diverse perspectives and work to disconfirm their beliefs."


Leadership study


Are right, A lot. 

Let me brainstorm the leadership on May 25, 2018.

Leaders are right a lot. This statement makes sense or not? Leader are right a lot. A lot means bigger than 50% probability, 70% is a lot? 

Judgement and good instincts. Question is how to define judgement as strong, how to define instincts are good. 

It is hard to mainain the strong judgement. Since bible says that do not judge otherwise you will be judged. 

Good instinct? Sometimes we have to practice a lot, meet a lot of people through mock interview, and then I can quickly learn how to make good judgement. Sometimes it is easy to tell that the peer is nervous, or trying to hide lack of practice, sometime the peer tries to get hint without asking. 

diverse perspectives? Give an example about diverse perspective, 

Work to disconfirm their beliefs.

Relate to my work experience


I have to work on some way to help me get motivated and keep getting help from various resources. I need a few platforms for me to play and get recognition for the hard work, knowledge about computer science, and good working spirit and easy to collaborate.

I need to brand myself. I need to work on daily and try to put together things. 

Work with my coach

May 26, 2018

Introduction


I like to spend some time to work on my coach training, and I like to share my research with my coach this weekend. Since we like to get close, I can have more ideas to learn from his coaching.

Write a short email first


I spent time to write one email after my last mock interview. The coach does not get impressed. He replied. So I wrote another one.

Hi, Mr. xxx, 

 I like to spend give five minutes to 10 minutes to share my favorite tennis sports. I like to find out ways to win.

 Sloane Stephens, rank from 974 to 17 since she won grand slam. She had foot surgery, training again, very good story to share, encouraging, USA style success story. 


 When is our next meeting? I will find time to work on my home work before our next meeting. 

I did send another email since I sent a wrong link of youtube:

Hi, Mr. xxx, 

Sorry, I sent wrong video. I like to share one video from USA athlete Sloane. 

I like to send this video from Sloane Stephens - https://www.youtube.com/watch?v=b1QM5cjlh_w

I like Sloane's coach, and her coaches and how they work together. 

Being coachable 


I like to work on small details to make myself a good student and allow my coach guide me better to solve algorithm and data structure problems. It is second week I got a coach. 

The coach told me to work on easy algorithm on Leetcode.com.




100 minutes to work with a young graduate - Copy linked list with random pointer

May 26, 2018

Introduction


I could not believe that I spent over 100 minutes to work with a young graduate on my May 25, 2018 10:00 PM mock interview. It was such great experience, I learned how to evaluate his performance and gave him honest feedback.

First Algorithm - copy linked list with random pointer

I will come back to write down more.

Second algorithm - Maximum subarray product

I will come back to write down more.

Wednesday, May 23, 2018

Being an interviewee: Suggest a char with maximum occurrence at the position with the given prefix

May 23, 2018

Introduction


It is my most favorite algorithm to practice with my coach. The algorithm is called to suggest a char with maximum occurrence at the position with the given prefix.

The coached asked me if I have Trie experience two days before my mock interview, so I spent some time to review Leetcode 212 and also my question on stackexchange.com.

The conversation of writing a Trie data structure was very interesting.


Coach: can you explain how you define the Trie?
Julia: It should be recursive structure, Children should have Node type as well.
Coach: Do you need to have a list of numbers for children?
Julia: No. It should be minimum. Every node just takes care of its own number.

In-between the mock interview, the coach asked me why you define the Trie this way, save "ABC" as a member of class definition. I just told the coach that I memorized the solution I reviewed recently. But actually we do not need to do that here. I felt much more relax after we work together more than 10 hours.

Trie algorithm


I learn how to work with the coach and write a solution in the mock interview. And also the coach asked me to test the code using the test case documented from line 93 to line 96, I found the bug on line 107, and delay increment of index variable until line 123.

Here is the transcript of the mock interview.

Follow up 


I wrote the C# code and tested it using a simple test case. Now it is 12:21 AM, I need to rush to go to bed since at tomorrow 8:00 AM I will have a mock interview.

10:00 PM mock interview as interviewer


I also ask the interviewee to work on the algorithm at 10:00 PM mock interview. The intervewee has more than eight years experience working in Silicon Valley to target for biggest software companies, and I helped him to write a Trie solution. What I did is to try to copy my coach, how he did to me. I asked the interviewee to work on the test case, show me the trie, and also give hint to use array for fixed size instead of using Dictionary.

Here is the C# code the interviewee wrote before I write my own C# solution.

Code review from my coach


I sent an email to ask the coach to review my code before I will have next mock interview. The coach offered me to send the code before mocking interview after our second mock interview, so he can prepare better for next mock interview. We can squeeze in more activities in the mock interview together. My coach is super talent programmer and I like his working attitude.

"I think that it is definitely no problem at all. Let us meet Friday morning.

I just like to send you the code I wrote for suggest char based on prefix.

Here is the link."

May 25, 2018
8:00 AM

My coach told me that one thing is not correct. The iterate variable may be null pointer. I need to add null pointer checking on line 152.