Sunday, March 26, 2017

Leetcode 312: burst ballons

March 26, 2017


Problem statement

Julia has some difficulty to figure out dynamic programming from the very beginning for unseen problems, so she likes to vote up the analysis of burst ballons on this blog.

The most important message is like the conversation, let us read the sentence by sentence together here.

"This is the kind of problem we use dynamic programming. WHY? it's very challenging to figure out what's the pattern of optimal burst order. In fact, there's no clear rule that makes sense. Shall we burst the balloon with maximum coins? Or shall we burst the one with least. This is the time we introduce Dynamic Programming, as we want to solve the big problem from small subproblem. It is clear that the amount of coins you gain relies on your previous steps. This is a clear signal of using DP.

The hard part is to define the subproblem. Think out what is clear in this problem? Let's scale this problem down. What is the fact you know for sure? Say if the array has only 1 balloon. The maximum coin would be the coin inside this ballon. This is the starting point! So let's move on to array with 2 balloons. Here, we have 2 cases, which of the balloon is the last one. The last one times the coins in boundary is the gain we get in the end. That is to say, last balloon is the key. Since we don't know the pattern of optimal. We just blindly iterate each balloon and check what's total gain if it's the last ballon."

But after those two paragraphs, Julia got lost the formula:

Let's use dp[i][j] to denote maximum gain from balloon range i to j. We try out each balloon as last burst in this range. Then the subproblem relation would be:

foreach k in i to j:
 dp[j][i] = max(array[j-1]*array[k]*array[i+1] + dp[j][k-1] + dp[k+1][i], dp[j][i]);

Algorithm study

Study the blog about burst ballons first. (March 26, 2017, 11:01am - 11:15am)

Watch the video - burst ballons.  (March 26, 2017, 11:15am - 11:30am)

Saturday, March 25, 2017

Study a code reviewer - Pimgd

March 25, 2017

Plan to study a code reviewer Pimgd and the algorithms related.

48 algorithms

2 algorithms populistHighest scoring answer that outscored an accepted answer with score of more than 10 by more than 2x. 

Hackerrank: Poisonous plant

March 25, 2017


Problem statement

It is hard algorithm under the category of stack. Julia likes the algorithm.

Luigi Vincent, code review profile

Code study

Hacker Rank - Poisonous Plants

How to lose plants and aggravate people

Code Review: Scrabble tile-counting challenge

March 25, 2017

Come back later to review this algorithm. Write down what I like most in this review.

Scrabble tile-counting challenge

Code Review: Implementation of a Card class in Java

March 25, 2017


Julia likes to know when she can be object-oriented programming expert. One thing she can do is to work on a simple class code review, and understand how to make it perfect. Today, she chooses to study this Card class in Java and then get herself comfortable to choose public/ private, static, and name of variable.

Last time when she wrote static for elevator simulation algorithm,  she could not recall when to use static exactly.

Code review study 

Implementation of a Card class in Java

code review study

Code Review: Moving across my (sturdier?) Bridge

March 25, 2017


Julia was short of time and she tried to learn something from Tunaiki before next Monday March 27, 2107. She chose this code review because she tried to figure out how good the user sybOrg is, who asked over 60 questions

Code review study 

Moving across my (sturdier?) Bridge

Code Review: Quicksort

March 25, 2017


Sorting is the most important things in a programmer's life. Julia was so excited to know her first review of quicksort algorithm was chosen as the answer. But she has to keep up learning and makes a wise investment on learning quicksort.

Code review

Integer quicksort in Java

code review: Play a game of Rock, Paper, Scissors

March 25, 2017


Julia likes to work on the object-oriented design, one of her ideas is to post a question on code review for her submission of the algorithm - elevator simulation, but she hold on for some reason. 

Julia came cross this algorithm - play a game of Rock, Paper, Scissors, so she likes to do some study and see how many things can apply to her previous submission of elevator simulation.

Code review study

Play a game of Rock, Paper, Scissors

The Boyer-Moore Majority Vote Algorithm

March 25, 2017


Julia decided to study the code review by a top performer ( 4% of quarter), and she came cross this code review: Finding the candidate with the majority of ballots. And then, Julia recalled that she worked on this kind of algorithm - majority vote last year through facebook code lab. 

Code review study

Read the wiki article - Boyer-Moore majority vote algorithm (March 24, 2017 11:24am - 11:34am)

Study the code review:

The Boyer-Moore Majority Vote Algorithm

Thursday, March 23, 2017

Range minimum Query

March 23, 2017

Plan to read range minimum query wiki article.

Log of history of reading time:

March 23, 2017  8:00pm - 8:20pm   20 minutes

Dynamic programming based range minimum query

March 23, 2017

Code review of dynamic programming:

Dynamic programming based range minimum query

Range minimum query - wiki article.

Algorithm videos - Coding Made Simple

March 23, 2017


A few things Julia likes about Coding Made Simple on Julia saw a lot of numbers written in the lecture, so she is sure that the talk is very detail and making sense on those examples.

Study 1 - 2 algorithms first and then evaluate how good they are.

Algorithm study 

Watch the algorithm lecture video here.

