Showing posts sorted by relevance for query mocking make difference. Sort by date Show all posts
Showing posts sorted by relevance for query mocking make difference. Sort by date Show all posts

Wednesday, June 28, 2017

Common mistakes talk

June 28, 2017

Introduction


It is a good idea to celebrate 80 times mocking experience with a coding blog. What is the good topic? Julia learned a lot, and she likes to write common mistakes in the mocking experience.

Julia did some research on the topic "Do mocking make difference?". Julia likes to set a new goal for her practice, improve her communication.

One interesting topic Julia likes to bring up is 3000 algorithm practice, Julia likes to build up skills by playing hackerrank contest, Leetcode practice and mocking experience. And also Julia learns to journal her emotions through the practice in order to build mental toughness.

Julia started to cut short those long hours for Hackerrank contest, she likes to write a few blogs when she prepares to solve a medium or expert level algorithm, she also likes to read some good lecture notes and do some research on the topic, certainly Julia learns to succeed on week code of 33 and enjoyed her first gold medal.


Common mistakes 


Julia was complained once that she made the mocking experience like an exam, it should be a conversation. And another time Julia was told that if she was given a hint, she should take it, do not be a hacker. Julia learns to respect the peer and follow the direction right away. So she was surprised that today mocking experience, she tried to give same advice, but the peer did not take it. 

Here are 10 more mistakes Julia learns from her last 80 mocking experience:

1. One of the peers asked very politely in the first minute, how does the mocking work? Are you a professional?  Question is how to show up very professionally? Age difference?
2. Prepare peer's algorithm very well as an interviewer. For example, quickly look up Google and get  an API stackoverflow link for the peer.
3. Miss base cases in the algorithm analysis
4. Do not talk and explain the base case in DFS design in the first place. Need to learn more about DFS algorithm design, know different kinds of solutions, and then communicate efficiently.
5. Easy to get stuck or be distracted from the algorithm.
6. Fail to come out dynamic solution or recurrence formula quickly. Julia did notice the issue in her first round.
7. Some of peers expect the code ready to run with test cases and you should show the correct result.
Work hard until you can write the algorithm and make sure that the algorithm can run. Practice more.
The third time Julia wrote the same algorithm and then she was asked to run the code, she had a few bugs to fix.
8. Do not write code until you have fully figured out the algorithm. Explain the algorithm and share your thinking process. Julia had the mistake in one of her first 20 mocking practice.
9. Learn whiteboard testing. But test the code very hard. Do not fake it. Julia still found bugs by running the code using sample test case, after whiteboard testing. Do not fake the testing, work hard.
10. Prepare to extend the algorithm if the peer finish only first 10 minutes, try to extend the algorithm until the peer fails. Know how to measure the depth of the knowledge. Julia figured out after practicing more than 80 mocking practices.
11. Miss the optimal solution for an algorithm after more than 3 times practices. Julia knew the issue after 90 mocking practice.
12. There are always something new coming out in each mocking experience. Julia noticed that after she started third round.


Related work from Hackerrank contest 




Julia likes to play tennis sports and play hackerrank contests. Both needs hard work.

Julia played over hundreds of hours tennis sports, hundreds of double and single matches, experienced the muscle pain and all kinds of issues, she also experienced a lot of joy through the hard work. She learns to control the ball and placement so well over thousands of strokes, she gains the new sports skills.

Related to tennis sports, from June 2016 to June 2017, Julia built up similar experience through Hackerrank contests, she journal every practice, wrote down her emotion, time to play, short term and long term goal, she started to collect 7 bronze medal, 2 silver medals, one gold medal last 12 months. Exactly after 12 month, she got her first gold medal, top 4% in ranking of over 11,000 players. She adapted her skills on tennis sports to competitive programming field. 

Julia plays so many contests, there is always next one. No time to get frustrated long because she has to play next one and stay at the moment. It is hard to deal with frustration and expectation, but Julia learns to take care of herself with a lot of sports competition matches, just remind her that hard work beats the talent. Wishful thinking wastes time, but choose to sports therapy, learn from tennis professional players to work on basics. 

Learn to count algorithms


It is not easy to stay humble for computer science Ph.D. students. Julia worked on the computer science Ph.D. study from 2001 to 2010, she never learned to count how many algorithms she works on. There is no target, no goal setting on algorithm practice, and there is no result.

