Sunday, March 26, 2017

Code review: Hackerrank - count string

March 26, 2017

 Introduction 


Julia checked the blog stats and then she found out that last week there are over 70 60 views of the blog about Hackerrank: count string. So, she reviewed the 5 blogs related to the study of the algorithm, she quickly reformatted the blogs, and also plans to review the algorithm, and then post a question for code review.


Julia likes to learn something from Google, data driven. So, she makes decision what to review by blogger stats. She reviewed all five blogs related to count string algorithm quickly today, but she needs to reserve some time for a good review on algorithm itself.

Julia wrote 5 blogs in April 2016, this is the first blog. Julia failed to fix the issue to find those 5 blogs using search feature of blog, she worked on labels of those five blogs, somehow, it does not work.

Code review



Theoretic computer science: finding smallest k elements in array in O(k)

March 26, 2017

Introduction


Julia decided to join stackexchange.com theoretic computer science community today. And then she chose one study a time - finding smallest k elements in an array in O(k) time

Julia found out that after more than 24 month heavily working on Leetcode, code review and full time programmer job, she still has not developed the strong analysis of algorithm ability, she evaluated her study on Leetcode 312: balloon burst algorithm on March 26, 2017. It took her more than 4 hours to work on a hard algorithm using dynamic programming, but she still needs more time to play with some test case and figure out something fundamental. So, she decided to find a new school and make the changes.

She decided to join the theoretic computer science community and other communities like Math overflow etc. She likes to find some good thinkers in the computer science, so she can get some training on the analysis - problem solving area. She likes to read algorithms/ articles talking about more about analysis and how to approach a problem.

Algorithm Study 


Surprisingly Julia started to know more computer science theory and graph related scientist, professors and researchers. Cool, Julia likes to read the article with a lot of math formula, she like sto associate with those people who likes to express ideas using mathematical formulas. She feels at home and also like the intensity of learning.

Radu Grigore - spend 10 minutes to read a scientist resume

Google Hiring Best Practices

March 26, 2017

Introduction


It is 38 minutes video, and Julia likes to review the video again and take down the notes. She likes to know the more by taking notes, google search and come back in the future to review, since Google is hiring right people and is very successful, it makes good sense to learn from the Google. Do you agree?

Her blog about the video in January 12, 2016 is here.

It is not easy task to write down good notes, last time Julia did take notes but after 12 months she had to relearn everything, basically after the study, she did not continue to do any more related study, and she thought that Google is such a far-away-target company to study because she had never experienced anything, like a social event or tech event from Google before January 2017. She does not know that hiring success is leading to Google success.

So, Julia likes to start all over again; and then understand the difference.


Video Study


10:24/ 38:27
How to think, ask, keep asking, keep checking? Like a university, the university may not be a ivy league university.

Check yourself if you are fair, or this person will be super.

11:45/ 38:27
Question:  Panic hiring
Answer:
panic hiring never never works, take some time to hire/ behavior and hypothetical questions
ask the question from hypothetical question
begin - middle - end, how to check the performance, a lot of following-up question

Argument: behavior question
hypothetical question: you will see the reasoning, you will see the ...

15:52/
Question: Example of behavior questions
University student, how to approach the thesis

Answer:
Job specification, people do boolean search, craft the question based on your requirement
Based on what you need, what we launch in UK, how do you approach this?

18:32
Question: questions to show problem abilities

Answer:

19:52
Question:  shortlist the C.V.

Answer:

Huge number of applicants,
Job spec, run test on job spec, if there are a lot of unrelated applicants, then try to use different words in the job spec.

Good C.V., immediately see the impact of the person
Very jumpy, move around a lot; maybe it is ok, bring in to check
Something else jumps to you and are interested.
Entrepreneur, leadership in the resume

22:42
Questions:  problem solver

Answer:

Phone screen, 10 minutes quick check, what they do, and what they are looking for.

Good people know good people.
Networking, get into right events. Recommend people.

24:00
Questions: Intellectual curiosity
Manager got training to do right assessment

Answer:
Life bread, in terms of interview, refresh training
Big training - what are we looking for, criteria
Make people do shadowing interview 2 - 3 times
Give feedback on feedback
What they write on feedback - good analysis - clear analysis - strong enough or not.

27:00
Questions: interviewer training

Answer:

Legal requirement:  UK, 9 months requirement about written feedback
Be very conscious - gender bias on job post
Do not ask personal status, marriage status, religion, and sexual status
Guide away the talk

32:00
Question:

Answer:

Students are more likely to try something new. Within interview, you need to learn to sell. Key drive, not just money.

Go for low-hanging food?

33:00
Question:  background

Answer:

Legal requirement to do background checking.

Check Linkedin, company with; before the offer, after the interview, reference check, final exercise.
Phone them, give good references
Area you are related to in.

Google does not use agents.

Question: not working out

Answer:

Give them fair opportunities.
Senior people review, profile and check.
So much time to get hiring right.

Bring wrong person and so much time to correct them.

Leetcode 218: The Skyline Problem

March 26, 2017

Plan to study the algorithm - Leetcode 218: The skyline problem, hard algorithm

A few steps for the study:

1. Think about the solution by myself first, 20 minutes - 3:08 pm - 3:28 pm
2. Read one of the discussion on leetcode - most popular discussion first - 20 minutes
3. Watch the video of the skyline problem - Coding Made Simple - 22 minutes video