Algorthms: Memoization and Dynamic Programming

March 23, 2017

Study this video 11 minutes 16 seconds produced by Hackerrank.

code review by ranking board neighbor

March 23, 2017


Julia likes to get some good advice on the Java coding experience, one of good shortcut is to read code review in Java more often. She tries to find a good contributor to study from, she checked her performance of quarter 4% and then found her neighbor - Tunaki.

Code review study 

Code review by tunaki.

Julia's favorite algorithm code review:

1. coin change

2. Repeatedly partitioning an array equally as far as possible

3. code review - Julia's C# practice code for Hour Rank 7, Nikita and the Game

4. Find the number of K-Complementary pairs in an array

5. Finding maximum length of continuous string which has same characters -

18 nice answers - more than 10 up-votes

7 time Enlighted badges - First to answer and accepted with score of 10 or more

Stackoverflow links through code review

1. Raw Type in Java -

Actionable Items

Julia could not believe that she found a great mentor on programming.  While she played tennis on central park today, she wondered how come she did not feel tired over 5 or 6 hours to read Tunaki's code review. Usually, in less than one hour, Julia found out something really valuable in the code review.

Sometimes, Julia does not push herself to read code review every day, she is still trying to ask question instead reading answers.

Dynamic programming study

March 23, 2017

Study 50 minutes video - Dynamic programming for programming competitions.

Take some notes:

Fibonacci numbers - Fn = Fn-1 + Fn-2, actually it is exponential formula like 2n, growing quickly.

Wednesday, March 22, 2017

Working at Google - Munich Germany Office

March 22, 2017

Watch the video - 3 minutes 44 seconds.

Small team, high impact.

Engineering driven culture, management is involved and help. It is bottom-up and ...

Motivation is very high.

Snacks is everywhere and it is dangerous to your waistline. Be discipline.

Good, motivated people - initiative and do a good job. No harm in trying.

Meet a Google Associate Product Manager Program Alumna, feat.

March 22, 2017

Watch this video - 2 minutes 34 seconds.

Work with engineer with design, and also commercialization of the product.

Put pages up as you type character - idea?

For every one is like a millisecond, but for a lot of people means years.

Code Jan 2014 Finals in Los Angeles Highlight Reel Google

March 22, 2017

Watch 2 minute 41 seconds video.

What to do -
Advice, find some one is new and also interested. Start from something new, and not stuck on easy bug. And then work on algorithm, work on hard problems.

It is a sports.

Meet an interaction Designer for Google Search

March 22, 2017

Watch the video 2 minutes 38 seconds.

Which direction to push and where to push the product?

Craft, background and technology - 3 things to understand as the technology leader, and then where to push - Alan Eustace, Google SVP in 2013.

Leetcode 417 Pacific Atlantic Water Flow

March 22, 2017

Work on Leetcode 417 Pacific Atlantic Water Flow problem.

Leetcode 274 H-index

March 22, 2017

Work on Leetcode 274 H-index

Study the blog.

Tuesday, March 21, 2017

Algorithm: Longest common seqeuence

March 21, 2017

Go over top 10 algorithms one by one.

Longest common sequence.

1. Read wiki article 20 minutes.

Write down some notes here. Mark your progress to get familiar with wiki article.

2. 30 minutes on university lecture notes

Top algorithms and data structures for competitive programming

March 21, 2017

Read top 10 algorithm advised by 3x Gold medal competitive programmer - Andrei Margeloiu.

Top algorithms and data structures for competitive programming

Monday, March 20, 2017

Algorithm and data structure theory

March 20, 2017

Theory category

Work on blogs to add a category called "theory", Julia likes to go over the theory of algorithm, such as Master Theorem used in merge sort, and other things like "Cyclomatic index", "minimum spanning tree" etc.

MIT algorithm lecture notes - read some of them. 24 lectures notes including peek finding, and edit distance for dynamic programming etc.
Top code tutorials

Geek for geeks top 10 algorithms and data structures

Sunday, March 19, 2017

code review: Hackerrank kindergarten adventures

March 19, 2017

Problem statement

Code review is posted here.

C# code - still work on more test cases on API testing, Modify and Query.


Julia starts to learn binary index tree and segment tree through hackerrank university codesprint #2 in November 2016, she tried a few times but failed each time. She knew that she is better to work on the algorithm "kintergarden adventure" and learn from the algorithm.

She also did post the question on segment tree algorithm on code review to ask help on Dec. 10, 2016, and then the question "kintergarden adventure" was closed. Through the incident, Julia knew that she was afraid to learn by herself.

Julia is very comfortable at data analysis, so in order to figure out the algorithm, Julia chose to have some test case study, put together some data, and then taught herself what to look for through those tables.

Test case study

For example, there are 20000 students in the circle, and the first student only need to 0 minute to finish drawing, so that if the teacher starts from any students from ID = 1 to 20000, the first student can complete the drawing. SegmentTree class Modify API has to take the task to mark those 20000 nodes as value 1, it is not scalable for 3 seconds time limit, so that we can use up to logN intervals to cover the range of [1, 20000].