How does Julia happen to make changes after her full time work last 7 years? Julia learned the tough lesson when she developed the sales analysis report. She was challenged again and again about the number she provided, she did not handle the pressure very well the first few years. From 2010 to 2015, Julia does not count how many algorithms she works on.

Starting from 2015, she put months hard work together to rewrite C# code with the new design, she likes to integrate with Microsoft Excel easily so she can continuously build some analysis.

One day she sets a goal, she likes to be able to verify the final number in less than five minutes; she added the drill-down functionality in her report, she can quickly export large data sets and use Microsoft Excel to do further analysis to find root cause if need.

Be a top player in algorithm and data structure contest on hackerrank, Julia also sets up a goal.

Her goal is to complete 3000 algorithm practice, enjoy the journey; she works on leetcode, meanwhile playing hackerrank contest; when she plays hackerrank contest, she uses Leetcode algorithms to help her to be a better player. She only completes over 100 algorithm related to Leetcode algorithm. Her gists shows 851 gists on June 29, 2017. 

Saturday, April 8, 2017

H tree - a talk about training

April 8, 2017

H-tree is constructed by layers, next layer will start from four corners of H as centers, and the size will be smaller one.

Problem statement - Read this Java implementation from princinton.edu - H-Tree

Introduction


Julia started to study mocking interview, and see how many things she should work on. Instead of writing a simple recursion version, Julia chose to write a BFS solution using queue. It is a good practice and also showed her passion to write a solution and learned from her mistakes on the mocking.

Training review 


Here is the C# code she wrote in mocking 30 minutes.

Spent over one hour to make the C# code bug-free and code readable.
Also, line 83, correct the calculation of length using square root 2. C# code is here.
Again, make variable names shortest, line 90 - 95. C# code is here.
Things learned in the mocking experience:

1. Julia thought out loud using queue to implement the solution, the interviewer gave out hints to use stack, depth first search;

2. Julia thought about using stack but forgot about recursive function is a natural stack; in other words, using simple recursive function call.

BFS/ DFS difference - DFS can use recursive call, internal stack.

3. Using Queue will work, but the depth should be pushed with queue with center node's information.

4. It is important to stay calm, write instructional code.

