Showing posts with label be a good thinker. Show all posts
Showing posts with label be a good thinker. Show all posts

Sunday, July 9, 2017

Am I good programmer?

July 9, 2017

Introduction


It is exciting to spend 30 minutes to do some research at the night of Sunday. The topic Julia chose is "Am I a good programmer?". Julia likes to be very competitive hackerrank contest player, good at computer algorithm and data structure. But also Julia likes to be a leader, enjoy the journey by sharing her struggle, learning process of hard topic on algorithm, data structure. How does she advance herself as a software programmer, learning as a system designer, and she also likes to pick up other skills. Like good humour, strong and healthy physical body and strong mental toughness, and good sense of humour, master a sports - tennis.

Julia made a few choices, chose to work on Leetcode algorithms, work on the coding blog, work on code review, Leetcode discussion. 


It is hard work to reinvent myself as a software programmer. Julia spends last 3 months to meet people and conduct mocking interview, in her career as a full time programmer last 7 year, it is the first time she starts to learn how to work with a peer through 60 minutes time range. She wrote a blog about common mistakes in mocking.

Last weekend Julia spent more than three hours to watch the show on netflix called Quantico, the actress Priyanka has more than 17.9M followers on twitter. Julia likes to spend some time to read how the actress develops skills and build a good connection with peers. The actor Jake wiki page is here.

Coding, learning algorithm, reading and also mocking, Julia starts to get good habit to practice daily. But it is better to take Sunday off . Say no to algorithm and data structure, mocking interviews on Sunday, learn to relax more in the summer. Also Julia has to spend time to work on the sponsor application project.

Julia still calculates how much time she spends on the internet in the week days, she did waste a lot of hours. Instead she should plan better to work on more meaningful activities, like attending Sunday church service, get connected to friends and family, play more sports like tennis single matches, make life more fun and exciting.


Study topic 



It is the great experience to serve 8000 views last month. Most of time the blog serves Julia very well, she has chance to keep tracking of her progress on algorithm and data structure, and also keep her motivated and focus very well. So far there are over 150,000 views on the blog.

Over 10 years ago, Julia spent over 3 months in 2006 to study how to apply teaching job but she never got too far. She remembered that the bible verse teaching about seeds, how to grow the confidence. Seed and soil, Matthew 13 - The Parable of the sower.


Julia spent whole month in the city of Canada, so 25% traffic is from Canada. In other words, Julia serves 75% traffic for other people while she enjoys her own blog with 1700 views. 



By integrating Leetcode with mocking interview algorithm, Julia also learns to serve other people, help herself as well to learn better on algorithm and data structure. Here is the list of Leetcode algorithms last 3 month Julia worked on. Also 30% of peers were happy to connect Julia on linkedin, total count is 33. 

The mocking interview totally changes the view of Linkedin, for a long time, Julia found out that she does not have time to get connected to people face-to-face, work on something together. 


Let us look in LinkedIn statistics and figure out something here as well. 


Julia spent time on mocking interview last 3 months, 90 mocking takes 90 hours; And Julia worked on related Leetcode algorithms more than 30 hours. She added 33 new Linkedin connections, total 201 views, 15% traffic is related to the new connections. 26 found you via Who Viewed Your Profile, in other words, Julia did some study on linkedIn profiles, 10% traffic is related to the activities. 75% traffic of 150 views are random traffic, Julia could not control and make some influence on it. 

Last 3 months Julia did not spend a lot of hours on code review. Here is her profile:


Julia found her most favorite website to study and get great ideas for algorithm, and learn C# programming, for example, C# class SortedSet is good to start. . It is called Leetcode discussion board. Here is Julia's profile on Leetcode discussion. 
A few issues needs to be addressed, but Julia will find time to solve them. 


Leetcode algorithms


Last 90 days, Julia worked on 52 leetcode algorithms. Here are the list:

52 Leetcode algorithms 

8, 10, 18,  23, 33,,37,,39, 44, 45, 47, 48, 54, 55, 57, 69, 72, 76, 78, 79, 114, 121, 122, 123, 128, 140, 151, 153, 189, 212, 220, 239, 295, 300, 416, 459, 480, 516, 551, 572, 575, 582, 591, 605, 606, 609



