Monday, January 30, 2017

Code review - Hackerank Queen's Attack II

January 30, 2017

Queen's Attack II

Julia learned the hard way, she spent 3 hours in the contest and then worked out a solution. She wrote directions array and define 8 directions. But, she did not push her through to avoid any redundant code, spent time on intermediate results. Near 3 hours, she put together the C# code here in the contest.

She reviewed the statistics, people can finish the algorithm in less than 20 minutes.
The idea is to enumerate each direction by going through the array, and encapsulate all directions’ info inside the array, open for extension but close for change. All direction information update are limited to the two arrays only.

Avoid writing if statement for each direction.

Write again in less than 20 minutes, C# code.

Write again with two changes, C# code.
1. use implicit type local variable var
2. use HashSet<Tuple<int,int>> instead of HashSet<string>

Code review on stackexchange.com is here

Actionable Items:

Always spend extra 30 minutes to one hour, share the practice with the community on code review on stackexchange.com. Therefore, Julia has time to share her thoughts how she learns through her experience first, and then collect feedback. 

Most of important, Julia has to learn to work closely with the community, and be open in 2017. Do not be a  lone worker. It is your job to get involved with multiple communities. Find those communities first. Learn from WTA double ranking top 1 - Bethany.  Julia recently wrote a blog about Safrova's coach Rob Steckly, and watched her video about her coach's coaching style.

Bethany Mattek-Sands - be aggressive, and have fun - Safarova

Usually in tennis sports, double player is more open compared to the single player. Because the double players have to learn how to work with each other. Here is the dance she likes the two double champions most, they learn to work with each other, be aggressive and be happy, no matter the results. 

Julia also learns how good they are sharing how they work together. Here are 4 minutes talk.

Julia likes the marketing skills and styles, top 1 ranking WTA double player in January 2017, Bethany Mattek-Sands, she watched her practice in Beijing in Oct. 2016.



1 comment:

  1. Why are you talking about yourself as a third person?

    ReplyDelete