Highlight of good/ bad things in mocking experience
(the C# code in mocking experience, good thing is highlighted using brown color, bugs and mistakes are in yellow color):

0. line 1 - 12 work on a H-tree understanding, write a small test case. Understand the H-Tree draw lines, and also requirement of starting length and depth.
1. line 18 - 27, write an internal class Node, define two variables, node and depth.
2. line 22 - 26, Write public constructor of Node class to set up a new node
3.  line 30, Function name is very good - DrawHTreeToDepthUsingBFS
4.  line 30, Function DrawHTreeToDepthUsingBFS's design flaw - return argument should be IList<Node>, not IList<Tuple<int,int>>, missing depth information. Depth information is needed to calculate length of H-Tree.
5. line 29, time complexity is correct? Need to write a recurrence formula first, and then time complexity.
6. line 34 - 37, depth <= 0 will be better
6B. line 39 - syntax error - duplicate new Node(
7. line 41 - Enqueue method - input argument should be variable - node
8. line 43 - adjustLength = depth;  should be adjustLength = startLength, mix length and depth two variables
9. line 57 - 64, should add checking of depth, add H-tree is conditional - major issue
10. line 57 - 60, 4 corners of H, new center node's x, y values are not correct.


Julia, you have to learn from tennis training coach - Janko Tipsarevic - train yourself to be able to write a bug-free, very instructional code. When in real matches, a lot of emotions are mixed with pressures, will to win, anxiety and pressure, you will not notice those mistakes and errors.

Next time, try to write much more slowly, make sure that every line of code is bug-free, syntax ok, no duplicate code.

Through this mocking experience, Julia learned that she still had to practice more on BFS algorithm using Queue, Julia was very comfortable to write and understood that either BFS/ DFS will work out with no problem.

Julia did not have time to go over the code because the peer did not want to wait after 30 minutes.

Also, Julia did not come out using recursive function to write, even after hints. Julia was nervous because she asked help to understand H-Tree with the test case.

Julia likes to show her rigor training through asking over 30 algorithm questions she got from codereview.stackexchange.com code reviews last 6 months, she is able to write perfect and most modern C# code.

Actionable Items


1. Learn to interview people with different background, technical strength; Learn to write down notes and give out good advice.

2. Do not book more than one mocking a time.

3. Try to improve score of problem solving skills, ratings are low 3 of 7.

4. Take it slow, write instructional code, avoid duplicate code. Using meaningful variable name, function name.


5. Go through up-and-downs through mocking experience, learn to appreciate the time of peer. Try to
manage better the 30 minutes time. Avoid lengthy discussion, be very diplomatic, writing is most important part to show good skills and analysis.

6. Work on a small test case first, this part is very good warmup and prevent bugs in writing and design correctly first time.

7. Make the mocking experience more structured, write down a small test case to understand the problem, show some analysis, and talk about design and choices I may have.

8. All issues Julia had on real experience are reproduced in this mocking experience. Julia, practice more. Do not give up. Write down your feelings, and issues. You will sort it out later.

Follow up 


June 19, 2017 mocking third time. Very short and clean, using recursive function, using meaningful name. C# practice is here.

Monday, July 24, 2017

Boggle - find words in matrix of letters

July 24, 2017

Plan to study the algorithm Boggle coding blog. The blog link is here written by Aviad Ezra.

There are a lot of thing for Julia to learn through those blog and code sample. Let us read words from Aviad Ezra together in the following:

Learn: Cracking the interview, solve all 189 questions.

Practice: Nothing beats mock interviews. It will boost your confidence and you’ll learn a ton from having someone watching you and listening to your explanations while you solve coding problems. You can pair with a friend or use one of the free peer-to-peer mock interviewing platforms. You don’t need to sacrifice your first interviews just to get hands-on practice.

Think fast: Developers that can think on their feet do much better in coding interviews. Practice in as many competitive programming sessions as you can.

Before you lost hope, keep in mind that there's a finite number of algorithms topics and only a handful of data structures that are used in the interviews.

Those words from  Aviad Ezra are so encouraging, Julia wrote her own blog about "Can mocking make difference?". First time she learns to work with people, share with people, learn from people on small things, like presenting her face in the centre through the video, ask good questions, give good hint, form a quick friendship etc.

In the following, Julia uses Leetcode 212 to help herself review Trie data structure and learn how to apply same algorithm as Boggle classified in Leetcode.



Leetcode 212 - word search II


Review Leetcode 212 last practice using Trie. The link is here.

It is so surprising that learning Trie and practice depth first search is most fun activities in the summer of 2017. Julia has to warm up the algorithm, play with one test case with Trie class, and also make the code more readable. Here is the warmup C# code using Trie data structure, recursive function calls. The solution is optimal and also pass online judge.

It is also a good idea to discuss why Trie is needed for better time complexity.

Brute force solution is to go over each word in the dictionary, and then try to find it in the matrix. The total number of search using DFS is m (words) * rows (matrix) * columns (matrix).

The brute force solution has timeout issue through Leetcode online judge. We like to review why the time complexity should be better.

Let us go over dictionary with 4 words, "aaa", "aaaa","aaab", "aaac". If we pre-process the dictionary and store all words in a Trie, and then we do not have to go over each words to search matrix. We only need to go over each element in matrix as start char in a word, search the trie to find match words using recursive function. The number of search using DFS is rows (matrix) * columns (matrix).

Second advantage related to the above 4 words ( "aaa", "aaaa","aaab", "aaac") is taking advantage of Trie data structure. The space complexity of Trie is better compared to hashset or hashtable. The same prefix "aaa" is only repeated once in the Trie.

This hard level algorithm applying Trie will be Julia's most favorite algorithm in the month of July 2017.

One of practice in 2017 is prefix neighbor on hackerrank, Julia asked the code review on stackexchange.com.


July 26, 2017

Trie against Hashset


Related to the test with a dictionary "aaa","aaaa","aaab","aaac","aaad", let us work together to talk about the difference.

For example, if the dictionary is saved in hashset, then go over each word in the dictionary, try to find word in matrix.
For example, "aaab", the first three letters has to be compared and they are the same first, then the last letter will be checked. Same will be applied to another 4 words. In total, the prefix "aaa" will be compared exactly 5 times in order to find those 5 words.

Can we do better? Just compare the prefix "aaa" once? Cetainly we can. We can save the words in a trie instead of hashset.

a
|
a
|
a
|\  \  \
| \  \  \
|  \  \  \
a  b  c  d



Trie efficiency talk 



It takes some time to get comfortable to design a Trie. So far, Julia has written a Trie implementation more than 4 times in C# last 3 years. Given the fact that she has worked on computer science more than 20 years, if she writes a algorithm every day, then she will write 60,000 algorithms. It is smart to focus on one simple thing, write code for algorithm and data structure, no matter life goes up and down, make it a hobby.

How to design a Trie so that the space complexity is minimum?
For example, the dictionary has the following words, "aaa","aaaa","aaaaa","aaaaaa".
How to store them in Trie efficiently?
a
|
a
|
a   word: "aaa"
|
a   word: "aaaa"
|
a   word: "aaaaa"
|
a   word: "aaaaaa"

The above diagram shows that those four words are saved in a Trie. How many char 'a' are saved in Trie, only 6, not 3 + 4 + 5 + 6 = 18 chars. Four words are saved along the trie nodes.

Every node can represent a word, it does not have to be a leaf node.

It is a smart decision to write down some test cases, so next time when Julia comes cross an algorithm, she can quickly relate to the test cases and figure out the advantage of using Trie.

Tuesday, June 20, 2017

Can Leetcode weekly contest make difference?

June 20, 2017

Introduction



It is a ritual to do small research every day. Today Julia chooses a topic called "Can Leetcode weekly contest make difference?"

The reason Julia chose the topic is that she found out her last leetcode weekly contest reminded her to work on the basics - linear scan array more efficiently. The blog is called Leetcode 605: Can place flowers.  Julia found a very short solution through Leetcode discussion after she spent 48 minutes in the contest, she learned to solve the problem using 5 minutes. Only 10% of time, she learned the basics of linear scan an array, looping first.

On June 19, Julia noticed that she performed better on mocking experience of algorithm Leetcode 151 compared to her last one more than one month ago.

The argument is that "Leetcode weekly contest makes difference".


Performance talk 


Leetcode.com is so helpful because it attracts million players to share ideas, compared to code review on stackexchange.com, Julia found out that Leetcode.com is a good place to find excellent ideas to solve a Leetcode algorithm, but codereviwe.stackexchange.com is an excellent place for Julia to practice good writing and learn how to share her learning. 




Sunday, April 30, 2017

Talent small talk

April 30, 2017

Introduction 


It is a very happy weekend with a world codesprint contest and then two mocking experience. Julia also spent one hour to play some tennis and felt much better after she ran 30 - 45 minutes, she was amazed that her muscle memory of tennis was so good, she could control tennis balls so well through a full court rally. She enjoyed the sliced shot and very good timing and control of landing position to hit a stroke.

She also felt that it is important to seek the advice to be a just-so-so contest player scoring 36 points over 13 hours compared to top players scoring more than 280 in less than 2 hours. Read those data - less than one hours 10 minutes, top number 1 - Gennady.




What are the missing parts she should work on next?

A lot of professional WTA tennis players are very good at changing coaches when they deal with up-and-downs. What does Julia do for this case? Should she change her coach? She is self-coaching and writing blogs to keep tracking of her progress.

Need a therapy after the contest. Remember the favorite video she watched about Roger Federal talking about his early age, throwing tennis racquet in front of thousands fans. Take some time to learn from Roger Federer.

Watch this video to get entertained. Roger Federer - top 10 smiling after points lost, link is here.

Talent talk 


Where is the talent? I like to find some drills to work on to help myself to cover the weakness of talent. 

Watch the video - tennis funniest moments ever. Link is here. And read the article - waste time is healthy in big data term, link is here. 

Data structure talk 



Julia met a same person for the second time in less than 30 days through mocking experience, and then she learned a few things through 30 minutes. Friendship forms quickly after the first experience.

Case 1: She likes to design a data structure to return a list of pair integer numbers in the array, she said that since it is the unknown size, she likes to declare C# IList<string>, and then "why it is string?" The peer asked, Julia said that because there are two numbers, I like to encode and decode like a + b; otherwise I like to use Tuple<int, int>, the peer just typed that you just use this one IList<int[]>.

Julia never uses this one before, but it is so good ride once she uses it. Story is short, better give a good name "int[] beats string".

Case 2: Julia likes to change HashSet to a Dictionary<int, Object>, and then the peer asked, can you make a minor change to fit the requirement; Julia was told to finish the coding, and do a whiteboard testing using a test case. Do mocking algorithm really need Dictionary that complicated?

Through the discussion, Julia learned that it is a good practice to write simple code. Be more organized!

Transcript is here. Later it will be compiled to C# code.

Recurrence formula talk 



It comes out that the recurrence formula is challenging for those 3  talented programmers in the world last weekend. In other words, Julia used the same algorithm to interview two people last weekend.

Her first interviewee was troubled, confused, since the problem statement is wrong, and Julia had difficult time to step in and give good hints to guide, since Julia had a math degree but it is like the muscle to fat story, she also got confused on recurrence formula in those 30 minutes. But then second time to use the algorithm, Julia was more determined to apply recurrence formula, no more playing with test cases. Just write down clearly the formula first.

The interviewee is much quickly to take hint, and then write code. She felt those two difference. Less experienced one is much more easy to try new things.


Also Julia learned the algorithm quickly, when she interviewed second person using same algorithm, she wants to make the difference. She learned that good interviewer should do something to help out. 

Whiteboard technique



From the contest to the leaderboard by Microsoft to a blog writer -

Google intern and interview blog is here. Whiteboard talk is excellent.

Bronze medal talk



It is the time to celebrate Julia’s fifth bronze medal, Julia got a bronze medal for world codesprint 10. How to express the feeling of bronze medal? Julia likes the hard work she put in those hours, and she did so much work and tried again and again for new ideas to break through the hurdles. She is more experienced to play contests now compared to last year.

Julia takes time to enjoy her status right now, one day she will easily make over 30% or over 100 points and come back to look at the stage she is in. Honestly the contest is like school home work, and bronze medal is for Julia to celebrate a grade “C”, but she tries to get grade B – silver medal, one day she can get grade A. Julia scored 36 point (360 maximum points), 10% scoring. 


Julia likes the competition because it is fair, open and her peers are all over the world. Compared to take algorithm course in university to learn more, she does not need to figure out who is the professor in the university, fair or not fair on grading. All she has to do in the competition is to work damn hard, write down something, either a blog, or code or analysis. Dedicate a few hours on each algorithm in the contest. From there she can continue to work on after the contest. 

Psalm 126:5 Those who sow with tears will reap with songs of joy.
6 Those who go out weeping, carrying seed to sow, will return with songs of joy, carrying sheaves with them.

Julia sowed, teared, reaped, sung, weeped, carried.

Follow up on data structure talk 


In previous data structure talk, Julia shared the story about mocking experience. The peer coached her to use int[] instead of using string or Tuple<int, int>. Such a wonderful coaching through mocking experience.

Afterwards, Julia asked her favorite algorithm coach JS1 on code review about using int[] data type compared to string related to Queue. Here is the algorithm question on code review. 

do you think that it is also good idea to declare var queue = new queue<int[]>? row and col can put into the array new int[2]. Therefore, we do not need to encode a key and then decode the key to row and col two variables. I am learning data structure and try to speed up coding. – Jianmin Chen

It's a matter of preference. I tend to use primitive types whenever possible, but if using int[] seems easier to understand than using a single int, then you should do that. Note that using a single encoded int leads to a simpler visited array as well. – JS1 

Tuesday, June 6, 2017

A recipe for interview

June 6, 2017

Read blogs written by Jocelyn. Here is one of blogs called "A recipe for an interview".

Introduction


It is such a great learning experience to understand how interview works. Julia always encourages herself to be a learner. Philippians 4: 6 - 8, do not be anxious on anything, guard your hearts and mind.

It is also a good idea to read very nice article and learn the recipe being an interviewer. Julia recently did some study about "Can mocking make difference?", she continued to study the topic. "Recipe for the interview" is very well written article to explain how to use behaviour questions to sort out the candidates.




Notes taken 


Question #1: You've been doing <X> for a while. About how much of <x> have you personally done?

Question #2: What does it mean to do <X> well?

Question #3: What do you personally do when you do <X>?

Question #4: Have you made any <X> mistakes? Pick one and tell me the story.

Question $5: How did you ultimately deal with the situation?
Question #6: Do you think you could have avoided the mistake?


Bad answer: any of the neutral answers as their primary focus. Coming up with an opinion on the spot rather than having thought about it before.


Bad answer:
Never thought of improving their process as a result of the mistake. Thinking about it for the first time in the interview with you. The
change they come up with doesn't give you confidence it would prevent future mistakes.


Remember: do NOT feed then the answer to this question. Establishing up front what they think matters is critical to assessing answer quality in later questions in the series.

Tuesday, June 20, 2017

Can mock interview make difference? Continued

June 20, 2017


Introduction



"It takes a village to raise a child". Related to improve algorithm and data structure, Julia learned that it also takes the hundred people to help her learn depth first search using recursive function.

As a classical depth first search algorithm, Julia worked on the Sudoku algorithm in 2015, she collected over 10 solutions; She thought that she mastered the sudoku algorithm in 2015, actually not! How did Julia find out the fact?

Julia practised Sudoku solver in April and May of 2017. First experience is in April, the peer complained that Julia forgot to write a base case in her first writing and gave a rating of 3 with comment "Do not know how to write code", and then second one is in May, the peer coached Julia to set base case first thing in the design, do not write any small function, keep it short as possible, quick as possible. From those two hours to work with two different people, Julia learned to stay humble, learn and quickly fix her learning issues. With those two mock interview experience, Julia learned the Sudoku solver in totally surprising ways. Learn from people from recent graduate and senior developer, recent graduate explained what to work on through Google onsite experience, and the senior developer showed her later in second meeting with more tips.

June 18 and 19 weekend, Julia worked on the expert level algorithm called path matching, she scored 0.46 out of maximum score 100, she worked on over 5 hours but she learned depth first search again through the problem solving. Julia likes to solve the problem first, it does not matter if she scored less than 0.5%. She likes to get expert level algorithm problem solved first.

Julia starts to meet a person a day to work on algorithm problem solving, she also pays attention to peer's curiosity level on algorithm and problem solving, how good the peer can influence her through one hour conversation. Today she was surprised that the peer shared her link to solve C# problem from stackoverflow.com. Also the peer also typed the test case for her, and then Julia found out that her code had a bug, wrong output.

Julia learns how to do whiteboard testing and she did one today as well. But she missed the bug. So she felt that the peer is much better a tester and maybe she is a project manager working somewhere. It is the second time Julia worked on the algorithm.

A research talk 



The mocking experience is short, only one hour, the peer chose to turn off the video. But the quality of the work is very impressing, Julia found out that she is lacking of this kind of preparation for the mocking experience. 

Julia worked on extra 10 minutes to use Microsoft visual studio to find the bug. It is an excellent experience. 

C# code is here. 

In the line of 44, the new variable should be declared for each key value pair of dictionary. It is called nextPrefix. Do not change the function argument prefix, based on the least astonishment principle.

So share the advice Julia got today.

-very good communication, i liked how you explained your thought process thoroughly -got to the answer fast but still made sure to test before writing code

it's ok to ask the interviewer if you can look up inbuilt/library functions for the language if you need to, that might be helpful sometimes.


Tuesday, July 11, 2017

Sponsor application project

July 11, 2017

Introduction


It is the interesting journey to file a sponsor application project as a Canadian citizen. It is a lot of work and take some planning.

It is getting better to work on paper work preparation. But it takes some time to get more familiar with the process of the application.

Julia decided to file the sponsor application herself one week ago. Since she started the project last July, Julia knew that the most important thing is to prepare early and work hard to learn the process. Almost 12 months passed, Julia decided to stay focus on the task one or 2 weeks, stop working on algorithm practice, mocking interview, and then spent more time on her application.

Being a competitive programmer, there are a lot of things to learn. It cannot be finished in one or two weeks.

Her favorite philosophy is so surprising to match the following reading she had recently. She likes to share here and it may bring some good thoughts for future work. Why a software programmer should consider cooking at home?

From the article: Cooking At Home.

If weight loss is your goal, you’ll get better results by simply cooking everything at home and counting your calories. Exercise is great too, but it’s not nearly as effective as diet.
America is this bizarre place where everything we do seems to get filtered through some corporate entity that charges a convenience fee. Over the course of a lifetime, those convenience fees add up and result in each us spending more of our lives mandatory working for someone else.
We want a refreshing drink, so we buy a Coca Cola. But Coke has sugar and calories that make us fat, so we decide to get a gym membership to burn them off. Then we decide we need a nice new car to get to the gym, which adds all sorts of fees and insurance. It’s even worse if we decide to buy that car on credit — many of us do!
Most of our problems stem from a few simple choices. Those choices create a vicious cycle of consumption that forces us to spend our lives on things that don’t matter.
What happens if we drink water instead? What if we go on a run outside, or buy a cheap set of weights? What if we decide to walk more places instead of driving?
This is an article about cooking, but it might as well be an article about taking more control of your life in general.


Lessons learned



A smart programmer learns to write great code, but she likes to learn basics as well. Like cooking at home, and sports. She likes to learn to write down her lessons one a time, she likes to break a vicious cycle starting from 17 years ago.

Back to 1999, she only has 2 miles to drive to work, she bought a brand new car, sports utilities vehicle, even though Florida is such a flat terrain area to drive, and it is on the credit, a factory loan from Ford company. And she bought a 3 years Bally gym contract, she only showed up less than 20 times in 3 years. One time she got 20 dollars class inside the gym.

Back to 2008, She did take three time IELTS tests in 2008 in order to meet Canada immigration minimum score. She did 3 times in a row in 3 months time range and she achieved her goal. And six month later she got denial application result, then she started to appeal case over 10 months from January to October 2009, she did almost flunk her appeal against Canadian Federal court even though she did everything by herself, but she won the judge approval for a court date in June 2009.

Back to 2009, Julia got an offer to pay 1000 dollars and the immigration lawyer will write a letter for her to the immigration department to appeal her denial of decision in January 2009. Julia decided to write a letter by herself, and filed an appeal case by herself in 60 days after the denial. She worked on the appeal for leave more than 10 months, and got settle offer in Sept. 2009. It is a miracle that Julia did not go to the court and settle down outside the court. The statistics shows that 90% of case settles outside the court.

Through the immigration lawsuit, Julia knew how important it is to work with people very carefully, and gain the trust and support from the people. First time she understood that how important a judge can make a difference in her life. The Canadian immigration judge gave her a chance to go to the court even though she just learned to file the lawsuit document by herself, she studied over 20 immigration lawyers website, case studies. She tried to write down notes to help her to find laws, facts, where are the good arguments. It was so much fun to work on her own case through those months, she learned the first time she had to write document each step, and stayed focus on each step.

She understood that it is most important thing in the life called immigration, and it is very important to study every detail by herself even if she decides to ask the help from the full time consultant.

In 2017, Julia chose to work for herself instead of using licensed immigration consultant for sponsor application.

Best teacher is to learn your own mistake, experience failures, she likes to get the application file again as soon as possible. And also she likes to write down her process, so she can overcome her procrastination problem, learn how to get into the zone of filing, and preparing process.

Julia wrote a blog on July 1 Canada day, and then shifted her focus on the sponsor application instead of Hackerrank contests, and Leetcode algorithms, and mocking interviews after work and weekends. Being a responsible person, make a plan, and follow through the plan. That makes a person success, it does not matter if the project is algorithm and data structure practice, or other thing like sponsor application.


Saturday, September 1, 2018

My case number IMM-878-09

Sept. 1, 2018

Introduction


It is very valuable life experience to file an appeal case in Canadian Federal court. I have one back in 2009 and the case number is IMM-878-09.

I have chance to review the paper work I did in 2009 to file Canada immigration appeal case. I spent some time to read through my gmail correspondences with different people, Canada department of justice lawyer, immigration consultant, registry officers. I spent so many hours to work on my own immigration case back in 2009. I really like to write a blog related to my immigration appeal case.

Another blog is so helpful


I like to copy some content from my previous blog. The blog's link is here.

A smart programmer learns to write great code, but she likes to learn basics as well. Like cooking at home, and sports. She likes to learn to write down her lessons one a time, she likes to break a vicious cycle starting from 17 years ago.

Back to 1999, she only has 2 miles to drive to work, she bought a brand new car, sports utilities vehicle, even though Florida is such a flat terrain area to drive, and it is on the credit, a factory loan from Ford company. And she bought a 3 years Bally gym contract, she only showed up less than 20 times in 3 years. One time she got 20 dollars class inside the gym.

Back to 2008, She did take three time IELTS tests in 2008 in order to meet Canada immigration minimum score. She did 3 times in a row in 3 months time range and she achieved her goal. And six month later she got denial application result, then she started to appeal case over 10 months from January to October 2009, she did almost flunk her appeal against Canadian Federal court even though she did everything by herself, but she won the judge approval for a court date in June 2009.

Back to 2009, Julia got an offer to pay 1000 dollars and the immigration lawyer will write a letter for her to the immigration department to appeal her denial of decision in January 2009. Julia decided to write a letter by herself, and filed an appeal case by herself in 60 days after the denial. She worked on the appeal for leave more than 10 months, and got settle offer in Sept. 2009. It is a miracle that Julia did not go to the court and settle down outside the court. The statistics shows that 90% of case settles outside the court.

Through the immigration lawsuit, Julia knew how important it is to work with people very carefully, and gain the trust and support from the people. First time she understood that how important a judge can make a difference in her life. The Canadian immigration judge gave her a chance to go to the court even though she just learned to file the lawsuit document by herself, she studied over 20 immigration lawyers website, case studies. She tried to write down notes to help her to find laws, facts, where are the good arguments. It was so much fun to work on her own case through those months, she learned the first time she had to write document each step, and stayed focus on each step.

She understood that it is most important thing in the life called immigration, and it is very important to study every detail by herself even if she decides to ask the help from the full time consultant.

In 2007, Julia chose to work for herself instead of using licensed immigration consultant for sponsor application.

Best teacher is to learn your own mistake, experience failures, she likes to get the application file again as soon as possible. And also she likes to write down her process, so she can overcome her procrastination problem, learn how to get into the zone of filing, and preparing process.

Julia wrote a blog on July 1 Canada day, and then shifted her focus on the sponsor application instead of Hackerrank contests, and Leetcode algorithms, and mocking interviews after work and weekends. Being a responsible person, make a plan, and follow through the plan. That makes a person success, it does not matter if the project is algorithm and data structure practice, or other thing like sponsor application.

Wednesday, July 26, 2017

Can a blog make a difference?

July 26, 2017

Introduction


It is so much fun to have a new school once a while. Julia spent over three months to learn from codereview.stackexchange.com, she was kind of getting lost in the code review but she received a lot of valuable review from JS1. The internet is big world and she never met the person and contacted him personally, the anonymity of user makes internet more interesting.

From March to July, Julia started to meet a person one by one. But she met too many people, sometimes she could not prepare very well for the algorithms used in the mocking. The experience was amazing, this mocking website machine learning algorithm really did great favor to Julia, she could not believe how she connected top talent in the world. It is like inviting people to give you guest lecture every day. Julia learned that good personality really makes life easy as a programmer, so she works hard to reduce her accent, discipline herself to prepare early, learn to be super patient.

Now Julia likes to conduct  a small research on the blog written by Aviad Ezra. Julia likes to go over around 20 algorithm one by one.


Blog study 


First one is about boggle algorithm. Julia wrote a blog on this algorithm. Julia just learned the trie again in June, 2017. The blog is here. 


Sunday, October 25, 2015

The clean code talks - unit testing

10/25/2015

Watch the google talk "The clean code talks - unit testing", write down notes and then learn better for next time.

  video link:
  https://www.youtube.com/watch?v=wEhu57pih5w

Video time:
02:02 / 32:07
Hard to test code

Most People say:
Make things private
Using final keyword
Long methods

Real issues:  (interview questions)
Mixing new with logic
Work in constructor
Global state
Singleton
Static Methods   (procedure programming) (leaf method vs way-up method)
Deep inheritance (Divorce myself from inheritance at run time. )
Too many conditionals ()


Procedure code - Seam - Polymorphism - Julia's comment: look into it, read more about it. 10/25/2015

Video time:
 14:35/32:07
Progression of Testing:

1. Scenario / Large Tests
  Test whole applicatio by prentending to be a user
  slow / Flaky / Mostly happy paths

2. Functional / Medium Tests
  External dependencies simulated
  Test class interaction

3. Unit / Small Tests
    Focus on application logic
    Very Fast / No I/O / No Need for a debugger

4. Think of it more as a continuum than discrete

5. All tests levels important
    Not all levels have the same probability of a bug
    Because smaller tests cover less need more of them

6. Testability more important as you get more focused

Video time:
17:05 /32:07
Different kinds of Tests
Execution time :
unit test -> Functional Tests -> Scenario

Test individual  ->
Test collections of classes as subsytems ->
Test the whole system pretending to be a user

Video time:
27:06/32:07
How do you write hard to test code?

You mix object creation code with business logic
This will assure that a test case never can construct a graph of objects different from production. Hence nothing can be tested in isolation.

Unit test class -
Seam - friendly - try to understand the dependency injection
class depends on a lot of other classes, mocking, seam, learned through hacking,

class:
object graph
construction & lookup
business logic

27:36/32:07
Take Away
 Unit tests are a preferred way of testing

 Unit tests require seperation of instantiation of object graph from business logic under test

Questions:
1. Global variable - make test unpredictable, the order of test matters and so on and so forth.

    Do not clean up after yourself, another test will fail;
    Counter argument: framework than DI framework.

    Monkey-patching - evil on the global state - dependency injection

    C++ / Java / frameworks - dependency injection difference

And read the slideshow using the following link:

http://www.slideshare.net/avalanche123/clean-code-5609451

http://misko.hevery.com/code-reviewers-guide/

http://misko.hevery.com/presentations/

http://misko.hevery.com/2008/10/21/dependency-injection-myth-reference-passing/