To make it simple, we assume that the range's width is 1024 instead of 20000, and see how many steps we need to mark in tree[]. Not up to 1024, but in the level of logN = log1024 = 10.

Here is the SegmentTree class Modify API: To understand the test case, in order to modify 1024 nodes as 1, we only do it in less and equal to 10 times, here is the two images to explain the detail.

The two variables of left and right are iterated from beginning to end 10 times, each iteration two variables's values are recorded in the table.

Let us get our hands dirty on this test case, RunTestcaseModify3() line 12, tree.Modify(0,1024,1). We look into the function call.

First row of table, left = 20001, right = 21024, since Modify API is called and function arguments: start = 0, count = 1024, value = 1,
read Modify API code line 5 and line 6, left is calculated as 20001 and right is calculated as 21024.

and more detail is here:

Action items

Review code review Hackerrank Modular Range Queries
Read the tutorial of segment tree.
Learn binary index tree from topcoder


This is the first time Julia started to use Microsoft Excel to do some test case analysis to help her understand the segment tree algorithm design.

All it takes is for her to have some patience. She read those two tables built by Microsoft Excel, and then she asks herself what is missing, what problems she can tell from those data. After a few times search, she comes out ideas to move forward her study.

code review: palindrome

March 19, 2017

Plan to spend 20 minutes to read this code review:

Calculate the number of palindrome numbers in the given ranges

Actionable Items

Study Leetcode algorithms:
Leetcode 347 - Previous practice
LC 417 - Pacific Atlantic Water Flow
LC 247   H-index
LC 402   

Saturday, March 18, 2017

A* algorithm

March 18, 2017

Plan to spend 20 - 30 minutes to read the code review:

A* search algorithm

Leetcode blog - reading is also a good learning

March 18, 2017


Julia knows that she should join the Leetcode discussion as early as in 2015. Now, she knows that her learning style has an important thing to improve, get involved with the community.

When she read the blog of this Leetcode, each one has references from Leetcode discussions. She finds that it is very good blog to read one by one. Most of explanation is written in Chinese, but she will write down notes using English.

Algorithm Study 

Algorithm - Segment tree, lazy propagation

March 18, 2017


Julia likes to invest 30 minutes to study Ahoy, Pirates! algorithm from this competitive programmer through her hackeerank contest experience, she usually studied the players and see what they share. She will find out the profile of Hackerrank and then she can measure how good the player is. Julia did some study on walmartLab codesprint last Oct. 2016 and she documented what she found.

She likes the article written called Advice For Beginners.

Also the writing of article is much better than 80% of Julia's blog. Julia likes the way the author using 3 different colors: purple, blue and red to construct a segment tree and explain the example. A lot of of hardwork, kudo for the author.

Algorithm study - Ahoy, Pirates!

Log of study history

1. March 18, 2017 - 2:14pm - 2:44pm

Good tool to use

Algorithm: All Possible Increasing Subsequences

March 18, 2017


Julia usually does some study after each Hacerrank contest, she mainly looked up the players and see what others are sharing. She will come back to review the blog, and this blog has 23 blogs on algorithm problems.

She likes to invest 20 - 30 minutes on one of algorithms and see how it goes. The time is from March 18, 2017, 1:47pm - 2:10pm. The algorithm is called All Possible Increasing Subsequences.

Read binary index tree wiki article.
Read hackearth binary index tree tutorial. (9:01pm - 9:20pm learn something here!)
Read geekforgeeks Count All increasing subsequences (9:30pm - 9:50pm)

Study one algorithm a time 

1. March 18, 2017, 1:47pm - 2:10pm. (could not focus, move on another algorithm)
2. March 18, 2017, 7:31pm - 8:00pm (mental workout, and try to learn binary index tree)
3. March 18, 2017, 8:00pm - 8:30pm

Summary of study

Not fully understand the algorithm. Move on! Just learn the binary index tree.

Self-balancing binary search tree

March 18, 2017


Julia read this article of binary search, and then she found the article is well-written and also the author brought up a topic called self-balancing search tree. So, Julia will start to read this wiki article, invest 30 minutes first time for the reading.

Article study 

Julia learns to read the wiki article slowly, she knows that in order to be able to give a good reference on codereview, JS1 always referred her to the wiki site. 

Take it seriously, be able to go over the wiki article first, write down new words to learn:


Popular data structures implemented this type of tree include:
2-3 tree
AA tree
AVL tree
Red-black tree
Scapegoat tree
Splay tree


self-balancing tree is the main competitor of hash table, since O(logn) almost good enough for most time efficiency compared to O(1), for example, n = 1000, n is the power of 10.

priority queues - implementation using self-balancing binary search tree
associated arrays -
key-value pairs

Line-segment intersection => sweep line algorithm => Hackerrank: Gridland Metro
Point Location => ?

Are you ready for this statement?
1. self-balancing BSTs have better worst-case lookup performance than hash tables (O(log n) compared to O(n)) <=? making sense?

2. but have worse average-case performance (O(log n) compared to O(1))

Log of reading history

1. Time: 1:11pm - 1:40pm, give 30 minutes for reading, March 18, 2017