Monday, June 27, 2016

A small research on HackerRank world sprint #4

June 27, 2016

 On Sunday June 26, Julia spent 3 hours to do some research, evaluate where she is in the competition, and what kind of target she can set, how to reach the target next time. Actually she went through current leadboard, and study who are best players, top-performance programmers.

Statistics:
Time spent on HackeRank world sprint #4: 4+ hours on June 25, 2016
Score: 40, around 2276 rank in over 5000 people.

Target: 
She needs to score another 50 - 100 in order to be competitive, where she found out that some Google, Facebook employee score' range (above 100, some above 140).

Top 16 - full score (420), there are a lot of world champions over there. So, the problems have some pattern, people can get trained to be good at them.

 Here is the link of HackerRank world sprint #4.

 https://www.hackerrank.com/contests/june-world-codesprint/challenges

 She completed first two easy algorithms in first 2+ hours. Get 40 points.

Gamble the luck is not a good strategy. Set low target is also not a good strategy. 4 hours can be spent on more meaningful learning experience. 

Why? 
Julia spent most of time to work on one problem, AorB, try to score another 50 points. She enjoyed coding and found one problem after another, but it is time-consuming, not efficient approach.

In first hour, she needs to write down every small function she should solve first, and then, design well-defined small function to be helpers, understand possible test cases. Simple problems are easy to work on, save time.

Some problems were discovered after she worked on the problem almost 4+ hours. Julia, you have to learn to be a good thinker first, force yourself think hard on first 30 minutes. Write down things to consider in design of function.

1. What is the problem she found out after 3+ hours?
The solution has problem, Hexadecimal should be reversed first, then, first char is least significant bit, much easy to iterate, compare among A, B, C. Mistakes like A, B, C to compare different bit, not align properly.

2. What is the problem she found out after 4+ hours?
how to make A as small possible? 
Provided with extra allowed bits, Give up 1 from A (1->0), by the order of most significant bit first, and then, set B's bit to 1 if need. 

3. What is the problem she found after 8+ hours? 
A|B = C, so C's length as string should be longest one. C's length = Math.Max(A.Length, B.Length). This helps the design and also testing. 


From 12:00pm - 12:00am, she spent a lot of hours to play with code, until midnight, she gave up AorB, scored 0 with many hours passion/ learning experience/ lesson learned.

Lesson learned: 
Passion does not work, good workout; but not practical. 
Break the problem into 5 - 6 well defined small functions;
First 30 minutes, be a good thinkers. Find all possible problems, assertions, read problem statement again and again. (make sense? :-))

Write a few small functions to warmup, fully test with test cases. 2 - 3 hours.
For example, work on this small well-defined function first,
http://juliachencoding.blogspot.ca/2016/06/hexadecimal-or-calculation.html
https://gist.github.com/jianminchen/5442cb579b13ffc203ce89b3e54e8a36

And then, spend 1 hour to put together for solution AorB.

The best performer in the world (172minutes/7 algorithms), average less than 30 minutes/ algorithm.

Good about the practice:
Practice code on problem solving: 
1. reverse a string in C# -> ToCharArray() -> IEnumerable first
2. check least significant bit using And 1 (bit manipulation)
3. check most significant bit using And 1 - define value array {8,4,2,1}
3B: leftshift >>1 in C# practice
4. Hexadecimal char <-> binary format string <-> integer value expression
5. int, long, bigInteger(?) cannot handle big number 10^5000, force me to work on string manipulation
6. Look into C# const keyword, how to separate variables - using existing variable, set new value, less code.
7. StringBuilder class needs System.Text package
8. break statement - be careful when the function is not well-defined small function, causing bugs.
9. A|B = C, what we can tell the length relationship among A, B, C.

Actionable items:

Choose 10 people's code to read.
Learn to be a good thinker - work on first 30 minutes, thinking, reading, define well-defined small functions.

Blog to read:
https://www.linkedin.com/pulse/why-best-designers-problem-solvers-katy-tsai?trk=hp-feed-article-title-like