From January 2015, she started to practice leetcode questions; she trains herself to stay focus, develops "muscle" memory when she practices those questions one by one.
2015年初, Julia开始参与做Leetcode, 开通自己第一个博客. 刷Leet code的题目, 她看了很多的代码, 每个人那学一点, 也开通Github, 发表自己的代码, 尝试写自己的一些体会.
She learns from her favorite sports – tennis, 10,000 serves practice builds up good memory for a great serve. Just keep going.
Hard work beats talent when talent fails to work hard.
"In addition, I have written several articles on my website that are popular with students. For example,
my article on advice for applying to Ph.D. programs [2] has over 45,000 page views, advice on applying
to graduate fellowships [3] has over 95,000 views, and professional email writing tips [4] has over 42,000
views. I receive dozens of emails each year from students around the world asking for advice; I try to
answer as many as I can and then update my website articles to share that knowledge."
Small research topic: how WTA, ATP players motivate Julia to work hard in 2016. Julia enjoyed tennis from 2012 - 2014, she spent whole day on the tennis court if possible, she enjoyed the time and also tried to lose as much weight as possible, built as much muscle as possible. But, then in 2015, she started to catch up on Leetcode algorithm problem solving. She has to watch out the efficiency of workout, deal with tennis elbow, muscle pain etc. issues, meanwhile, she studied a lot how professional players do their business.
Things she learns:
1. How players focus on the training, matches?
2. How players are working hard on their physical fitness/ strength training?
3. How good/ relax players are touring the whole world? work with coaches and peers?
Julia follows a lot of WTA, ATP players. Just 3 months ago, she started to follow Karonlina Pliskova.
On the inside of his left arm are the words of poet Samuel Beckett: Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better. He did his tattoo in 2013.
Actually, the failure is most important part as a professional player. There is only one champion. So, there is a ranking system, players have to work hard to maintain the ranking in top 100.
Try, fail, try again, fail again, fail better. The idea of fail better is to help yourself also others. Build up a very good ritual to do training.
3. Julia learned DFS/BFS algorithm through HackerRank, she found the joy to read code and try to write one for every different idea.
4. Being a programmer, it is hard to control your luck. But HackerRank contest looks like more controllable. More practice leads to more medal. Julia likes a silver one next time. <- Nothing is impossible! top 12%. Julia tried to stay overnight Saturday night, get in top 600/ 12%. Fun facts: 1. More than 5 computer professors / score range: around 200 score, silver medal, 230 - 270 ranking. 2. Julia, work hard, try some difficult level algorithm day by day. Blog review:
1. http://juliachencoding.blogspot.ca/2016/04/talk-about-coding-performance-concerns.html
Warm up the topic:
Benefits:
1. Reduce stress to write and also maintain the code
2. Build a good habit to write/ refactor code/ design concern/ thinking logically,
3. Amazon leadership principle: internal customer support -> external support, high standard, genesis of AWS - from infrastructure support to AWS
Insist on the Highest Standards
Leaders have relentlessly high standards
Train to be a leader.
End of warm up
On Sept. 12 evening, spent 2 hours reading code smells -
Read the boook "refactor " http://goo.gl/8r2AJO
Code smells:
Refactoring: Improving the design of existing code
Chapter 3: Bad smells in code:
Duplicate code ()
Long method ()
Large Class
Long Parameter Lsit
Divergent change
Shortgun surgery
Feature Envy
Data Clumps
Primitive Obsession
Switch Statements
Parallel Inheritance Hierarchies
Lazy Class
Speculative Generality
Temporary Field
Message Chains
Middle Man
Inappropriate Intimacy
Alternative Classes with Different Interfaces
Incomplete Library Class
Data Class
Refused Bequest
Comments
Julia's note: apply separation of concern, abstraction level -> go to various abstraction level -> various functions, main
concern/ trivial jobs;
main target is to cut time to short, leave time for second question, or things to ask.
5 minutes costs a job - in other words, give different priority for different tasks -
45 minutes interview time / 25 minutes is a threshold - do not push over 25 minutes, leave 20 minutes for something more
meaningful - prepare questions to ask/ figure out if you are best fit/ what is biggest hurdle to overcome
Sept. 11, 2016 Plan to find time, at least 30 minutes, warm up the algorithm next week first, and then, continue to work on this advanced problem - suffix array, LCP, two pointer techniques.
Sept. 9, 2016 Small research for a blogger, how to convert the blog to pdf file? First pdf book Julia wrote - over 780 pages - 12 months / 9/8/2015 - 9/8/2016. Motivations: 1. Prepare for a trip Julia plans to take vacation from Sept. 29 - Oct. 16; but in China, google/ Gmail/ blogger is blocked, no access. 2. To share the blogger to friends in China is impossible, convert it to pdf first. 1. How to convert blogger to pdf? http://www.slideshare.net/fionabeal/convert-your-blog-to-a-pdf-and-a-word-file
Sept. 7, 2016 Review performance of coding contest on HackerRank: Log of performance - HackerRank world code sprint #4, #5, #6, from score 40 to 100; in other words, from nothing to the first bronze medal. Excellent experience. Spend some time to review the performance of 3 contests Julia did from June to August 2016. No. 1: world code sprint #4- score 40/?, bet on algorithm AorB (medium level), HackerRank: AorB - intense workout - 3 hours+ - score 0 of 50, 5+ hours. No. 2 world code sprint #5 - forgot to attend, worked on the algorithm next day. Finished first 2 questions, 40/430, spent time to read all questions - read 1 expert question, 2 advanced questions, 1 difficult, 2 medium. Just enjoy all the questions by reading the problem statement again and again, 3+ hours. See how many things she missed in every reading, every new thing she found through one more reading. She wrote one of her most popular blogs: 3+ hour struggle to score 13/ 40, so enjoyable. (145 views up to Sept. 16, 2016, including herself to edit the blog) http://juliachencoding.blogspot.ca/2016/07/short-palindrome-hackerrank-world.html No. 3 world code sprint #6 - score 100/380, first 4 algorithms full score, worked on 5th algorithm - Bnetrousel (medium level) more than 3+ hours, score 0 of 50. Bronze medal, top 25%. Tried to get into 10%. She did not know that time 10% means silver medal when she worked on the algorithm. Analysis of performance: Julia must have learned a lot through the practice of those 3 world code sprints; she never expects that she can be one of people having some medals with HackerRank so soon - from June to August, 2016, 3 contest practice. 1. Most valuable experience from world code sprint #4, June 26, 2016 http://juliachencoding.blogspot.ca/2016/06/hackerrank-aorb-interesting-struggle.html
She learns that in order to perform in less than 30 minutes, she must work on the small, simple, well-defined problem from the very beginning. 30 minutes beats hard-working 8 hours. First time, she experienced two approaches with over 10 times performance difference (0.5 hour vs 8 hours). She likes to make the smart choice every time ever since.
2. Most valuable experience from world code sprint #6, August, 2016
Time complexity analysis. It does not matter if queue/ stack/ recursive function is used in the design, most important is to analyse time complexity first - from brute force to optimal, try to target the optimal time complexity. Mathematics is so important to the problem solving, it does not matter if the math is so easy, how hard to figure out. Know the time complexity range, brute force vs optimal solution; aim high target! play to win!
Most favourite tip fromhttp://juliachencoding.blogspot.ca/2016/09/8-tips-coaching-tips.html: Rather than performing perfectly, perform to see improvement (10 out of 10) Focus on the Journey, not the Destination (9 out of 10) Recognize when you are using negative self-talk and replace it with positive (8 out of 10) Actionable items: 1. Set long time goal - attend more contests, try to score 200 points one day. 2. Finish competitive programming book - 150 pages. 3. Go over Leetcode questions one by one, by reading the solution.
Borrow some tips from tennis coaching, try to apply coding practice, algorithm problem solving practice, programming contest.
Memorize 8 tips to help you to perform to your highest potential in Tennis (? code practice, etc.): 1. Let go of what others think 2. Perform for yourself, not to impress or to "not disappoint" others 3. Accept that you will make mistakes, and let them go 4. Focus on what you can control 5. Recognize when you are using negative self-talk and replace it with positive 6. Rather than performing perfectly, perform to see improvement 7. Be objective about your performance, not subjective 8. Focus on the Journey, not the Destination 9. Celebrate your success 10. Stay at the moment
- Julia likes to calm down quickly when she gets nervous. When she has a negative self-talk, she will remind herself - "Everyone faces challenges on court and I'm no different." Replace with positive self-talk.
Add time complexity and auxiliary space detail:
Time Complexity : Inserting all the words in the trie takes O(MN) time and performing a walk on the trie takes O(M) time, where-
N = Number of strings
M = Length of the largest string string
Auxiliary Space: To store all the strings we need to allocate O(26MN) ~ O(MN) space for the Trie.
Learn from sports training -
Do some research how professional players conduct training.
Personal story to warm up the topic
Early in 1998, in Florida state of USA, Julia suffered first back pain injury because she did not exercise regularly, she could not turn one side if she lies on the bed without using her arm to help, over 1 week; In 2001, she suffered a few back pain incidents as well.
Since 2011, Julia started to play tennis regularly, invest time to do some research on fitness, nutrition. She did not have back pain anymore, because if she sits too long for a few days, she knows that back pain will come back; she takes breaks to play tennis for a few hours, a lot of running, a lot of tennis forehand swing and backhand swing, and other conditioning exercise. Hour spent on tennis, 500+ hours (Just guess, last 5 years)
So, it is important to change the life style, play more sports, be more healthy.
Now back to the topic.
Sports training / Coaching
Julia always learns from professional tennis players, how they handle training, work with coaches, and handle difficult time as a professional player up-and-down in ranking etc.
She learns from sports, always prepare, get more training before she works on a new project in her career.
Through her tennis training, she learns from her most favorite tennis players - Angelique, Maria Sharapova, Ana, through training videos. She starts to examine her training, discipline herself, use a variety of tools, work on more warming up etc.
Sharapova training video
Ana trainging before tournament, 15 minutes warm up using medicine balls, and all other routines, using elastic strips to stretch arm muscles etc.
More training videos: (Ana Ivanovic)
Fast activity, lower center gravity, a lot of drills - work with ladders, tones, fitness trainer, stretch etc.
Fitness, coordination, strength, balance, speed, - scott byrnes - strength and conditioning coach
3 coordination - head and eye coordination
Prevent injury - structure in your training
Sept. 5, 2016 Once a while, Julia likes to do some research on the tennis sport. She tries to educate herself, knowledge about her favorite tennis sports, and also get educated with interview talks, and smart challenges like choosing a double partner in the tennis sports. Here are 5 things she chose to work on:
Angelique Kerber interview after US Open 2016 3rd round
coaching - onsite coaching - WTA 2008 No. 1 player
underdog big surprise - US open 2016 4th round - Luca Pouille
5 minutes tour of central park by your favorite winner
how to choose competitive partner - after WTA double player top 1 made a cold call
Let us have some sports talk in this blog:
1. WTA No. 2 Angelique Kerber interview after US Open 2016 3rd round
1 year ago, none of second week of big tournament
last few months, going to No. 1.
Improvement in attitude:
Try to enjoy the game, less nervous; bring out best performance
About No. 1 ranking, how do you think about itÉ
Focus on next game. A long way to go.
1. How to coach best top performer in real life? 2008 WTA No. 1, Ana Ivanovic. Don't know what to do? Be clear on your head. Execute your game plan. ..., Let us get rhythm back. Come on. https://www.youtube.com/watch?v=qiR5M_7FJd8
How to beat 16 14 grand slam champion in US open fourth round?
Be aggressive all the match.
What is the game plan?
Just enjoy the match, as a player. It is a game, you have to enjoy it.
How do you draw a line between enjoying something and be fierce and be competitive?
You want to win.
I have a chance to win. Be aggressive. Otherwise, you will run, run, run to death.
Coach told him, you will make a lot of mistakes, but you will also make a lot of wins.
Take his chance to win match point in tie-break match.
Question: New York vs Australia grand slam?
Keep things simple; loud everywhere.
Plan something, 2 hours extra
Question: Pressure level? After first grand slam win, before and after?
To find the middle ground. Recall the feeling of first round retiring, or get grand slam.
Question: about Ranking, approaching No. 1 Try not to put pressure on myself - talk about No. 1, kid`s dream. Step by step, we will see.
Question:
In the past, too much pressure on myself; I lost a lot of matches; Try to focus on other things.
2. How the top performer works with the coach outside the court and on the court, live matches?
3. Study the website:
The desktop version/ mobile version, the art, layout, and also organization of structures/ different sponsors, very good design.
It is the labor day long weekend, spent 3 hours (6:30am - 10:00am) to read suffix array from this favorite competitive programming book, and try to please herself, a new goal - score any point with suffix array work or LCP (even cannot remember the full name - called longest common prefix array), HackerRank practice or code sprint.
It is a lonely journey - reading the book, but it is perfect for physical recovery - muscle and bones -
laying on the bed with the excellent one night sleep, just after 3+ hour tennis sports, and do not want to move, read a book.
Yesterday, Julia warmed up more than 1+ hour, one single match, one double match lasted more than one hour, until tie break. She lost double with 5 to 7 lost the match. She suffered tennis elbow pain issues.
The competitive book about suffix array:
6.4 Suffix Tree and Suffix Array - page 114 - 119
Motivation talk
1. suffix array - who did the research to introduce the term - suffix array in 1993?
Play with some code first, get solid understanding suffix array - what are the benefits using suffix array? Shorten time complexity -
suffix tree -> suffix array -> sorted array -> LCP - longest common prefix
Arguments:
1. Building efficient Suffix Tree under contest environment is a bit complex and risky
2. Suffix Array invented by Udi Manber and Gene Myers, has similar functionalities as Suffix Tree but simpler to implement, especially in programming contest setting
3. ...
Facts:
1. Suffix Array is an integer array that contains indices of sorted suffixes
3. Keyword in context (KWIC) Given the suffix array, easy to search for a string or sentence via binary search. Memory is linear. Search is O(K log N) where K is the length of the string you are searching for. (Can be done in K + log N by using the lcp array.) study the code:
- Julia likes to calm down quickly when she gets nervous. When she has a negative self-talk, she will remind herself - "Everyone faces challenges on court and I'm no different." Replace with positive self-talk.
First thing in the morning, this Sunday, labor long weekend, Julia read the book about "competitive programming. She read the book -
page 112,
6.3 String Processing with Dynamic Programming
6.3.1 string alignment - edit distance
Using Dynamic Programming, she was amazed that how good the solution is provided in the book. She read aloud the analysis and solution word by word, sentence by sentence, a few times. So enjoyable experience.
Julia plans to train herself to improve her skills - project management skills. As a programmer, she learns that the contributions of a single programmer can do. As an old saying, a great programmer can beat a five or six ordinary programmers, maybe a team.
To prepare herself, prepare early, prepare continuously, she likes to push herself read, memorize APIs, before she writes the code. She values the training, every lesson she learns from the training, all kinds of activities.
Case study:
One project she likes to work on is to build up a website for most of mobile users. She starts to read and write down notes about mobile phone, commercial, marketing terms about new release mobile phone.
A list of preparation for the mobile website:
1. study latest mobile phone products, learn market terms: such as retina display, human eye - 300ppi
2. a few months to learn Angular JS, MVC, entity framework etc.
3. JavaScript training
4. CSS training
5. Write bug free, solid code
Julia is looking for a book talking about suffix array etc. advanced data structure. She found one today. Write down some great ideas after reading. 1. 10 terms Julia's favorite from the book: 1. Simple array that is pre-preprocessed with Dynamic Programming - Data Structure term (page 7) 2. Page 11, a form of Hash Table - ‘Direct Addressing Table’ (DAT) 2. Page 8 Question: 2. Given a list of integers L of size up to 1M items, determine whether a value v exists in L? (More details in Section 2.2.1). Page 16 - Balanced Binary Search Tree (BST): C++ STL <map>/<set> Java TreeMap/TreeSet argument: implement a bug-free balanced BST like AVL Tree or Red-Black (RB) Tree is tedious and hard to do under time constrained contest environment. 3. Look into those typical problems, first, remember the terms - Page 17 - Page 18 Spend 30 minutes for each problem - warmup, and get traditional problems into daily routine - talk, warmup, and study some implementation using C# as well. (9/11/2016 - 1:21pm) Programming exercises to practice using basic data structures and algorithms (with libraries): • Static array, C++ STL <vector>, <bitset>, Direct Addressing Table 1. UVa 482 - Permutation Arrays (simple array manipulation) 2. UVa 594 - One Two Three Little Endian (manipulate bit string easily with <bitset>) 3. UVa 11340 - Newspaper (Direct Addressing Table) • C++ STL <algorithm> 1. UVa 146 - ID Codes (use next permutation) 2. UVa 10194 - Football a.k.a. Soccer (multi-fields sorting, use sort) 3. UVa 10258 - Contest Scoreboard (multi-fields sorting, use sort) • Sorting-related problems 1. UVa 299 - Train Swapping (inversion index3 problem solvable with bubble sort) 2. UVa 612 - DNA Sorting (inversion index + stable sort) 3. UVa 10810 - Ultra Quicksort (inversion index - requires O(n log n) merge sort) 4. UVa 11462 - Age Sort (counting sort problem, see [4]) 5. UVa 11495 - Bubbles and Buckets (inversion index - requires O(n log n) merge sort) • C++ STL <stack> 1. UVa 127 - “Accordian” Patience (shuffling <stack>) 2. UVa 514 - Rails (use <stack> to simulate the process) 3. UVa 673 - Parentheses Balance (classical problem) 4. UVa 727 - Equation (Infix to Postfix conversion) • C++ STL <queue> 1. UVa 336 - A Node Too Far (<queue> used inside BFS, Section 4.3) 2. UVa 10901 - Ferry Loading III (simulation with <queue>) 3. UVa 11034 - Ferry Loading IV (simulation with <queue>) • C++ STL <map>/<set> 1. UVa 10226 - Hardwood Species (use <map>) 2. UVa 11239 - Open Source (use <map> and <set> to check previous strings efficiently) 3. UVa 11308 - Bankrupt Baker (use <map> and <set> to help managing the data) 4. UVa 11136 - Hoax or what (use multiset in <set>) • C++ STL priority queue in <queue> 1. UVa 908 - Re-connecting Computer Sites (priority queue in Kruskal’s, Section 4.4) 2. UVa 11492 - Babel (priority queue in Dijkstra’s, Section 4.5) 3. LA 3135 - Argus (Beijing04) Find a website about Ultra quicksort: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1751
Code reading first, coding writing follows. So Julia designs a drill for her to work on Leetcode algorithm daily. Just use Visual studio to go over the best code in C++ for Leetcode solution, written by a computer science Ph.D.. Find the best code (so many solutions, this one definitely is top 1 in thousands), use the code to train herself in the thinking.