binary search - a blog written in Chinese

March 18, 2017


Sometimes Julia likes to read a blog written in Chinese, this binary search article is well-written by a facebook engineer, graduated from Syracuse university. Julia tried to learn more about tail recursion, and a few other things discussed in the article.

Learning is fun, specially in Chinese. Julia will try to choose a few topics in the article and continue to do some research.

Study of binary search 

binary search in "Rotated Sorted Array"

Limitation of array operation, O(1) to look up but O(n) for deletion and insertion

binary search -> work on sorted array -> binary search tree -> self-balanced binary search tree


Time to read a blog written in Chinese- binary search - 30 minutes  ( ended at 1:03pm)
Read the article back and forth 3 times

20 minutes to read self-balanced binary search tree  (start:   end: )

Actionable Item

Read one more blog about management and leadership.

Friday, March 17, 2017

Code review: Longest common substring

March 17, 2017

Think about how to review previous practices on this algorithm, longest common substring.

Study suggestion:

Leetcode 340: longest substring with at most k distinct characters, read this implementation.

Leetcode 271: encode/ decode  - advice from top player.

geek for geek: Find k closest elements to a given value

Wednesday, March 15, 2017

Ask a Google Engineer - How do Innovative Ideas Get Approved at Google?

March 15, 2017

Watch the video 4 minutes 57 seconds, How do Innovative Ideas Get Approved at Google?

Actionable Items

Read facebook engineer Ider Zheng's blogs about how to work on algorithms.
S.O.L.I.D. principle blog.

Ask a Google Engineer - Managers at Google, feat. Fitz and Ben

March 15, 2017

Work on the video - 5 minutes 57 seconds talk, Managers at Google.

First round taking notes 9:50pm - 9:55pm

Do you feel well managed by your superior?

Traditional sense of the world. Traditional management, holdover from industry management, like
an assembly line.

For creative role, solve engineering problem. As a manager, serve you very well.

Move obstacles. Career moves direction.

The place expects you to self-driven. Treat you like an adult. Either you get work done, or you do not.

Micromanagement does not scale. Get next thing need to be done.

Give you trust -

Freedom is your responsibility - something is wrong ......

management culture is pretty cool.

You would be some one's mother. It is like a day care. Have you done your work yet?

Not many command and control.

If you fail, no one to blame.

Ask a Google Engineer - Career Path Working at Google, feat. Fitz and Ben

March 15, 2017

Study the video 3 minutes 6 seconds - Career Path Working at Google.

First round taking notes - 9:42pm - 9:44pm

Five years at Google now.

Never work anywhere more than 4 years. Do something else, more exciting.

Google 4 years come by without noticing. Keep learning, smart and interesting people.

I felt trapped. But in Google there are too many choices, narrow down. It is exciting. Any reason want to leave, too much fun.

It is about people. Mentor and work with them. New point of view. Always learn. Spend time on tech talk, work on design new thing, make things so exciting.

It is written in the textbook. Good culture, ...

Ask a Google Engineer - How to Work at Google: Prospective Employee Qualities

March 15, 2017

Watch a 4 minutes 22 seconds video - How to Work at Google: Prospective Employee Qualities?

Take notes:

First round: 9:24pm - 9:28pm

Two extreme cases:

One got Ph.D., but could not write 5 lines of code.

One works over 20 years on assembly, but forgot all theory he learned.

Google is looking for some one in-middle. Theory in their finger tip, and solid experience to write some good code.

We do not want some one working on something specifically. Look at resume about something generalist, put you in any project, he/ she can do very well.

Skills and experience will be very important. But internet world is a disrupt world.

Play well with others.

Something makes you stand out.

A lot of resumes look the same. Write something showing passion for computer science, or in general.

If this person is a millionaire, he does not need to work. If he is still interested to write some code.

If you are not passion about, you will not write code in your spare time.

Good fit, solid experience, you have done something outstanding.

9:28pm second round taking notes

extreme theory experience     vs    extreme practical experience
Work with some one with passion - need someone to work around

If you are not good at, you will not write code in your spare time.

Come from open source world, ....

Tuesday, March 14, 2017

Algorithms to review

March 14, 2017

Code review 

Julia came cross the coding blog about algorithms today, when she reviewed the quicksort.

She likes to do some research on those algorithms in the blog.

Actionable items:

Read a competitive programmer blog - 23 algorithms
Study the blog - 23 algorithm talks - try to understand 1 -3 algorithms

Code review: algorithms answered by JS1

March 14, 2017


Julia got great code review from JS1, and her most favorite code review is the one called KnightL on a Chessboard. Julia likes to prepare 2 week study, and she thinks that great teacher will educate best stduents. She tries to focus on learning from those algorithms in short future.

Julia knows that best algorithm teacher she has is on code review. Sometimes, she just realizes that her time is so limited and also she needs a mentor. She asked 29 algorithms questions so far, how many are answered by JS1? the number is 6.

Code review study 

Julia plans to read 30 minutes a time about those algorithms:

113 algorithms answered by JS1 - sorted by relevance.

61 program challenged reviewed by JS1.