Actionable Items


Julia, you have to work hard. It takes time to work on hard algorithm, just work on one algorithm a time. Focus on thought process, and focus on easy and medium algorithms of Leetcode first.

Do not rush and enjoy the study. Most important skill to acquire is to be able to solve the problem if the hints are given. Be able to respond to hints, and have some reasoning and analysis.





Dynamic Programming - optimal binary search tree

March 26, 2017

Study optimal binary search tree on geeksforgeeks.com advised by Pepsi, similar solution to Leetcode 312: Burst Balloon.

Leetcode 312: burst ballons

March 26, 2017

Introduction 


Problem statement

Julia has some difficulty to figure out dynamic programming from the very beginning for unseen problems, so she likes to vote up virtually 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, 2:40pm - 3:00pm)
Continue to read Leetcode discussion (March 26, 2017, 12:00pm - 12:30pm)

Thinking process


Continue to read Leetcode discussion (March 26, 2017, 12:00pm - 12:30pm)

Julia is getting smarter, she starts to read more discussions from Leetcode discussion instead of blogs written in Chinese, she values the discussion with vote systems.

Discussion with over 400 up-votes - link is here.

Divide and conquer   vs  reverse thinking

Continue to write C# code using sample code (March 26, 2017, 12:30pm - 12:58pm)

Julia's C# practice, pass all Leetcode test cases. Code link is here.

It is not easy to figure out the dynamic programming solution the first time, what I can do is to read the leetcode discussion again, and follow the thought process, from recursive function, naive solution first, and then try to move to next stage.

Notes from discussions:
1. Coursera - algorithm 2 - optimal binary tree DP problem
2. GeekforGeeks algorithm - optimal binary tree DP problem

Thought process rehearsal 


Julia likes to follow up the thought process closely. That is most important part to learn, how to approach the problem naively first, and then move forward with the hints, and problem solving skills.

The most naive idea the backtracking

We have n balloons to burst, which mean we have n steps in the game. In the ith step we have n - i balloons to burst, i = 0 ~ n - 1. Therefore we are looking at an algorithm of O(n!). Well, it is slow, probably works for n < 12 only.

Well, we can find that for any balloons left the maxCoins does not depends on the balloons already bursted. This indicate that we can use memorization (top down) or dynamic programming (bottom up) for all the cases from small numbers of balloon until n balloons. How many cases are there? For k balloons there are C(n, k) cases and for each case it need to scan the k balloons to compare. The sum is quite big still. It is better than O(n!) but worse than O(2n).


Better idea using recursive and memorization or DP


We then think can we apply the divide and conquer technique? After all there seems to be many self similar sub problems from the previous analysis.
Well, the nature way to divide the problem is burst one balloon and separate the balloons into 2 sub sections one on the left and one one the right. However, in this problem the left and right become adjacent and have effects on the maxCoins in the future.
Then another interesting idea come up. Which is quite often seen in dynamic programming (dp) problem analysis. That is reverse thinking. Like I said the coins you get for a balloon does not depend on the balloons already burst. Therefore instead of divide the problem by the first balloon to burst, we divide the problem by the last balloon to burst.
Why is that? Because only the first and last balloons we are sure of their adjacent balloons before hand!
For the first we have nums[i-1]*nums[i]*nums[i+1] for the last we have nums[-1]*nums[i]*nums[n].
OK. Think about n balloons if i is the last one to burst, what now?

We can see that the balloons is again separated into 2 sections. But this time since the balloon i is the last balloon of all to burst, the left and right section now has well defined boundary and do not affect each other! Therefore we can do either recursive method with memoization or dp.


Final


Here comes the final solutions. Note that we put 2 balloons with 1 as boundaries and also burst all the zero balloons in the first round since they won't give any coins.

The algorithm runs in O(n3) which can be easily seen from the 3 loops in dp solution.


Video Study



Watch the video - burst balloons.  (March 26, 2017, 11:15am - 11:30am, 2:40pm - 3:00pm)

19:08/ 27:01

Burst balloons to maximum value, Julia copied and paste from the video:



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

Introduction


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

Introduction

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


Introduction 

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

Introduction

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

Introduction

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

Introduction

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

Introduction

A few things Julia likes about Coding Made Simple on youtube.com. 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

Introduction

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

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

Introduction


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

Inspiration


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

Introduction


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

Introduction

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 


http://mathurl.com/


Algorithm: All Possible Increasing Subsequences

March 18, 2017

Introduction

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

Introduction


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:

Implementations 

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

Applications

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

Introduction

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

Statistics 

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 -

Fail
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

Introduction


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

Introduction

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

Study 

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

Introduction

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

Study 

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

Introduction

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

Study 


20% time - 

innovative time - 

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

March 12, 2017

Introduction


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

Study 


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

Introduction


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.

Study 


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.

Julia,
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

Problem statement

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.

First revision 


April 3 2017
Julia spent over one hour to code review the submission on April 3 2017. The C# code is here. Plan to spend some time to review the design, try to pass all test cases. And then ask a code review on stackexchange.com.


Follow up 


March 14, 2018

I got an email about object-oriented design code review request from the peer in the morning 2:30 AM. so I gave some feedback. My main idea is to get into a community like hackerrank, and also being a hacker, and have some warrior spirit.

Here is my review.