Dec. 11, 2016
Introduction
Array construction is the first advanced algorithm Julia tried to work on in the contest, she did try to work on over 10 hours, but she scored 0 (maximum score 80). Through the contest, she started to understand the algorithm and built up strong interest in problem solving.
Later, she read one of solution, and then, spent over 4 hours to understand the pruning idea to avoid timeout issue.
Later, she did very intensive research on recursive function. But, she needs to get it on stackexchange.com, share her interest and questions, and then, see if she will get any surprise. Success after team work, Julia likes to practice the belief.
Previous blogs about the algorithm:
Labels: Array Construction (Series 1 of 5)
http://juliachencoding.blogspot.ca/2016/11/hackerrank-codesprint-array.html
Workout:
Plan to post a question on stackoverflow.com code review for code review.
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.
Sunday, December 11, 2016
StackExchange.com code review - program challenge ( new school day 5)
Dec. 11, 2016
Julia loves to find the top talent on code review to score high on program-challenge. She found one today:
http://codereview.stackexchange.com/users/66571/twohundredping
Programming-Challenge Score 38 posts 10 posts %37
She plans to read as many as possible from the talent, meanwhile, try to find most talent person on programming-challenge.
Her most favorite post from the talent:
http://codereview.stackexchange.com/questions/149096/given-n-and-m-find-all-stepping-numbers-in-range-n-to-m/149456#149456
Always program the general case before edge cases. After you have an implementation of the general case see if it handles the edge case or if not, what minimally invasive changes you can make to the general case to handle edge cases. As a last resort, handle the edge case separately.
Julia likes to do some research on programming challenge, how to find great posts?
http://codereview.stackexchange.com/tags/programming-challenge/topusers
Start to read program-challenge answers by user 9357:
http://codereview.stackexchange.com/search?q=user:9357+[programming-challenge]
Julia loves to find the top talent on code review to score high on program-challenge. She found one today:
http://codereview.stackexchange.com/users/66571/twohundredping
Programming-Challenge Score 38 posts 10 posts %37
She plans to read as many as possible from the talent, meanwhile, try to find most talent person on programming-challenge.
Her most favorite post from the talent:
http://codereview.stackexchange.com/questions/149096/given-n-and-m-find-all-stepping-numbers-in-range-n-to-m/149456#149456
Always program the general case before edge cases. After you have an implementation of the general case see if it handles the edge case or if not, what minimally invasive changes you can make to the general case to handle edge cases. As a last resort, handle the edge case separately.
Julia likes to do some research on programming challenge, how to find great posts?
http://codereview.stackexchange.com/tags/programming-challenge/topusers
Start to read program-challenge answers by user 9357:
http://codereview.stackexchange.com/search?q=user:9357+[programming-challenge]
Algorithm: Given n and m, find all stepping numbers in the range
Dec. 11, 2016
Introduction:
Julia start to have good time to read code review post. She started to check her post, no update; but quickly she started to look for good ones to read, and give out a few of upvotes. She earned 36 reputation, after she got more than 30 reputation, she can upvote/ downvote any post.
Here is the post she loves to read. The way she can support people's code review, is to give a upvote.
http://codereview.stackexchange.com/questions/149096/given-n-and-m-find-all-stepping-numbers-in-range-n-to-m/149456
Workout:
Julia learns a few things through the code review. Will write down here.
Her favorite code review:
1. http://codereview.stackexchange.com/a/149157/123986
2. This one is better
http://codereview.stackexchange.com/a/149456/123986
Julia really likes the code review: Advanced topic, so she write the C# version,
https://gist.github.com/jianminchen/28b656f16aa58a00687e823eb0aaf212
She likes to share the code with comment, but she needs 50 reputation in order to post a comment.
So, Julia just wrote an answer for the question.
Here is the link:
http://codereview.stackexchange.com/a/149598/123986
Actionable Items:
1. There are over hundreds programmers write good answers on stackExchange.com code review. Julia, work with them, try their ideas first using C# code, and then, try to improve, and enhance the work. Add code with some test cases, and question some variable names, and write down the ideas to make code more quick to follow.
2. Read more badges - what they are, how they are defined, come out filters to search, find most valuable posts.
Badges - read, learn, memorize, and enjoy the searching using badges knowledge.
Introduction:
Julia start to have good time to read code review post. She started to check her post, no update; but quickly she started to look for good ones to read, and give out a few of upvotes. She earned 36 reputation, after she got more than 30 reputation, she can upvote/ downvote any post.
Here is the post she loves to read. The way she can support people's code review, is to give a upvote.
http://codereview.stackexchange.com/questions/149096/given-n-and-m-find-all-stepping-numbers-in-range-n-to-m/149456
Workout:
Julia learns a few things through the code review. Will write down here.
Her favorite code review:
1. http://codereview.stackexchange.com/a/149157/123986
2. This one is better
http://codereview.stackexchange.com/a/149456/123986
Julia really likes the code review: Advanced topic, so she write the C# version,
https://gist.github.com/jianminchen/28b656f16aa58a00687e823eb0aaf212
She likes to share the code with comment, but she needs 50 reputation in order to post a comment.
So, Julia just wrote an answer for the question.
Here is the link:
http://codereview.stackexchange.com/a/149598/123986
Actionable Items:
1. There are over hundreds programmers write good answers on stackExchange.com code review. Julia, work with them, try their ideas first using C# code, and then, try to improve, and enhance the work. Add code with some test cases, and question some variable names, and write down the ideas to make code more quick to follow.
2. Read more badges - what they are, how they are defined, come out filters to search, find most valuable posts.
Badges - read, learn, memorize, and enjoy the searching using badges knowledge.
Saturday, December 10, 2016
Segment Tree - kindergarten adventures algorithm - code review
Dec. 10, 2016
Problem statement:
Introduction
Kindergarten adventure algorithm is the algorithm on HackerRank university codespring contest in November, 2016, and it is medium level difficulty. Julia spent over one hour to think about the algorithm in the contest, but she did not come out the idea using binary indexed tree or segment tree to solve it. Julia was very lucky to find a C# solution actually implemented using segment tree.
The Previous two blogs about the algorithm and solutions:
Julia found out that her learning of binary indexed tree is missing most important part, the experience to play and learn from a simple concrete example; she read a lot about segment tree, or binary index tree, but she needs to have some time to play with an example, have some fun. The skills will come afterwards, she believes.
Here is one C# solution she chose to study, here are steps:
1. Put some analysis together,
2. Review code
3. Put together a new version
4. Share on stackexchange.com code review section.
C# code
Plan to work on the algorithm 2 hours. Dec. 10, 2016, 11:36am - 1:36pm
Put some references together for further study.
C# code - Julia tries to figure out how to build a segment tree through sample test
case:
3
1 0 0
The segment tree in an array: {0,0,2,2,1,1}
Segment Tree:
C# code
Julia's concerns about segment tree:
Questions:
1. Why does Modify function skip one and only add value on odd number?
Line 114 - line 125,
public void Modify(int start, int count, int value)
{
int size = tree.Length / 2;
int left = start + size;
int right = start + count + size; // open border
for (; left < right; left >>= 1, right >>= 1)
{
if (left % 2 == 1) tree[left++] += value;
if (right % 2 == 1) tree[--right] += value;
}
}
2. How does the range of start/ end to be determined on this simple test case: 1 0 0?
Line 87 - Line 93:
private static SegmentTree BuildTree(int n, int[] extraMinutes)
{
var tree = new SegmentTree(n);
for (int i = 0; i < n; i++)
{
int curr = extraMinutes[i];
int len = extraMinutes.Length;
if (curr >= len) continue;
int start = (i + 1) % len;
int end = (i + extraMinutes.Length - curr) % len;
if (start <= end)
tree.Modify(start, end - start + 1, 1);
else
{
tree.Modify(start, len - start, 1);
tree.Modify(0, end + 1, 1);
}
}
return tree;
}
Why start = (i+1) % len? Guessing, i = 0, ID counts from 1 to 3, not starting from 0.
Why end = (i + extraMinutes.Length - curr) % len;
3. Question:
Study Query API: Why skip the root node?
for loop, i > 0
Line 132 - Line 139:
public int Query(int index)
{
int res = 0;
int i = index + tree.Length / 2;
for (; i > 0; i >>= 1)
res += tree[i];
return res;
}
Julia, only way, better way to learn segment tree, binary index tree, is to work on an algorithm, and then, ask good questions to yourself, and then, post the question on the stackexchange.com as well.
Post the question on stackexchange.com code review:
Code review is here. The code review was closed.
It is not acceptable to ask help to understand other people's code. That is the rule from stackexchange.com. Do not be lazy. Work hard, fail a few times and then get better. Julia, if you are in uncomfortable zone, that is the learning zone. Do not miss the learning opportunities.
Fail to post, the algorithm written is not mine. Need to come out my own solution first, and then, get code review. Tried various solutions, failed all times. Get to know the algorithm better.
1. Wrote my own version of segment tree, first try: 2.18 (maximum score 30)
only pass 4 test cases.
C# practice 1
2. Second practice, score 1.08 max-score: 30, pass test case 0 and 1.
C# practice 2
3. Third practice, score 0 max-score: 30, pass test case 0, 1
C# practice 3
It is a really good study case for understanding depth of problem solving. Timeout issue is critical, at the beginning of construction of segment tree, the time complexity should be O(n^2), not O(n), n is the people in the group, n < 100000.
Better score 0 to write your own code, comparing to copy other's code score 30. But do not understand the design and algorithm.
1. Read the lecture note to help:
Lecture note to study.
2. Read the article about segment tree.
Problem statement:
Introduction
Kindergarten adventure algorithm is the algorithm on HackerRank university codespring contest in November, 2016, and it is medium level difficulty. Julia spent over one hour to think about the algorithm in the contest, but she did not come out the idea using binary indexed tree or segment tree to solve it. Julia was very lucky to find a C# solution actually implemented using segment tree.
The Previous two blogs about the algorithm and solutions:
HackerRank - university codesprint - kindergarten adventures (after the contest)
Julia found out that her learning of binary indexed tree is missing most important part, the experience to play and learn from a simple concrete example; she read a lot about segment tree, or binary index tree, but she needs to have some time to play with an example, have some fun. The skills will come afterwards, she believes.
Here is one C# solution she chose to study, here are steps:
1. Put some analysis together,
2. Review code
3. Put together a new version
4. Share on stackexchange.com code review section.
C# code
Plan to work on the algorithm 2 hours. Dec. 10, 2016, 11:36am - 1:36pm
Put some references together for further study.
Workout
C# code - Julia tries to figure out how to build a segment tree through sample test
case:
3
1 0 0
The segment tree in an array: {0,0,2,2,1,1}
Segment Tree:
C# code
Julia's concerns about segment tree:
Questions:
1. Why does Modify function skip one and only add value on odd number?
Line 114 - line 125,
public void Modify(int start, int count, int value)
{
int size = tree.Length / 2;
int left = start + size;
int right = start + count + size; // open border
for (; left < right; left >>= 1, right >>= 1)
{
if (left % 2 == 1) tree[left++] += value;
if (right % 2 == 1) tree[--right] += value;
}
}
2. How does the range of start/ end to be determined on this simple test case: 1 0 0?
Line 87 - Line 93:
private static SegmentTree BuildTree(int n, int[] extraMinutes)
{
var tree = new SegmentTree(n);
for (int i = 0; i < n; i++)
{
int curr = extraMinutes[i];
int len = extraMinutes.Length;
if (curr >= len) continue;
int start = (i + 1) % len;
int end = (i + extraMinutes.Length - curr) % len;
if (start <= end)
tree.Modify(start, end - start + 1, 1);
else
{
tree.Modify(start, len - start, 1);
tree.Modify(0, end + 1, 1);
}
}
return tree;
}
Why start = (i+1) % len? Guessing, i = 0, ID counts from 1 to 3, not starting from 0.
Why end = (i + extraMinutes.Length - curr) % len;
3. Question:
Study Query API: Why skip the root node?
for loop, i > 0
Line 132 - Line 139:
public int Query(int index)
{
int res = 0;
int i = index + tree.Length / 2;
for (; i > 0; i >>= 1)
res += tree[i];
return res;
}
Actionable Items
Julia, only way, better way to learn segment tree, binary index tree, is to work on an algorithm, and then, ask good questions to yourself, and then, post the question on the stackexchange.com as well.
Post the question on stackexchange.com code review:
Code review is here. The code review was closed.
It is not acceptable to ask help to understand other people's code. That is the rule from stackexchange.com. Do not be lazy. Work hard, fail a few times and then get better. Julia, if you are in uncomfortable zone, that is the learning zone. Do not miss the learning opportunities.
Fail to post, the algorithm written is not mine. Need to come out my own solution first, and then, get code review. Tried various solutions, failed all times. Get to know the algorithm better.
1. Wrote my own version of segment tree, first try: 2.18 (maximum score 30)
only pass 4 test cases.
C# practice 1
2. Second practice, score 1.08 max-score: 30, pass test case 0 and 1.
C# practice 2
3. Third practice, score 0 max-score: 30, pass test case 0, 1
C# practice 3
It is a really good study case for understanding depth of problem solving. Timeout issue is critical, at the beginning of construction of segment tree, the time complexity should be O(n^2), not O(n), n is the people in the group, n < 100000.
Better score 0 to write your own code, comparing to copy other's code score 30. But do not understand the design and algorithm.
References
1. Read the lecture note to help:
Lecture note to study.
2. Read the article about segment tree.
A short research - "Jane the Virgin" - Netflix TV series
Dec. 10, 2016
Julia found out that she did spend over 2 hours to watch Jane the Virgin on netflix.com in December. So many good memory about the place - Miami area, Julia's home town from 1996 to 2010.
Jane the Virgin - https://en.wikipedia.org/wiki/Jane_the_Virgin
Possible ideas to do research:
How to make TV series? What are actor/ actress practicing daily? Can I borrow some good ideas to write blogs?
TV series are very structured, short and focus on one topic each episode.
Will come back very soon.
Julia found out that she did spend over 2 hours to watch Jane the Virgin on netflix.com in December. So many good memory about the place - Miami area, Julia's home town from 1996 to 2010.
Jane the Virgin - https://en.wikipedia.org/wiki/Jane_the_Virgin
Possible ideas to do research:
How to make TV series? What are actor/ actress practicing daily? Can I borrow some good ideas to write blogs?
TV series are very structured, short and focus on one topic each episode.
Will come back very soon.
Friday, December 9, 2016
JavaScript - 2016 Year-End Review
Dec. 9, 2016
Introduction
Learning JavaScript is so much fun; Julia spent over 10 months in 2014 to study the language, but until 2016, she just learned that so many people choose to use JavaScript to solve daily algorithm challenges. Because she likes to write more JavaScript code, she started to think about putting more code/ data in the front end, avoid a trip to web server, and then, she knew that she started to know the power of JavaScript.
Last 2 - 3 days, Julia started to read JavaScript code through 10,000 submission, at least 10 JavaScript code she plans to read.
Problem statement:
https://www.hackerrank.com/challenges/matrix-rotation-algo
Knowing JavaScript Array API very well, plan to read JavaScript code daily, at least one week or two. Everytime Julia warmups JavaScript, she starts to write new code.
Workout:
What makes good fun workout on learning JavaScript? Also, help to make some additional fun to the holiday. Will find out!
Year-End Review:
Favorite blogs: Search JavaScript through the blog
1. March
JavaScript for C# developer - pluralsight course
http://juliachencoding.blogspot.ca/2016/03/pluralsight-javascript-for-c-developer.html
2. July
http://juliachencoding.blogspot.ca/2016/07/string-primitive-javascript-study.html
3. August:
Introduction
Learning JavaScript is so much fun; Julia spent over 10 months in 2014 to study the language, but until 2016, she just learned that so many people choose to use JavaScript to solve daily algorithm challenges. Because she likes to write more JavaScript code, she started to think about putting more code/ data in the front end, avoid a trip to web server, and then, she knew that she started to know the power of JavaScript.
Last 2 - 3 days, Julia started to read JavaScript code through 10,000 submission, at least 10 JavaScript code she plans to read.
Problem statement:
https://www.hackerrank.com/challenges/matrix-rotation-algo
Knowing JavaScript Array API very well, plan to read JavaScript code daily, at least one week or two. Everytime Julia warmups JavaScript, she starts to write new code.
Workout:
What makes good fun workout on learning JavaScript? Also, help to make some additional fun to the holiday. Will find out!
Year-End Review:
Favorite blogs: Search JavaScript through the blog
1. March
HackerRank: Two string - thinking in JavaScript over 10 ways
http://juliachencoding.blogspot.ca/2016/03/hackerrank-two-string-thinking-in.htmlJavaScript for C# developer - pluralsight course
http://juliachencoding.blogspot.ca/2016/03/pluralsight-javascript-for-c-developer.html
2. July
http://juliachencoding.blogspot.ca/2016/07/string-primitive-javascript-study.html
3. August:
JavaScript Style Guide Study - Airbnb
http://juliachencoding.blogspot.ca/2016/08/javascript-style-guide-study-airbnb.htmlThursday, December 8, 2016
HackerRank - NCR codesprint - Spiral Message - Code Review
Dec. 8, 2016
Problem statement
The spiral message algorithm is an easy algorithm, but Julia stumbled on this algorithm badly in the contest, she missed the important part - the message starts from low-left corner, not upper-left corner. And then, base cases should be tested: one node, one row, one column first, and then, four edges are handled from low-left to upper-left to upper-right to lower-right to lower-left.
Here are two blogs showing her work:
1. Blog about performance in the contest.
After the contest:
3. Blog about things to work on after the contest.
Continue to work on the spiral message algorithm.
Workout:
First review the code after the contest.
Julia spent over one hour to do code review, and then, she put together a new version, ready to post on stackexchange.com code review section, ask help:
C# version:
1. Function name is changed to match the requirement:
SpiralMessageFromLowerLeftClockWise
2. Test cases are added to spiral message, ensure that the order is correct, not just
how many words in the spiral message.
Important Link to get some feedback from the community on stackexchange.com code review.
Problem statement
Introduction
The spiral message algorithm is an easy algorithm, but Julia stumbled on this algorithm badly in the contest, she missed the important part - the message starts from low-left corner, not upper-left corner. And then, base cases should be tested: one node, one row, one column first, and then, four edges are handled from low-left to upper-left to upper-right to lower-right to lower-left.
Here are two blogs showing her work:
1. Blog about performance in the contest.
After the contest:
3. Blog about things to work on after the contest.
Continue to work on the spiral message algorithm.
Workout:
First review the code after the contest.
Julia spent over one hour to do code review, and then, she put together a new version, ready to post on stackexchange.com code review section, ask help:
C# version:
Highlights of change
1. Function name is changed to match the requirement:
SpiralMessageFromLowerLeftClockWise
2. Test cases are added to spiral message, ensure that the order is correct, not just
how many words in the spiral message.
Important Link to get some feedback from the community on stackexchange.com code review.
Tuesday, December 6, 2016
Matrix Rotation - Code Review - Series 3 of 10+
Dec. 6, 2016
Problem statement:
https://www.hackerrank.com/challenges/matrix-rotation-algo
Study code:
https://gist.github.com/jianminchen/1c1c07b5454a43d493264c6db4444ea3
Because there are over hundred C# solution to review, Julia likes to go over them first, mark good solutions to study first.
1. jaygundy
https://www.hackerrank.com/rest/contests/master/challenges/matrix-rotation-algo/hackers/jaygundy/download_solution
2. pableFomenta - similar to code review #2
https://www.hackerrank.com/rest/contests/master/challenges/matrix-rotation-algo/hackers/PabloFomenta/download_solution
Ideas to study code submissions:
1. Study all submissions using JavaScript with full score.
30+ solutions
2. Study submissions - using filters:
Carnegie Mellon University, Pittsburgh(30+)
MIT ()
Stanford University
University of California, Berkeley
Amazon (20+)
Google (20+)
Facebook (5)
Facebook - Player-1
Look for code with good style and design ideas:
Facebook:
1. Java
Define Set function, line 65 - 69.
https://gist.github.com/jianminchen/5e7796bce5a9420472bec31a2cc6e30b
Google
2. C++
line 25, int lt_corner - variable is very clear and meaningful
https://gist.github.com/jianminchen/d8843e292df6e9070e5f55c907ad0f69
3. C++
Matrix at most 300x300, so total size at most is 300*300*4bytes =360MB, 360KB, HackerRank maximum space is 512MB.
line 8: int M[300][300]
Declare a global variable - jagged array, the code is very easy to read.
Use the condition: n <= 300
https://gist.github.com/jianminchen/15ff14b51ab1c9f86084dbba4a036684
4. C
For any element in the array, use one for loop to rotate k steps. Very smart handling - code from
line 29 - 45, total 16 lines of code
https://gist.github.com/jianminchen/137807675ba27fd532ffaed4f98a68df
5. Java
Cannot believe!
https://gist.github.com/jianminchen/6e84dfcf2fb222d84900bda27687e6a1
Amazon
Java
6. Design a class: LinkedListLight, with an API - RotateBy(int steps)
https://gist.github.com/jianminchen/b7cb950b70563b56cb37909e72e0b48c
Standford:
JavaScript
7. https://gist.github.com/jianminchen/ae14bc0d764240d03831e6429337199a
Problem statement:
https://www.hackerrank.com/challenges/matrix-rotation-algo
Study code:
https://gist.github.com/jianminchen/1c1c07b5454a43d493264c6db4444ea3
Because there are over hundred C# solution to review, Julia likes to go over them first, mark good solutions to study first.
1. jaygundy
https://www.hackerrank.com/rest/contests/master/challenges/matrix-rotation-algo/hackers/jaygundy/download_solution
2. pableFomenta - similar to code review #2
https://www.hackerrank.com/rest/contests/master/challenges/matrix-rotation-algo/hackers/PabloFomenta/download_solution
Ideas to study code submissions:
1. Study all submissions using JavaScript with full score.
30+ solutions
2. Study submissions - using filters:
Carnegie Mellon University, Pittsburgh(30+)
MIT ()
Stanford University
University of California, Berkeley
Amazon (20+)
Google (20+)
Facebook (5)
Facebook - Player-1
Look for code with good style and design ideas:
Facebook:
1. Java
Define Set function, line 65 - 69.
https://gist.github.com/jianminchen/5e7796bce5a9420472bec31a2cc6e30b
2. C++
line 25, int lt_corner - variable is very clear and meaningful
https://gist.github.com/jianminchen/d8843e292df6e9070e5f55c907ad0f69
3. C++
Matrix at most 300x300, so total size at most is 300*300*4bytes =
line 8: int M[300][300]
Declare a global variable - jagged array, the code is very easy to read.
Use the condition: n <= 300
https://gist.github.com/jianminchen/15ff14b51ab1c9f86084dbba4a036684
4. C
For any element in the array, use one for loop to rotate k steps. Very smart handling - code from
line 29 - 45, total 16 lines of code
https://gist.github.com/jianminchen/137807675ba27fd532ffaed4f98a68df
5. Java
Cannot believe!
https://gist.github.com/jianminchen/6e84dfcf2fb222d84900bda27687e6a1
Amazon
Java
6. Design a class: LinkedListLight, with an API - RotateBy(int steps)
https://gist.github.com/jianminchen/b7cb950b70563b56cb37909e72e0b48c
Standford:
JavaScript
7. https://gist.github.com/jianminchen/ae14bc0d764240d03831e6429337199a
HackerRank - Matrix Rotation - Code review - Series 2 of 10+
Dec. 6, 2016
Problem statement:
https://www.hackerrank.com/challenges/matrix-rotation-algo
Study code:
https://gist.github.com/jianminchen/fd5e7e7e4a031971e56dc30a949e5421
Code review:
Julia took 20 minutes to go over the code, and then understood the code.
A few changes:
/*
* Code review:
* a -> matrix - function argument
* amount -> steps
* k -> step, for loop statement
* buffer -> prev
* buffer1 -> cur
*
* Good ideas to study:
* 1. height, width variables are declared
* 2. go through the ring: start from second row, first column, anti-clockwise, one-by-one
* if/else if statement - 4 lines - very easy to follow
*/
Study do while loop, and also if/else if to do anti-clockwise rotation starting from left-upper corner.
https://gist.github.com/jianminchen/91719129b81eefb19f662615b4e3ab95
Great tip Julia likes to share:
Instead of using four for loop to go through the ring, use if/else if to make it one loop - using do/ while. Easy to write, only 4 lines.
Compare two solutions:
Current one in the blog: smart choice, using one loop - do while - 4 if/else (Excellent!)
This solution can be memorized, and cut the time to write in less than 10 minutes.
https://gist.github.com/jianminchen/91719129b81eefb19f662615b4e3ab95
Previous one: kind of verbose, dumb, 4 for loops.
https://gist.github.com/jianminchen/e943a9e7b86d24e9f36c04f1f3502941
Problem statement:
https://www.hackerrank.com/challenges/matrix-rotation-algo
Study code:
https://gist.github.com/jianminchen/fd5e7e7e4a031971e56dc30a949e5421
Code review:
Julia took 20 minutes to go over the code, and then understood the code.
A few changes:
/*
* Code review:
* a -> matrix - function argument
* amount -> steps
* k -> step, for loop statement
* buffer -> prev
* buffer1 -> cur
*
* Good ideas to study:
* 1. height, width variables are declared
* 2. go through the ring: start from second row, first column, anti-clockwise, one-by-one
* if/else if statement - 4 lines - very easy to follow
*/
Study do while loop, and also if/else if to do anti-clockwise rotation starting from left-upper corner.
https://gist.github.com/jianminchen/91719129b81eefb19f662615b4e3ab95
Great tip Julia likes to share:
Instead of using four for loop to go through the ring, use if/else if to make it one loop - using do/ while. Easy to write, only 4 lines.
Compare two solutions:
Current one in the blog: smart choice, using one loop - do while - 4 if/else (Excellent!)
This solution can be memorized, and cut the time to write in less than 10 minutes.
https://gist.github.com/jianminchen/91719129b81eefb19f662615b4e3ab95
Previous one: kind of verbose, dumb, 4 for loops.
https://gist.github.com/jianminchen/e943a9e7b86d24e9f36c04f1f3502941
HackerRank - Matrix Rotation - Code Review Series 1 of 10+
Dec. 6, 2016
Problem statement:
https://www.hackerrank.com/challenges/matrix-rotation-algo
Review first 10 C# submissions, and code review one by one:
Study code:
https://gist.github.com/jianminchen/8ee835834a9a6cdb68331695a3c1abb1
Review code, and make the change:
https://gist.github.com/jianminchen/e943a9e7b86d24e9f36c04f1f3502941
Main changes:
Use meaningful names, and declare one extra variable: actualSteps, line 63.
line 67, variable name: firstOneInStrip
Express the intent.
Problem statement:
https://www.hackerrank.com/challenges/matrix-rotation-algo
Review first 10 C# submissions, and code review one by one:
Study code:
https://gist.github.com/jianminchen/8ee835834a9a6cdb68331695a3c1abb1
Review code, and make the change:
https://gist.github.com/jianminchen/e943a9e7b86d24e9f36c04f1f3502941
Main changes:
Use meaningful names, and declare one extra variable: actualSteps, line 63.
line 67, variable name: firstOneInStrip
Express the intent.
HackerRank - Matrix Rotation (Series 5 of 5)
Dec. 6, 2016
Introduction:
Julia has more talent now after she attended her new school - stackexchange.com code review for code review on stackexchange.com. She did post two questions, and the first one, she learned a few things. One most important one is "Do not use abstract variable name. Do not let user guess what the variable name does".
Julia spent 30 minutes to review the practice in April 2016, and then, she went through the code, found the bug.
Last practice scoring 8 of 80:
(more than 1 hour, still having bugs, score 8.89/ wrong answer)
https://gist.github.com/jianminchen/57572227dafe939060f7cc81b193cd9b
Code review done by Julia on Dec. 6, 2016
1. Do not use abstract variable names. Please use meaningful name
line 16, s1
line 17, sA
line 20, T
line 22, arr
line 27, aA
In the function rotateArrayOneStepAntiClockwise
line 53, cnt
int 53, arr
line 71, ci
line 73, startR
line 74, startC
line 75, endR
line 76, endC
line 78, tmpVal
line 81, i
line 85, i,
line 89, i,
line 94, i,
2. function name should use
rotateArrayOneStepAntiClockwise
Should use PascalCased
RotateArrayOneStepAntiClockwise
"In C#, method names should be PascalCased, not camelCased"
Workout:
c# solution: pass all test cases
https://gist.github.com/jianminchen/6fabef7436097552e35633a549b0268a
Discussion:
Use meaningful variable name - The code is much easy to understand, therefore, static analysis should be much more easy.
For example, Julia reviewed the code on Dec. 6, 2016, line 53 cnt, the variable name is not meaningful, so she decided to replace the name using "steps". Line 114, there is some calculation, so in order to avoid timeout, there is actual steps taken < strip size. So, she decided to add a new variable name on line 114, called actualSteps. Just those two changes, Julia fixed the bug she could not fix in April, 2016 over 1 hour.
Introduction:
Julia has more talent now after she attended her new school - stackexchange.com code review for code review on stackexchange.com. She did post two questions, and the first one, she learned a few things. One most important one is "Do not use abstract variable name. Do not let user guess what the variable name does".
Julia spent 30 minutes to review the practice in April 2016, and then, she went through the code, found the bug.
Last practice scoring 8 of 80:
(more than 1 hour, still having bugs, score 8.89/ wrong answer)
https://gist.github.com/jianminchen/57572227dafe939060f7cc81b193cd9b
Code review done by Julia on Dec. 6, 2016
1. Do not use abstract variable names. Please use meaningful name
line 16, s1
line 17, sA
line 20, T
line 22, arr
line 27, aA
In the function rotateArrayOneStepAntiClockwise
line 53, cnt
int 53, arr
line 71, ci
line 73, startR
line 74, startC
line 75, endR
line 76, endC
line 78, tmpVal
line 81, i
line 85, i,
line 89, i,
line 94, i,
2. function name should use
rotateArrayOneStepAntiClockwise
Should use PascalCased
RotateArrayOneStepAntiClockwise
"In C#, method names should be PascalCased, not camelCased"
Workout:
c# solution: pass all test cases
https://gist.github.com/jianminchen/6fabef7436097552e35633a549b0268a
Discussion:
Use meaningful variable name - The code is much easy to understand, therefore, static analysis should be much more easy.
For example, Julia reviewed the code on Dec. 6, 2016, line 53 cnt, the variable name is not meaningful, so she decided to replace the name using "steps". Line 114, there is some calculation, so in order to avoid timeout, there is actual steps taken < strip size. So, she decided to add a new variable name on line 114, called actualSteps. Just those two changes, Julia fixed the bug she could not fix in April, 2016 over 1 hour.
Monday, December 5, 2016
Algorithm: Print all nodes at distance k from a give node
Dec. 5, 2015
Julia likes to do some research on this algorithm:
http://www.geeksforgeeks.org/print-nodes-distance-k-given-node-binary-tree/
Recently, she came cross this algorithm through code review:
http://codereview.stackexchange.com/questions/60765/print-all-nodes-that-are-at-distance-k-from-a-leaf-node/60894#60894
a blog:
Another source code reference:
http://k2code.blogspot.ca/2015/09/print-all-nodes-that-are-at-distance-k.html
http://www.geeksforgeeks.org/print-nodes-at-k-distance-from-root/
Do some research on this type of algorithm.
Julia likes to do some research on this algorithm:
http://www.geeksforgeeks.org/print-nodes-distance-k-given-node-binary-tree/
Recently, she came cross this algorithm through code review:
http://codereview.stackexchange.com/questions/60765/print-all-nodes-that-are-at-distance-k-from-a-leaf-node/60894#60894
a blog:
Another source code reference:
http://k2code.blogspot.ca/2015/09/print-all-nodes-that-are-at-distance-k.html
http://www.geeksforgeeks.org/print-nodes-at-k-distance-from-root/
Do some research on this type of algorithm.
Cracking the coding interview challengs - on HackerRank
Dec. 5, 2016
Julia watched the videos over 3 times.
She likes to take down some notes, and then, continue to do some researches on some ideas:
1. How Companies Evaluate Technical Interviews
2. How to Approach Behavior Questions
3. 7 Steps to Solve Algorithm Problems
1. Listen
Do you use every detail?
2. Example
big, no special case
3. Brute Force
Better to have a brute force than nothing at all
4. Optimize
5. Walk through your algorithm
6. Code
Whiteboard:
- write straight
- use space wisely
Whiteboard or computer:
- Coding style matters
- Modularize
(before, not after!)
void doSomething(a, b){
}
7. Test
1. Analyse-> think about each line
-> Double check things that look wierd
1. Use test cases
- small test-case first
- edge cases
- big test cases
Remember
1. think as you test -> don't be a bot!
4. 3 Algorithms Strategies
1. B. U. D.
B - Bottlenecks
U - unnecessary work
D - Duplicate work
2. Space/ Time Tradeoffs
3. D. I. Y.
Do it yourself
Blog reading:
https://www.bloomberg.com/graphics/2015-cheatsheets/
Julia watched the videos over 3 times.
She likes to take down some notes, and then, continue to do some researches on some ideas:
1. How Companies Evaluate Technical Interviews
2. How to Approach Behavior Questions
3. 7 Steps to Solve Algorithm Problems
1. Listen
Do you use every detail?
2. Example
big, no special case
3. Brute Force
Better to have a brute force than nothing at all
4. Optimize
5. Walk through your algorithm
6. Code
Whiteboard:
- write straight
- use space wisely
Whiteboard or computer:
- Coding style matters
- Modularize
(before, not after!)
void doSomething(a, b){
}
7. Test
1. Analyse-> think about each line
-> Double check things that look wierd
1. Use test cases
- small test-case first
- edge cases
- big test cases
Remember
1. think as you test -> don't be a bot!
4. 3 Algorithms Strategies
1. B. U. D.
B - Bottlenecks
U - unnecessary work
D - Duplicate work
2. Space/ Time Tradeoffs
3. D. I. Y.
Do it yourself
Blog reading:
https://www.bloomberg.com/graphics/2015-cheatsheets/
Sunday, December 4, 2016
Tennis ATP World Tour Uncovered - Julia's study of sports
Dec. 4, 2016
Introduction:
Julia always turns to tennis sports when she tries to improve her knowledge how to compete, in sports, on HackerRank, and other things like algorithm problem solving - time spent.
Right now, Julia is only 10% of best performer in the world by her study and research through HackerRank leaderboard. She enjoys the study and also tries different ways to improve herself.
Most helpful are to study how ATP players try to reach top 100, top 20, top 10, and enjoy the career as well.
Study of players and coaches:
Also, Julia likes to catch up more ATP tour videos, and then, she likes to know how ATP players think/ compete in the sports.
She enjoys the ATP uncovered series.
1. Double players are more social, close to each other; more social than single.
Part I:
https://www.youtube.com/watch?v=iF-Dwg0ZL-U
Part II
https://www.youtube.com/watch?v=rjg52fZe6SU
Good feeling, good chemistry is good and important. Know your partner so well, we communicate each point; feel other at each point; ...
Good thing - we enjoy play with top single player, not having chance to play single to beat, but double is possible.
Know how to motivate when time is difficult.
What you will do?
Double player, take single player out-of-comfortable zone; make them think differently.
What makes good partnership?
So many pressure points.
How to count on the person? Learn more when you travel together, ...
tennis partnership - work with partner, week out/ week in
Enjoy sports, maybe the result is not good.
Tough journey, get along well.
2. How player handles competitions?
Write down all ATP players in this video:
Andy Murray, Roger Federal, ...,
https://www.youtube.com/watch?v=dX6ytiyhWz4
3. Top 10 player - Dimitrov - Julia's favorite player
What to work on? Get back to Top 20? Top 10?
Most important is to keep working, stay healthy, and everything will come. Be there, done that.
Body feel excellent, do not think how old, maturity will come. Just get result.
Coach:
https://www.youtube.com/watch?v=iepe7vytYLo
4. Mat Wilander in the spotlight uncovered 2016
https://www.youtube.com/watch?v=7sNvBUC_rGM&list=PLG1T9f6z4fzQ5PPYGS9-x1Gyo2fncA1Wi&index=44
Mats Wilander: Tennis Legend on Trans World
https://www.youtube.com/watch?v=cnqn9cF3E3k
5. ATP World Tour Uncovered Norman Wawrinka 2016
https://www.youtube.com/watch?v=h56g6GdanAc&list=PLG1T9f6z4fzQ5PPYGS9-x1Gyo2fncA1Wi&index=116
Coach: Magnus Norman
stay humble, keep learning. So many competitions.
6. Greats of The Game Share Best Advice 2016
https://www.youtube.com/watch?v=tgc3-ujQ12A&index=118&list=PLG1T9f6z4fzQ5PPYGS9-x1Gyo2fncA1Wi
Write down wise words:
Andy Murray - Do not be too hard on myself -
a lot of people gave to Andy
Bernard Tomic -
Work hard
It is just a sport, enjoy the game.
Fabio - Learn to listen
Jack Sock - Can not get back to yesterday
Jeremy Chardy - If you want to be really good, you have to really participate hard.
Marcin - Use best of day, think harder, train harder
Milos Ronic -
Rafael Nadal - his father told him long time ago, create something is so difficult, copy!
Roger Federal - Learn everything at the begin of career
Stan Warinka - Enjoy the tennis, love the tennis.
Tommy Robredo -
Introduction:
Julia always turns to tennis sports when she tries to improve her knowledge how to compete, in sports, on HackerRank, and other things like algorithm problem solving - time spent.
Right now, Julia is only 10% of best performer in the world by her study and research through HackerRank leaderboard. She enjoys the study and also tries different ways to improve herself.
Most helpful are to study how ATP players try to reach top 100, top 20, top 10, and enjoy the career as well.
Study of players and coaches:
Also, Julia likes to catch up more ATP tour videos, and then, she likes to know how ATP players think/ compete in the sports.
She enjoys the ATP uncovered series.
1. Double players are more social, close to each other; more social than single.
Part I:
https://www.youtube.com/watch?v=iF-Dwg0ZL-U
Part II
https://www.youtube.com/watch?v=rjg52fZe6SU
Good feeling, good chemistry is good and important. Know your partner so well, we communicate each point; feel other at each point; ...
Good thing - we enjoy play with top single player, not having chance to play single to beat, but double is possible.
Know how to motivate when time is difficult.
What you will do?
Double player, take single player out-of-comfortable zone; make them think differently.
What makes good partnership?
So many pressure points.
How to count on the person? Learn more when you travel together, ...
tennis partnership - work with partner, week out/ week in
Enjoy sports, maybe the result is not good.
Tough journey, get along well.
2. How player handles competitions?
Write down all ATP players in this video:
Andy Murray, Roger Federal, ...,
https://www.youtube.com/watch?v=dX6ytiyhWz4
3. Top 10 player - Dimitrov - Julia's favorite player
What to work on? Get back to Top 20? Top 10?
Most important is to keep working, stay healthy, and everything will come. Be there, done that.
Body feel excellent, do not think how old, maturity will come. Just get result.
Coach:
https://www.youtube.com/watch?v=iepe7vytYLo
4. Mat Wilander in the spotlight uncovered 2016
https://www.youtube.com/watch?v=7sNvBUC_rGM&list=PLG1T9f6z4fzQ5PPYGS9-x1Gyo2fncA1Wi&index=44
Mats Wilander: Tennis Legend on Trans World
https://www.youtube.com/watch?v=cnqn9cF3E3k
5. ATP World Tour Uncovered Norman Wawrinka 2016
https://www.youtube.com/watch?v=h56g6GdanAc&list=PLG1T9f6z4fzQ5PPYGS9-x1Gyo2fncA1Wi&index=116
Coach: Magnus Norman
stay humble, keep learning. So many competitions.
6. Greats of The Game Share Best Advice 2016
https://www.youtube.com/watch?v=tgc3-ujQ12A&index=118&list=PLG1T9f6z4fzQ5PPYGS9-x1Gyo2fncA1Wi
Write down wise words:
Andy Murray - Do not be too hard on myself -
a lot of people gave to Andy
Bernard Tomic -
Work hard
It is just a sport, enjoy the game.
Fabio - Learn to listen
Jack Sock - Can not get back to yesterday
Jeremy Chardy - If you want to be really good, you have to really participate hard.
Marcin - Use best of day, think harder, train harder
Milos Ronic -
Rafael Nadal - his father told him long time ago, create something is so difficult, copy!
Roger Federal - Learn everything at the begin of career
Stan Warinka - Enjoy the tennis, love the tennis.
Tommy Robredo -
StackExchange Code Review - Julia's new school (Day 4)
Dec. 4, 2016
Julia likes to focus on C# question:
1. Questions answered by Eric Lippert:
C# Score 53, 803 Posts 2,873 Posts % 94
http://stackoverflow.com/search?q=user:88656+[c%23]
Try relevance, newest, votes, active and see which one is best to find best posts to study.
Write down most favorite posts. Write down 10 first.
http://stackoverflow.com/questions/8717582/why-use-ilist-or-list/8717782#8717782
2. senior google engineer - Author: C# in Depth
coding blog:
http://stackoverflow.com/users/22656/jon-skeet
C# SCORE 177,801 POSTS 18,295 POSTS % 55
http://stackoverflow.com/search?q=user:22656+[c%23]
Java
http://stackoverflow.com/search?q=user:22656+[java]
3. Study C# question the talent answered:
C#
http://codereview.stackexchange.com/users/59161/t3chb0t
Julia likes to focus on C# question:
1. Questions answered by Eric Lippert:
C# Score 53, 803 Posts 2,873 Posts % 94
http://stackoverflow.com/search?q=user:88656+[c%23]
Try relevance, newest, votes, active and see which one is best to find best posts to study.
Write down most favorite posts. Write down 10 first.
http://stackoverflow.com/questions/8717582/why-use-ilist-or-list/8717782#8717782
2. senior google engineer - Author: C# in Depth
coding blog:
http://stackoverflow.com/users/22656/jon-skeet
C# SCORE 177,801 POSTS 18,295 POSTS % 55
http://stackoverflow.com/search?q=user:22656+[c%23]
Java
http://stackoverflow.com/search?q=user:22656+[java]
3. Study C# question the talent answered:
C#
SCORE 738
POSTS 353
POSTS % 98
http://codereview.stackexchange.com/users/59161/t3chb0t
codereview.stackexchange.com - Julia's new school (Day 3)
Dec. 4, 2016
Plan to work on code review section, try to know more top-talents, and what are most valuable things to look into.
Day 3:
Part A:
1.Study google employer and questions he answered:
http://codereview.stackexchange.com/users/26190/ruds
segmented tree,
1. Travelling Salesman with Four Cities
http://codereview.stackexchange.com/questions/39353/travelling-salesman-with-four-cities/39354#39354
Great teaching about modularity, function design (DRY principles), and
2. Algorithm: K distance from leaf
http://codereview.stackexchange.com/questions/60765/print-all-nodes-that-are-at-distance-k-from-a-leaf-node/60894#60894
Algorithm: K distance from leaf
Another source code reference:
http://k2code.blogspot.ca/2015/09/print-all-nodes-that-are-at-distance-k.html
Practice the algorithm - 15 minutes.
3. Teach dividing different abstraction levels -
Code should be organized in terms of abstractions
http://codereview.stackexchange.com/questions/37478/improve-this-image-file-browser-remove-redundancy/37481#37481
4. Binary Search Tree
http://codereview.stackexchange.com/questions/67014/binary-search-tree/67155#67155
Plan to work on code review section, try to know more top-talents, and what are most valuable things to look into.
Day 3:
Part A:
1.Study google employer and questions he answered:
http://codereview.stackexchange.com/users/26190/ruds
segmented tree,
1. Travelling Salesman with Four Cities
http://codereview.stackexchange.com/questions/39353/travelling-salesman-with-four-cities/39354#39354
Great teaching about modularity, function design (DRY principles), and
2. Algorithm: K distance from leaf
http://codereview.stackexchange.com/questions/60765/print-all-nodes-that-are-at-distance-k-from-a-leaf-node/60894#60894
Algorithm: K distance from leaf
Another source code reference:
http://k2code.blogspot.ca/2015/09/print-all-nodes-that-are-at-distance-k.html
Practice the algorithm - 15 minutes.
3. Teach dividing different abstraction levels -
Code should be organized in terms of abstractions
http://codereview.stackexchange.com/questions/37478/improve-this-image-file-browser-remove-redundancy/37481#37481
4. Binary Search Tree
http://codereview.stackexchange.com/questions/67014/binary-search-tree/67155#67155
Lose weight and stay healthy - December schedule
Dec. 4, 2016
Julia plans to attend more activity this holiday season, she likes to meet people, get connected to friends, coworkers, and other activities.
Put a tentative schedule here:
1. Dec. 3 attended a wedding - connecting to Chinese church friends - Willingdon church
2. Tech meetup Dec. 7 - connect
3. Dec. 13 Microsoft woman tech
4. ...
5. ...
Julia plans to attend more activity this holiday season, she likes to meet people, get connected to friends, coworkers, and other activities.
Put a tentative schedule here:
1. Dec. 3 attended a wedding - connecting to Chinese church friends - Willingdon church
2. Tech meetup Dec. 7 - connect
3. Dec. 13 Microsoft woman tech
4. ...
5. ...
Saturday, December 3, 2016
Meetup talks - downtown Vancouver
Dec. 3, 2016
Introduction:
One thing Julia started to do after Oct. 2016 is to spend some time to attend meetups, so that she can spend more time to go out and relax, meet people and learn something new. She enjoys outdoor cold weather very much, specially walk is a great exercise to a programmer.
She went to "Why Microsoft Loves Java", and another one is "Hack/ Study/ Mentor Night". She did two meetups, one thing is common. She could not find the place, with people's help, she found the place.
First mistake is that Microsoft has multiple offices in downtown; Julia assumed that the one she knew is the place, but actually it is more than 3 blocks away on Georgia street.
Second mistake is that she took the bus to a meetup on 163 Hasting street, Mizilla YVR office, but she got off on Pender street, bus No.19, and then, she started to look for the address on Pender street instead.
Things learned:
Hack/ Study/ Mentor night - December 1, 2016
Julia learned some open source tool, and then, check astexplorer.net, and learn how the language is compiled by the compiler. That is interesting stuff.
http://astexplorer.net/
And one term she heard is mutation testing.
Udacity has some good course about interview.
She had chance to listen some presentation written by Python, and also had chance to know UBC computer science program and got to know a talent student as well.
Introduction:
One thing Julia started to do after Oct. 2016 is to spend some time to attend meetups, so that she can spend more time to go out and relax, meet people and learn something new. She enjoys outdoor cold weather very much, specially walk is a great exercise to a programmer.
She went to "Why Microsoft Loves Java", and another one is "Hack/ Study/ Mentor Night". She did two meetups, one thing is common. She could not find the place, with people's help, she found the place.
First mistake is that Microsoft has multiple offices in downtown; Julia assumed that the one she knew is the place, but actually it is more than 3 blocks away on Georgia street.
Second mistake is that she took the bus to a meetup on 163 Hasting street, Mizilla YVR office, but she got off on Pender street, bus No.19, and then, she started to look for the address on Pender street instead.
Things learned:
Hack/ Study/ Mentor night - December 1, 2016
Julia learned some open source tool, and then, check astexplorer.net, and learn how the language is compiled by the compiler. That is interesting stuff.
http://astexplorer.net/
And one term she heard is mutation testing.
Udacity has some good course about interview.
She had chance to listen some presentation written by Python, and also had chance to know UBC computer science program and got to know a talent student as well.
Friday, December 2, 2016
Book reading: The productive programmer
Dec. 2, 2016
Julia knows the importance to keep searching good books to read. She found a book to read.
Productive programmer by Neal Ford
She found the explanation of cyclomatic complexity (chapter 6: Test Driven Design , page:103) is very easy to follow, the example is very helpful.
Plan to read more. Reading is so much fun, this book is very well-written.
Julia knows the importance to keep searching good books to read. She found a book to read.
Productive programmer by Neal Ford
She found the explanation of cyclomatic complexity (chapter 6: Test Driven Design , page:103) is very easy to follow, the example is very helpful.
Plan to read more. Reading is so much fun, this book is very well-written.
Wednesday, November 30, 2016
How to work at Google: Example Coding/Engineering Interview
Nov. 30, 2016
Google interview talk:
How to Work at Google: Example Coding/Engineering Interview
https://www.youtube.com/watch?v=XKu_SEDAykw
Will take some notes very soon.
Google interview talk:
How to Work at Google: Example Coding/Engineering Interview
https://www.youtube.com/watch?v=XKu_SEDAykw
Will take some notes very soon.
Google interview talk including system design
Nov. 30, 2016
Google interview talks are excellent.
1. Passing the Google interview as a software engineer
Google interview talks are excellent.
1. Passing the Google interview as a software engineer
Fog Creek Software twitter account
Nov. 30, 2016
Julia plans to read articles through the twitter account of fox creek software:
https://twitter.com/FogCreek
Write down articles she read through the above twitter account:
1. https://business.stackoverflow.com/blog/how-to-optimize-your-candidate-experience-for-remote-developers
Will read more articles.
1. 11 minutes talk, transcript available.
http://blog.fogcreek.com/n-ways-to-be-a-better-developer-interview-with-lorna-mitchell/
2. https://blog.fogcreek.com/how-we-use-fogbugz-for-recruiting/
Julia plans to read articles through the twitter account of fox creek software:
https://twitter.com/FogCreek
Write down articles she read through the above twitter account:
1. https://business.stackoverflow.com/blog/how-to-optimize-your-candidate-experience-for-remote-developers
Will read more articles.
1. 11 minutes talk, transcript available.
http://blog.fogcreek.com/n-ways-to-be-a-better-developer-interview-with-lorna-mitchell/
2. https://blog.fogcreek.com/how-we-use-fogbugz-for-recruiting/
codereview.stackexchange.com - Julia's new school (II)
Nov. 30, 2016
Introduction:
Julia was so excited to read so many experts's well-written answers first time, on live sites. She just could not believe that she enjoys reading so much.
Julia only can read one post a time. Also, Julia likes to write down what she likes to work on after reading those posts.
Detail:
Find 10 favorite reading on code review:
Search keyword, HackerRank, and choose tab - votes
http://codereview.stackexchange.com/search?tab=votes&q=HackerRank
1. http://codereview.stackexchange.com/questions/139896/determining-if-the-kangaroos-will-land-in-the-same-position
The answer Julia really likes to read again and again:
http://codereview.stackexchange.com/a/139898/123986
Will come back to write more.
2. Design talk, junior level coding skills -> great ideas to improve
http://codereview.stackexchange.com/questions/36482/rpsls-game-in-c
3. Follow the advice as well -
http://codereview.stackexchange.com/questions/11233/responsive-adaptive-website-code
4. Interview task - SOLID Priciples and TDD (Dec. 4, 2016)
http://codereview.stackexchange.com/questions/41834/interview-task-solid-principle-and-tdd/41843#41843
5. ChrisWue - what questions are answered.
http://codereview.stackexchange.com/users/30346/chriswue
6. Play with code, and write two versions: OO version, old school version as well.
http://codereview.stackexchange.com/questions/36395/rock-paper-scissors-lizard-spock-challenge/36402#36402
7. Julia just loves to read:
http://codereview.stackexchange.com/questions/107581/check-if-more-engineers-are-happy-than-not-happy/107594#107594
Introduction:
Julia was so excited to read so many experts's well-written answers first time, on live sites. She just could not believe that she enjoys reading so much.
Julia only can read one post a time. Also, Julia likes to write down what she likes to work on after reading those posts.
Detail:
Find 10 favorite reading on code review:
Search keyword, HackerRank, and choose tab - votes
http://codereview.stackexchange.com/search?tab=votes&q=HackerRank
1. http://codereview.stackexchange.com/questions/139896/determining-if-the-kangaroos-will-land-in-the-same-position
The answer Julia really likes to read again and again:
http://codereview.stackexchange.com/a/139898/123986
Will come back to write more.
2. Design talk, junior level coding skills -> great ideas to improve
http://codereview.stackexchange.com/questions/36482/rpsls-game-in-c
3. Follow the advice as well -
http://codereview.stackexchange.com/questions/11233/responsive-adaptive-website-code
4. Interview task - SOLID Priciples and TDD (Dec. 4, 2016)
http://codereview.stackexchange.com/questions/41834/interview-task-solid-principle-and-tdd/41843#41843
5. ChrisWue - what questions are answered.
http://codereview.stackexchange.com/users/30346/chriswue
6. Play with code, and write two versions: OO version, old school version as well.
http://codereview.stackexchange.com/questions/36395/rock-paper-scissors-lizard-spock-challenge/36402#36402
7. Julia just loves to read:
http://codereview.stackexchange.com/questions/107581/check-if-more-engineers-are-happy-than-not-happy/107594#107594
How to become a great front-end engineer
Nov. 30, 2016
Julia starts to learn everything in order to be a front-end engineer, she started to learn CSS a few years ago, in 2013. And then, she spent over 10 months to learn JavaScript, in 2014, and continued on many topics. And then, she worked very hard to work on computer foundation, Leetcode algorithms, HackerRank, from 2015 to 2016. She needs to learn to write solid code.
Also, she needs to find time to go over so many courses on front-end on pluralsight.com, she learned a few things in 2016 about web usability, and on CSS, html5, bootstrap, Angular JS etc.
How to become a great front-end engineer
Arguments Julia likes to evaluate:
1. "The longer I work on the web, the more I realize that what separates the good people from the really good people isn’t what they know; it’s how they think."
2. "Read other people’s code"
Solving problems on your own is a great way to learn, but if that’s all you ever do, you’ll plateau pretty quickly.
3. Work with people smarter than you
4. Reinvent the wheel
But in this article I’m talking about how to go from good to great
5. Write about what you learn
The best reason is it forces you to understand the topic better. Even if no one ever reads what you write, the process of doing it is more than worth it.
1. https://philipwalton.com/articles/
2. https://twitter.com/FogCreek
Introduction
Julia starts to learn everything in order to be a front-end engineer, she started to learn CSS a few years ago, in 2013. And then, she spent over 10 months to learn JavaScript, in 2014, and continued on many topics. And then, she worked very hard to work on computer foundation, Leetcode algorithms, HackerRank, from 2015 to 2016. She needs to learn to write solid code.
Also, she needs to find time to go over so many courses on front-end on pluralsight.com, she learned a few things in 2016 about web usability, and on CSS, html5, bootstrap, Angular JS etc.
Article to read
How to become a great front-end engineer
Arguments Julia likes to evaluate:
1. "The longer I work on the web, the more I realize that what separates the good people from the really good people isn’t what they know; it’s how they think."
2. "Read other people’s code"
Solving problems on your own is a great way to learn, but if that’s all you ever do, you’ll plateau pretty quickly.
3. Work with people smarter than you
4. Reinvent the wheel
But in this article I’m talking about how to go from good to great
5. Write about what you learn
The best reason is it forces you to understand the topic better. Even if no one ever reads what you write, the process of doing it is more than worth it.
Blog reading
1. https://philipwalton.com/articles/
2. https://twitter.com/FogCreek
Tuesday, November 29, 2016
HackRank - New Year Present - ACM ICPC Practice Contest 2016
Nov. 29, 2016
Problem statement:
https://www.hackerrank.com/contests/acm-icpc-practice-contest/challenges/newyear-present
Julia spent Sunday Nov. 27, 2016 morning to work on the algorithm near 2 hours, she could not make any points on the algorithm. The contest stated at 6:30am, but she did not start until 9:30am. A few things she has to work on:
1. The math she worked on needs to be reviewed carefully.
2. She should focus on getting the math analysis correct first.
3. She played with code and then got more concrete ideas what she should work on.
3 submissions she did:
1.
https://gist.github.com/jianminchen/bcee26d0f395cd6dee04b3d53184c2a4
2.
https://gist.github.com/jianminchen/4685370ce58987054c0336b9f1dfdcfd
3.
https://gist.github.com/jianminchen/e64d46ac00f157e4871f7f27b0798131
Actionable Items:
Julia, go ahead to work on other algorithms on the contest. Make "New Year Present" work first.
ACM ICPC only has 5 hours, but 8 questions. So, each algorithm at most 40 minutes. There are 3 people in a team. Not one person's game.
The algorithm should be very elegant, classical algorithm.
Julia, if the combination is not simple enough, you probably cannot make it; better to read other algorithms and get informed about the contest instead.
Blog reading:
1. https://philipwalton.com/articles/how-to-become-a-great-front-end-engineer/
2. https://css-tricks.com/interviewing-front-end-engineer-san-francisco/
3. https://medium.com/@YogevSitton/the-ultimate-reading-list-for-developers-e96c832d9687#.gaawpaf01
Problem statement:
https://www.hackerrank.com/contests/acm-icpc-practice-contest/challenges/newyear-present
Julia spent Sunday Nov. 27, 2016 morning to work on the algorithm near 2 hours, she could not make any points on the algorithm. The contest stated at 6:30am, but she did not start until 9:30am. A few things she has to work on:
1. The math she worked on needs to be reviewed carefully.
2. She should focus on getting the math analysis correct first.
3. She played with code and then got more concrete ideas what she should work on.
3 submissions she did:
1.
https://gist.github.com/jianminchen/bcee26d0f395cd6dee04b3d53184c2a4
2.
https://gist.github.com/jianminchen/4685370ce58987054c0336b9f1dfdcfd
3.
https://gist.github.com/jianminchen/e64d46ac00f157e4871f7f27b0798131
Actionable Items:
Julia, go ahead to work on other algorithms on the contest. Make "New Year Present" work first.
ACM ICPC only has 5 hours, but 8 questions. So, each algorithm at most 40 minutes. There are 3 people in a team. Not one person's game.
The algorithm should be very elegant, classical algorithm.
Julia, if the combination is not simple enough, you probably cannot make it; better to read other algorithms and get informed about the contest instead.
Blog reading:
1. https://philipwalton.com/articles/how-to-become-a-great-front-end-engineer/
2. https://css-tricks.com/interviewing-front-end-engineer-san-francisco/
3. https://medium.com/@YogevSitton/the-ultimate-reading-list-for-developers-e96c832d9687#.gaawpaf01
Monday, November 28, 2016
Research: Write coding blog vs contribution to stackoverflow?
Nov. 28, 2016
Julia likes to share her experience on writing coding blog vs contribution to stackoverflow. Both areas she is new.
Facts:
1. coding blog, less than 2 years; starting from June 2015
2. stackoverflow, less than 1 month; she did add her profile in Nov. 2016.
To write a coding blog is a lonely journey, she tried to figure out how others are doing, and how others are busy working on to progress to be top-talented.
Julia did work on several issues efficiently through coding blog:
1. Keep track of what she did work on before; document the time she worked;
2. Google blogger has very good features, very easy to do blog search, labels are very helpful;
3. Julia started to find more ideas to get more organized, work on the algorithm continuously through days, weeks, months.
4. Julia had good time to read her own coding blog, on her cellular phone, desktop, and everywhere.
It is like tennis sports, it is better to have a lot of hitting partners, and learn from team work, communications.
Julia did not get any coding review through blog comment. So, it is true that not so many people work on coding blog these days. One of reasons Julia works on is to develop her writing talent.
Share a quote to encourage herself to work hard - find it first!
Will come back to add more thoughts on the topic.
Actionable Items:
1. Study the post:
http://codereview.stackexchange.com/questions/116469/print-the-n-longest-lines-in-a-file
2. Study how she does to get such good performance:
http://codereview.stackexchange.com/users/36120/emily-l
- 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.
Julia likes to share her experience on writing coding blog vs contribution to stackoverflow. Both areas she is new.
Facts:
1. coding blog, less than 2 years; starting from June 2015
2. stackoverflow, less than 1 month; she did add her profile in Nov. 2016.
To write a coding blog is a lonely journey, she tried to figure out how others are doing, and how others are busy working on to progress to be top-talented.
Julia did work on several issues efficiently through coding blog:
1. Keep track of what she did work on before; document the time she worked;
2. Google blogger has very good features, very easy to do blog search, labels are very helpful;
3. Julia started to find more ideas to get more organized, work on the algorithm continuously through days, weeks, months.
4. Julia had good time to read her own coding blog, on her cellular phone, desktop, and everywhere.
It is like tennis sports, it is better to have a lot of hitting partners, and learn from team work, communications.
Julia did not get any coding review through blog comment. So, it is true that not so many people work on coding blog these days. One of reasons Julia works on is to develop her writing talent.
Share a quote to encourage herself to work hard - find it first!
Will come back to add more thoughts on the topic.
Actionable Items:
1. Study the post:
http://codereview.stackexchange.com/questions/116469/print-the-n-longest-lines-in-a-file
2. Study how she does to get such good performance:
http://codereview.stackexchange.com/users/36120/emily-l
- 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.
Everyone faces challenges on court and I’m no different. Get out on court and overcome yours to #CreateYourMark pic.twitter.com/RSNn7AqFch— Ana Ivanovic (@AnaIvanovic) May 21, 2016
HackerRank - Bear and Steady Gene (VI)
Nov. 28, 2016
Julia noticed that those two blogs are most viewed:
http://juliachencoding.blogspot.ca/2016/03/hackerrank-bear-and-steady-gene_5.html
707 views
http://juliachencoding.blogspot.ca/2016/03/hackerrank-bear-and-steady-gene_13.html
699 views
So, Julia decided to review the algorithm, and she learned something new.
Summary of workout:
1. Find the most simple solution to study - two pointers, sliding window technique;
2. Write a C# version - understand the algorithm
3. Code review, and write a new version
4. Submit a code review request - her first coder review on stackexchange.com, and get some feedback.
Details:
1. Study the C++ code:
https://gist.github.com/jianminchen/c6b51207f9cc9b083573
Time complexity of algorithm: O(n)
typical two pointer technique, left/ right pointer, both at most travels forward once.
Timeout issue - O(n^2) brute force solution
2. Write a C# version:
https://gist.github.com/jianminchen/c4f1c84c984e58fdcdc467e6f28d84e3
code review:
1. line 26, int[] a = new int[1007];
1007 is not meaningful, we know the size should be bigger than 'Z', and we only need the array of size 4
2. variable i and index are not meaningful. There are two loops.
3. valid function from line 49 - line 58
line 52 - 55 - four constant chars are used.
3. Review the code and make the change:
https://gist.github.com/jianminchen/124b33e3d7aa0276e7b6ea4542c8ad5b
1. line 26 - 36, add 4 test cases, with 4 postcondition assertions
2. function name is changed to minChange
3. line 61, array of size 4 is declared instead of 1007
4. function indexOf() is added
5. variable names are changed, left, right, two pointers, move forward only
6. add two explanation variable c1, c2 to advoid complicated expression.
7. valid function is declared using a for loop.
Based on the code review on this post:
http://codereview.stackexchange.com/questions/142808/quick-sort-algorithm/142853#142853
answered by Eric Lippert
4. Submit the code review on stackexchange.com code review, here is the link:
http://codereview.stackexchange.com/questions/148407/hackerrank-bear-and-steady-gene
Review got from the site:
Actionable Items:
Julia likes to do some research, why it takes her over 6 years to start to work on stackoverflow, actively join the community, become one of them.
Some facts she put together here:
1. Julia noticed on Nov. 28, 2016 that on stackexchange.com code review section, the experienced professional responded to her first post in less than one hour; (a fact)
2. The advice she got is free, she does not need to pay; all she has to do is to share her question and her research; And the comments are very good; She also enjoys the sharing her workout.
3. Julia tries to get help from other professionals, she was too naive to check statistics of coding blog, but no one could give her any input. Finally, she figured out that she has to get smart, reach out stackexchange.com/ code review, ask help, show what she has completed.
4. Congratulate Julia to know how to connect with other peers efficiently, her first post on stackoverflow.com - her first 10 points of reputation.
5. Julia did some study on stackoverflow - how to ask a good question, and she knows that the question does not belong to her, it belongs to the community. That is the reason she can get help quickly. (her research on stackoverflow over 10 hours in Nov. 2016)
6. Write down her own understanding - research more later: Coding blog vs. stackoverflow contributions
June 6, 2017
Work on Leetcode 187 Repeated DNA Sequence
Julia noticed that those two blogs are most viewed:
http://juliachencoding.blogspot.ca/2016/03/hackerrank-bear-and-steady-gene_5.html
707 views
http://juliachencoding.blogspot.ca/2016/03/hackerrank-bear-and-steady-gene_13.html
699 views
So, Julia decided to review the algorithm, and she learned something new.
Summary of workout:
1. Find the most simple solution to study - two pointers, sliding window technique;
2. Write a C# version - understand the algorithm
3. Code review, and write a new version
4. Submit a code review request - her first coder review on stackexchange.com, and get some feedback.
Details:
1. Study the C++ code:
https://gist.github.com/jianminchen/c6b51207f9cc9b083573
Time complexity of algorithm: O(n)
typical two pointer technique, left/ right pointer, both at most travels forward once.
Timeout issue - O(n^2) brute force solution
2. Write a C# version:
https://gist.github.com/jianminchen/c4f1c84c984e58fdcdc467e6f28d84e3
code review:
1. line 26, int[] a = new int[1007];
1007 is not meaningful, we know the size should be bigger than 'Z', and we only need the array of size 4
2. variable i and index are not meaningful. There are two loops.
3. valid function from line 49 - line 58
line 52 - 55 - four constant chars are used.
3. Review the code and make the change:
https://gist.github.com/jianminchen/124b33e3d7aa0276e7b6ea4542c8ad5b
1. line 26 - 36, add 4 test cases, with 4 postcondition assertions
2. function name is changed to minChange
3. line 61, array of size 4 is declared instead of 1007
4. function indexOf() is added
5. variable names are changed, left, right, two pointers, move forward only
6. add two explanation variable c1, c2 to advoid complicated expression.
7. valid function is declared using a for loop.
Based on the code review on this post:
http://codereview.stackexchange.com/questions/142808/quick-sort-algorithm/142853#142853
answered by Eric Lippert
4. Submit the code review on stackexchange.com code review, here is the link:
http://codereview.stackexchange.com/questions/148407/hackerrank-bear-and-steady-gene
Review got from the site:
- In C#, method names should be PascalCased, not camelCased.
- In
minChange, you should use meaningful variable names fora,c,c2 - In
minChange, you can setvar ans = int.MaxValue, unless there is a compelling reason avoid usingInt32when you can useint, same withInt16vsshortorInt64vslong. - In
indexOf, you can use aconst string code = "ACGT";instead. This gives some compiler optimizations. - In
valid, (andminChange) you should use meaningful parameter names,nandadon't have any contextual meaning.
Actionable Items:
Julia likes to do some research, why it takes her over 6 years to start to work on stackoverflow, actively join the community, become one of them.
Some facts she put together here:
1. Julia noticed on Nov. 28, 2016 that on stackexchange.com code review section, the experienced professional responded to her first post in less than one hour; (a fact)
2. The advice she got is free, she does not need to pay; all she has to do is to share her question and her research; And the comments are very good; She also enjoys the sharing her workout.
3. Julia tries to get help from other professionals, she was too naive to check statistics of coding blog, but no one could give her any input. Finally, she figured out that she has to get smart, reach out stackexchange.com/ code review, ask help, show what she has completed.
4. Congratulate Julia to know how to connect with other peers efficiently, her first post on stackoverflow.com - her first 10 points of reputation.
5. Julia did some study on stackoverflow - how to ask a good question, and she knows that the question does not belong to her, it belongs to the community. That is the reason she can get help quickly. (her research on stackoverflow over 10 hours in Nov. 2016)
6. Write down her own understanding - research more later: Coding blog vs. stackoverflow contributions
Follow up
June 6, 2017
Work on Leetcode 187 Repeated DNA Sequence
Subscribe to:
Posts (Atom)