116 algorithm marked on performance tag

17 C# algorithms

7 dynamic programming

161 Java language implemented algorithm

26 algorithms with time-limit-exceeded

Hacker rank: Journey to the moon

March 14, 2017

Julia decides to follow JS1's code review on algorithms, specially on hackerrank. 

Hacker Rank: Journey to the Moon (Graph Theory)

Code review: Hackerrank's merge community

March 14, 2017

Hackerrank's Merging Communities

Hackerrank - week of code 30

March 14, 2017

Work on Hackerrank week of code 30. Work on the contest as early as possible. Embrace the difficulty of medium, hard, expert algorithms as possible. Julia may not have chance to come cross anything so challenge in short future, just enjoy the contest to the full extent.

One game, one style. People start to know me. Where I can, where I place. So I tries to make more changes.

Follow up after the contest

March 20, 2017
Julia, if you decided to join the code contest of week of code 30, you should work on each medium algorithm at least 2 hours. Now you ranking is looking so ugly around 7406/ 10,558, because you did not spend time on medium algorithms at all, you should not give up because you have to work on other projects. At least you should show some efforts to score 20 - 30 point above medium algorithms. Otherwise you will never be an outstanding player being able to score more than 100 points. 

March 21, 2017
Julia, contest experience is not easy to go through, but you have to stay in the game. 

You can choose easy way to spend the weekend, but you cannot push yourself to next level that way as a programmer.

Google search keyword: competitive programmer burns out

Do more study on competitive programmer best practice!

Disadvantage discussion on Quora

Industry success related on Quora

How to prepare?  From gold medal winner of ICPC 

"From every 3 problems you solve, one should teach you something new. If not, choose them more carefully. Choose harder problems!

After you finish those 250 problems from SPOJ, you will have an overview of the main topics of competitive programming. By deeply 
understanding the logic behind basic algorithms, high-level algorithms will seem easy to understand. So you can rapidly leverage your knowledge."

Follow a google engineer on quora - Brian Bi 
Brian's Interview talk on quora.  

Cracking the code interview

March 14, 2017

Review previous research on cracking the code interview. And try to make a small improvement.

Cracking the code interview search result through the blog, it is here.

Monday, March 13, 2017

Quick Search - Julia's first answer on code review

March 13, 2017

Julia got a big surprise today, her first day work on code review to answer a question on quick search was selected as the answer today, after more than 3 months, she noticed that she got 25 reputation.

The code review link is here. She has to celebrate a little bit, it was a long time she tried to find some activities to help others while she is struggling to invent herself, keep up with others in this computer science technology world.

Julia searched her blog using quicksort, and then she found somethings to review related to quicksort.

Make it more memorable, Julia uses an image and music to celebrate her good working spirit.

Jessica Simpson - Take my breath away

When  Julia read this news, she was so excited, take my breath away, a little exaggerated, reminded her a song - the old lovely song, feels good to help others and make her own mark. One step a time, ...

Actionable Items

1. Read all algorithms in the blog, the blogger got Google and Linkedin offer. The algorithms may be a good study material for Julia.

2. Review the C# implementation of quicksort, write a new one.

Research at Google

March 13, 2017

Research at Google, 2:36 minutes video. Get to know some sicentists in Google research. Write down the scientists by name, and then look up Google, and make tonight's study more meaningful.

John Platt

Blaise Aguera - principle scientist

4 million view of TED talk - How PhotoSynth can connect the world's images      8 minutes
1 million view of TED talk - How computers are learning to be creative              17 minutes

John Giannano - VP of research

Dan Ramage

Tara Mcintosh

David Weiss

Rahul Skuth

Tania Bedrax

Cornna Cortes - the Head of Google Research, New York.

Emily Pitler - Using Tree Structures for Improved Dependency Parsing Algorithms 47 minutes

Tanis Bedrax-Weiss - How Google Might Top Search Results with Additional Information

Ask a Google Engineer - Challenging Tasks

March 13, 2017


Julia chose to study this 4 minutes video. How challenge the task in the google? What if you fail?


Fail early, fail fast - no stigma 

Some document you improve and learn - failure is a process you learn 

Task is challenging - too many challenging, which one is to choose? As a manager, he will advise what to look for.

Build an application - operate at scale, wrap your head around 

Software - failure, it is ok; it is a way to learn, iterate quickly; do not be afraid to learn again.

Google's culture - fail twice at same things -

2nd round notes taking - March 15 10:00pm 

Learn how to design in scale - pick up vocabulary etc. 

Ask a Google Engineer - Work, Happiness and Hobby at Google

March 13, 2017


Julia chose to study this 2:34 minutes video. Have a short focus talk, Julia learns something about Google culture.


Look for people - if he/ she has a million dollars, no need to work. But he/ she will still like to work here as an engineer.
Improving it - still need to work on more, focus on users.

Passion for the computer science - for fun, a billionaire, will work here.

Hobby, love my job - people you will work with, environment is still dynamic. If you create a product, launch it, you still need to continue to work on it.

Sunday, March 12, 2017

Ask a Google engineer - How Does Google Foster Innovation?

March 12, 2017


Julia spent time to work on this less than 2 minutes video.


20% time - 

innovative time - 

Ask a Google Engineer - The Work-Life Balance at Google

March 12, 2017


Julia likes this 5 minutes video very much. She likes to challenge herself everyday, study something new, and then look into more later.


Hiring people for long term - ongoing learning related to engineering team people
Work 40 hours

Very academic internally inside Google - 80 hours a week, it is not true in Google

Stay at work late - keep doing that, burn yourself out; too long too hard, it does not worth

Creative - not assembly line code, creative endeavor

Ask a Google Engineer - How to Noticed and Get an Interview at Google

March 12, 2017


Julia chose to study 4 minute videos about Google and how to be noticed. Julia chose one study topic this Sunday. And she thinks that the topic is decent enough and more rewarding.


Open source project - free internship for new graduate
focus on things you have done on your resume -
do not lie, or fluff your resume - Google will like to check and find out
Show some one really likes to write software
Going to top-tier school, get good grades, doing something over there
Make your resume stand out - people have done something, resumes are looking the same
Work on something in spare time -
Two qualities - good fit, solid experience

Hackerrank - woman codesprint #3 - Hackathon shirts

March 12, 2017

Problem statement

C# code submission in the contest, score maximum score 40.

She spent a few hours on Hackathon Shirts. She thought about test cases she should choose more carefully. Two algorithms are involved, one is merging interval algorithm, the other is binary search algorithm. Very good workout.

Facts to share

Julia still made a bug in her writing after 4 - 5 times to practice merging intervals as an algorithm. Why? Because she depends on her memory of the algorithm, do not start from the beginning of analysis, what test cases she should cover when she finishes the coding. She missed the previous interval end value, she should check maximum of two values instead.

rely on your past practices,
it is not to test how good your memorize the algorithm.
But always,
always start with 
the reasoning
test cases. 

Hackerrank - woman codesprint #3, elevator simulation

March 12, 2017

Contest performance 

Call it a day, 4:25am. Finally, after 4 hours writing code and dubugging, scored 18.00. Pass 7 test cases, fail 10 test cases. 8 runtime error, 2 wrong answers, Julia could not figure out and then she needs to go to sleep.

I never experienced this kind of coding, Elevator simulation, very good workout.

Julia, you should train yourself coding not in the contest. Julia enjoyed the adventure of coding this medium algorithm called elevator simulation. Julia could not believe that people can write the algorithm in less than one hour.

Here is the progress report, for the contest.

Follow up after the contest 

Here is the C# code submission in the contest.

Code Review of the function SimulationElevator

A few places have duplicate code, need to extra a new function for class WaitLine, Passenger, Trip, and then make the function SimulationElevator from 160 lines of code to less than 50 lines of code.

Saturday, March 11, 2017

Hackerrank - Woman Codesprint #3 - Choosing recipes

March 11, 2017


Problem statement

Julia spent over 3 hours to work on this medium algorithm, she finally figured out the challenge after 3 hours labor, and then she took this greedy approach only score 29 points out of maximum score 50.

Now it is 5:44pm, March 11, 2017. She has a few choices, continue to work on this algorithm, or move to next medium algorithm, and the last algorithm which is hard one.

Let us get some progress report here.

Choosing Recipes

Work on the Choosing Recipes algorithm starting from 11:30am - 4:13pm, very close to a workable solution.  It just took more than 3 hours to figure out the ingredient purchase only need counting once.

Once Julia knows the tough part of the algorithm, she took greedy approach and used recursive solution to make a quick points first, she made it 29 points, her algorithm passed first 7 test cases but failed test cases from 8 to 12.

Julia scored 29 points out of maximum score 50, at 5:49pm. There are still 14 hours to go, actually she has 6 hours before 12:00am. She has to make decision to continue on this algorithm, or move to next medium algorithm, last hard algorithm.

C# code review after the contest

Here is the C# code submission in the contest. 

Read the comment above the function of ChoosingRecipesMinimuCostGreedyApproach, "This algorithm is designed to take greedy approach, it will not guarantee the minimum cost for all n dishes". Julia did not aim for perfect solution, dynamic programming solution is still hard for her to figure out in the contest.

Need to look into how to improve reading skills. Julia did not notice the sentence impact on the algorithm correctness, read it slowly, think about how to catch it in first 1 - 2 reading. "she must purchase it at the supermarket; however, once she has an ingredient, she can use it in an infinite number of recipes." Julia did not pay enough attention to this statement and what it means for the correctness of the algorithm. She found out this after 3 hours working, it was too late but she was lucky to know to look for something important in the problem statement. There must be a good way to write down important things, good at coding should also be based on the good reading skills. Julia likes to put this more urgent issue to solve in short term.

Julia took 3 times IELTS tests in 2009 from June to August, but she did not have chance to train herself on reading skills from 2009 to 2017. Julia did some urgent patches to the problem in 2009, and the issue is still floating up after 8 years and catch her attention in more painful way.

Will do some research on ideas how to improve reading, specifically technical reading.

Coding interview problem: Least Disruptive Subrange

March 11, 2017


Spent 50 minutes on the video, Least Disruptive Subrange. Very good teaching and demo of using white board debugging. Julia always pushes herself to learn from people with graphics design experience, very good handwriting, layout of whiteboard properly etc. Julia is kind of sporty style - train insane or remain the same, try it very fast, and then comes back to get it more organized.

Julia is getting better day by day, she just wrote a question on Leetcode 125 and then she got response in less than 30 minutes and in 24 hours 1000 views, won a popular question badge, with 50+ reputation on code review site.

Take some notes here.

Train insane or remain the same - focus on training!

Hackerrank - Women's codesprint #3

March 11, 2017


Julia learned the importance to go out more often, and she chose to go to the meetup called the tech & startup weekly in downtown, so she spent time from 6:30pm to 8:00pm to meet people. Actually she started to work on the contest around 9:00pm.

But she still made a lot of errors, and took more than 3 hours to code the first medium algorithm.

Here is the progress she made so far, 3/11/2017  12:46AM. She will go to sleep and then after a good night sleep, she will try to work on the other 2 medium algorithm and one hard algorithm.

She finished the first 3 algorithm and solved all of them successfully, score 70.00 so far.

Hackathon Shirts

She spent a few hours on Hackathon Shirts. She thought about test cases she should choose more carefully. Two algorithms are involved, one is merging interval algorithm, the other is binary search algorithm. Very good workout.

Facts to share

Julia still made a bug in her writing after 4 - 5 times to practice merging intervals as an algorithm. Why? Because she depends on her memory of the algorithm, do not start from the beginning of analysis, what test cases she should cover when she finishes the coding. She missed the previous interval end value, she should check maximum of two values instead.

rely on your past practices,
it is not to test how good your memorize the algorithm.
But always,
always guard with 
test cases. 

Choosing Recipes

Work on the Choosing Recipes algorithm starting from 11:30am - 4:13pm, very close to a workable solution.  It just took more than 3 hours to figure out the ingredient purchase only need counting once.

Once Julia knows the tough part of the algorithm, she took greedy approach and used recursive solution to make a quick points first, she made it 29 points, her algorithm passed first 7 test cases but failed test cases from 8 to 12.

Julia scored 29 points out of maximum score 50, at 5:49pm. There are still 14 hours to go, actually she has 6 hours before 12:00am. She has to make decision to continue on this algorithm, or move to next medium algorithm, last hard algorithm.

Canada Leaderboard 

Julia, you are ranking top 3 in Canada right now. March 11, 2017 6:12PM Pacific Time. Work hard!

Tennis pro player - Svetlana Kuznetsova 

Study one tennis pro a time -

Svetlana Kuznetsova

Pain does not kill me, I kill the pain. The tattoo came out before her knee surgery in 2012

Thursday, March 9, 2017

Code review: Leetcode 125 Valid Palindrome

March 9, 2017


Julia wrote two blogs about her practice of Leetcode 125: Valid Palindrome.

Search the blog using Leetcode 125, first two blogs shows her over 10 time practice. So, she likes to review and write a C# version, and then post a question on

Code review

1. C# code to ask for review. Code reviews are excellent. Please take a look at the first review and second review.

Julia won her first badge - popular question, her question has more than 1000 view in less than 24 hours, and thanks for the moderator - 200_success.

Learning coding is so much fun to work with code review, Julia got her best advice and best teaching from her own experience of learning, she got code review from the moderator - 200_success.

Julia also learned some great tips to write a for loop, and her new school starts from here - one review a time.

Wednesday, March 8, 2017

Code review: short palindrome (dynamic programming)

March 8, 2017

Review the algorithm short palindrome in world codesprint #5, and write a C# solution using dynamic programming. Post a question for code review.

Previous blog about short palindrome algorithm.

Actionable Items

Read code monk tutorials.

Graph algorithms - minimum spanning tree

Tuesday, March 7, 2017

Leetcode 340:

Leetcode 340 - favorite solution:

Coding interview problem: Permutation Generator

March 6, 2017

Study the video - 31,210 views.

Actionable items:

Study leetcode algorithm one by one, so much fun to go over the solution. Julia noticed that she feels strong confidence in algorithm problem solving.

Go over Leetcode 31, 124, 166, 207, 210, 284, 340, 360, 406.

Leetcode 31

Leetcode 124

Leetcode 166

Leetcode 207

Leetcode 210

Leetcode 284

Leetcode 340 - favorite solution:

Leetcode 360

Leetcode 406

Monday, March 6, 2017

Jackson Gabbard - Intro to Behavioural Interviews

March 6, 2017


Very good coaching about behaviour interview. I just could not believe that I just came cross the video today and learned a few things through the video. Julia will take some notes, and look into his argument/ advice/ analysis.


Intro to behavioural interviews


1. culture

2. behavior interview

Do not wrap your weakness with some sugar coated ?

Satisfied - Not good - Good answer - Do not bullshit the question

Talk me one of your flaws:
Strength wrapped up - so hard work - concrete example to work too hard and hurt team etc.

Biggest success in previous work - what did not go well?
Be self-critical
Chance to catch him/ her out - throw the teammates under the bus

Be genuine -

The part about the sum your history 

understand your work history -

Stay at the same company 6 or 7 year, the smart interviewer will try to figure out that "is this person growing or top-out?"

CV contains factual things you have done

specific contributions you make - technical something
project tech lead, algorithm put-together
How good technical depth?
Get some signal - does that add up?

the part about why "we" are bad 

It is you to get a job, not get a job for your team.

Reveal you as a person - interview a person with a manager of 20 people and spent 90% of time to coding - not make sense

the part about money - behavior interview 

the part about communication ability 

assess your communication ability 

communication -

The part about collaboration 

Is this person all right? Is this person a successful collaborator?

Is this person hard to hire?

Talk about the time you and your team disagree something.

Healthy collaborator will move on, or it is critical thing and work on more. Build hatred towards team, their opinion ...

The part of passion ( in depth)

world record of something - you must have a great passion about something.

signal people may look for - make it success for the company


Be genuine - strongest advice 

Think critically about your own career, your intention to work for the company, self-awareness, why you want to be in this company? 

Own your strength and weakness - what you earn, what you fail, share them with interviewer. It will increase your chance to have the job. Fail public and successfully. 

The part to ask about tough questions 

Write your questions down. 

Sunday, March 5, 2017

The Google Boys - History Majors

March 5, 2017

46 minutes of video - The Google boys - history majors.

Two founders grew up academic family, the money making is not highest priority, learning, knowledge, teaching are most things instead.

Some statistics:
34000 times googlebot hits news website such as NSBC(?)

Sergin Brin & Larry Page: Inside the Google Brother's Master Mission

March 5, 2017

Study 28 minutes video, take some notes.

Google ad words - purchase ad words key ?
Index billions of url, explode -

Hire CEO - 12 - 14 interviews, business leader, with engineering background, 2001 - hire CEO - parental supervision
middle of 50, diplomatic

Expand Google news, google map, google earth

Google email - privacy - ads related to the email - concern about Gmail, privacy and trust

Purchase of youtube, Android etc.

Android system in 2007 - Apple did not like it.

Microsoft started to build starting from 2009.

Code review: Lucky number 8

March 5, 2016

Problem statement


Julia had a few submissions in the contest, she tried 12 submissions. Scores is an interesting array like this, [0, 2, 1.8, 3.6, 10.8]. The final version in the contest, a C# practice in the contest, scored 10.8 out of maximum score 19.80 30.

Lucky number 8 is the medium level algorithm in the week of code #28, Julia took the recursive function as an approach, in order to score more points, she wrote more than 450 lines of code.

Julia did not have too many choices in the contest, the dynamic programming approach is too difficult for her to figure out. Actually she was math major graduate, and then she just enjoyed the workout on this analysis. She was writing a "book" (a joke to verbose coding), actually computer science on hackerrank contest taught her a lesson - to be thrift on time to write code, if she can be ...

Julia spent some time to review hackerrank contest performance  and then looked into the issues of week of code #28, she took a look at the algorithm submissions, she was so surprised, my God, it is such a great workout on recursive function. This is like sports - but it is a time-consuming marathon. This is her first time to write a recursive function and spent more than a few hours, and experienced a little success. Cheers! Julia, good job, even it is 10.8, 30% of maximum score 30. Julia likes to call this algorithm with this submission with a beautiful name by Vancouver islands: Tufino, a vacation place she should take instead of going back to China, a popular summer place to visit whales from touring boats.

Today, Julia likes to show herself how to score maximum score. Learn a dynamic programming after she learned the lesson through the contest.

The most important is to work on the example 968 and figure out how to solve the problem to get the answer 3.

Lesson learned

450 lines of code using recursive function cannot beat 20 50 lines of code using dynamic programming.

In order to score more points in the contest, Julia continuously wrote more code until 450 lines. She had determination to make more points, she showed her passion to solve the problem.

Actionable Items

1. Read editorial notes:

In this problem, you are given a sequence of digits of length . You have to find the number of non-contiguous subsequences, such that the number formed by their concatenation is divisible by .
Observe a bit,
The number is formed by concatenating the non-contiguous subsequences, which implies that the number itself is a subsequence and vice-versa.
So the problem boils down to counting the ways you can make a subsequence divisible by . This can be done by Dynamic Programming.
At any position of the sequence, you need to consider two cases:
  1. Concatenate the digit at the position with your current subsequence and move to next position.
  2. Leave the digit and move to next position.
The idea can be coded with statesCurrent position and Remainder of the subsequence modulo 8.

2. Check all Google's employees' submission on this algorithm:
Study Java code first, write C# solution with comments.

Work on frequency table to help understanding the algorithm:

Read the above table, we can tell that numbers: 96, 8, 968 are 3 numbers to be divisible by 8, and we found the answer. Is that easy to follow this frequency table?

C# code for Code review is here. Extract a function, make other changes, this version of C# code is better for review, here.

3. Google keyword search:

states? Current position and Remainder of the subsequence module 8

4. Dynamic programming vs recursive function - check

Code review

Plan to make the code more meaningful, and then post a question on