Case study: Qin Chen
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, October 6, 2019
Case study: programmer as a career - series 2 of 3
Case study: Qin Chen
Case study: programmer as a career - series 1 of 3
Case study - 郑然 2017 - 2019
Computer master degree, Google one year experience, PIP,
Actionable Item
How to Use Bond Ladders for Retirement Income
Bond Ladders as Part of a Balanced Portfolio
Rolling Returns vs. Average Annual Returns
Interesting paragraph to read:
Nassim Taleb, in his book The Black Swan (Penguin, 2008), has a section called “Don’t cross a river if it is (on average) four feet deep.” It is a statement worth pondering. Most financial projections use averages. There is no guarantee that your investments will achieve the average return.
Volatility is the variation of returns from their average. For example, from 1926–2015, historical stock market returns—as measured by the S&P 500 Index—averaged 10% a year. But that average encompassed years where it was down 43.3% (1931) and up 54% (1933), as well as more recent years like 2008 when it was down 37%, and 2009 when it went up 26.5%*.
A ten-year rolling return would show you the best ten years and worst ten years you may have experienced by looking at the ten year periods not just starting with January, but also starting February 1, March 1, April 1, or any other date.
Facts:
the S&P 500 Index
down 43.3% (1931)
up 54% (1933)
down 37% (2008)
up 26.5% (2009)
Does Taking on Investment Risk Deliver Higher Returns? - extreme risk investments
High-risk investments can deliver fabulous returns, but you also take the risk you could lose everything you've invested.
High-risk investments include things like owning individual stocks, starting a business, playing the options market, or speculating on a piece of real estate.
It's not quite like gambling, because you're investing in an opportunity that you've hopefully taken the time to thoroughly research, but luck will still have quite a bit to do with your results.
For play money or sophisticated investors, these choices are fine. But for those of you who have a limited amount of funds and know you'll need to rely on them in retirement, you probably want to steer clear of higher risk choices.
Actionable Items
Does Taking on Investment Risk Deliver Higher Returns?
01 comparing low risk investments to high risk investments
02 safe, no risk investments
03 low risk investments
04 moderate risk investments
05 high risk investments
06 compare low risk investments to high risk investments
07 extreme risk investments
Case study: Seattle road trip expense report
Introduction
It is my personal finance research. I had to discipline myself not to purchase another pair of Nike sneaker on sale on road trip to Seattle, last year I purchased three pairs. And also I like to figure out how to analyze what I need and what I want.
Case study
I like to list all expenses I spent. And also I had a friend to offer me to stay in her house for one night, and another friend offered me to drive to snowqualmie falls, and treated me a lunch as well.
As a Christian, I also decided to visit a friend in hospital, and brought some food with me to show my care and fellowship with the friend I knew back in Florida.
I had to pay a tank of gas for round trip to Seattle, which is total 400 miles in total. The gas cost is around $68.09.
I paid parking for Google GHC event, I chose the cheap one, $10.00 US dollars for 3 - 6 hours.
I spent over 20 minutes in Nike store to try a few pairs of sneakers, but I did not purchase any of them. And then I bought two soccer balls on sale, $8.00 dollar each, one for me, one for gift to my friend.
I spent a lunch at Casino Seattle premium mall.
Total expense is around $176.00 Canada dollars. 1 US dollar is equal to 1.33 Canadian dollar.
Double check, make sure that credit card number is removed from the above image.
Follow up
Nov. 1, 2019I used to play a few times soccer in 1984, but I never had chance to own a soccer ball. I like to play more soccer ball inside my Vancouver home office, it is good for me to train my arm and my finger to keep them agile for daily acitivities.
Saturday, October 5, 2019
Mr. Frugal, should I purchase a GPS with less than $100 dollar budget
Introduction
It is time for me to think about the purchase a new GPS. I found out that my GPS does not work on Oct. 2, 2019, and it took me three hour 30 minutes to get my friend's house, which will take less than 30 minutes with a GPS.
Research for the purchase
I have to learn to make a plan for my expense. I do have to analyze the tools I need for road trip. Frugal is a good idea to practice, but I also need to learn how to evaluate how good my 10 year old GPS, it should be replaced long time ago.
1217. Play with Chips
public class Solution {
public int MinCostToMoveChips(int[] chips) {
var even = 0;
var odd = 0;
foreach(var item in chips)
{
if(item % 2 == 0)
even++;
else
odd++;
}
return even >= odd? odd : even;
}
}
weekly contest 157
Introduction
It is my favorite weekly contest. I just played weekly contest 157 today. I solved the first two algorithms, and then I only had less than 10 minutes left. I spent some time to chat with SJTU 1984 wechat group, I started at least 10 minutes later.
My performance
Here is my performance.
Actionable Items
I found the joy in the first easy level algorithm. I could not figure out what is asked in the question, so I read again and again, almost 20 minutes, I finally figure out the question, and also it took me at least five minute to come out the idea to solve it.
The first 20 minutes is so fun. I thought about how tough it is to understand the problem, I need to read, play with an example, and then read the statement again, and then think about, and then read again.
1218. Longest Arithmetic Subsequence of Given Difference
- Take time to think about subproblems, dynamic programming solution;
- My idea is to use extra space to save each value and its maximum length in prefix array;
- Once I figure out step 2 to track prefix array each value with its maximum length hashmap, take time to write and test the code;
- I made mistake to forget else case in second if clause in for loop; I need to push myself to test using my own test case first. Do not rely on Leetcode online judge.
public class Solution {
public int LongestSubsequence(int[] arr, int difference) {
var length = arr.Length;
// key - value
// value - longest subsequence
var dict = new Dictionary<int, int>();
var dp = new int[length];
for(int i = 0; i < length; i++)
{
var current = arr[i];
var previous = current - difference;
int currentMax = 1;
if(dict.ContainsKey(previous))
{
currentMax = 1 + dict[previous];
}
dp[i] = currentMax;
if(dict.ContainsKey(current))
{
var previousLength = dict[current];
if( currentMax > previousLength )
{
dict[current] = currentMax;
}
}
else
{
dict.Add(current, currentMax);
}
}
return dp.Max();
}
}
1046. Last Stone Weight
- Understand C# SortedDictionary can be used to impelement minimum heap first;
- Apply all ement value to negative one, so maximum heap turns into a minimum heap problem;
- Get familiar with IEnumberable First API and it can be used to get the minimum one from the heap.
public class Solution {
/// <summary>
/// Oct.4, 2019
/// Implement a maximum heap -
/// what I can do is to use negative value
/// </summary>
/// <param name="stones"></param>
/// <returns></returns>
public int LastStoneWeight(int[] stones)
{
var sorted = new SortedDictionary<int, int>();
// put all numbers into minimum heap - default - negative value
foreach (var number in stones)
{
var key = number * (-1);
if (!sorted.ContainsKey(key))
{
sorted.Add(key, 0);
}
sorted[key]++;
}
while (!((sorted.Keys.Count == 1 && sorted[sorted.Keys.ToList()[0]] == 1) || sorted.Keys.Count == 0))
{
// get minimum two values from minimum heap
var key = sorted.Keys.First();
var hasAtLeastTwo = sorted[key] > 1;
if (hasAtLeastTwo)
{
sorted[key] -= 2;
if(sorted[key] == 0)
{
sorted.Remove(key);
}
}
else
{
var minimum = key;
sorted.Remove(key);
var next = sorted.Keys.First();
sorted[next]--;
if (sorted[next] == 0)
{
sorted.Remove(next);
}
var diff = Math.Abs(minimum - next);
var newKey = diff * (-1);
if (newKey == 0)
continue;
if (!sorted.ContainsKey(newKey))
{
sorted.Add(newKey, 0);
}
sorted[newKey]++;
}
}
if (sorted.Keys.Count == 0)
return 0;
return sorted.Keys.ToList()[0] * (-1);
}
}
Friday, October 4, 2019
Jim O'Shaughnessy: "What Works on Wall Street" | Talks at Google
What it takes to be a successful active investor. Hint, it’s much harder than you think. Contrast active and passive equity investing. Risk/rewards. Conclusion—Investors who do not have the following traits and emotional quality should index their portfolios. I find they are the majority of investors today. Also discussion of points of failure for passive and active investors. What traits and emotional characteristics are required to succeed as an active investor? A true long-term perspective on their investments. Discussion of Evolution and why it hampers long-term thinking. Discussion of behavioral biases that hamper successful long-term active investing. Power Point illustrations. Successful active investors value process over outcome. Short-term focus of investors is killing returns. Why you need access to truly long-term data to make intelligent choice. Successful active investors generally ignore forecasts and predictions. Discussion of studies proving forecasts and predictions are virtually worthless; illustrations documenting the failure of forecasts; both within markets and in outside professions. Successful active investors are patient and persistent. Discussion of great investors who may have very different styles, but all share the trait of patience and persistence. Successful active investors have a strong mental attitude. Successful investors are made, not born. Discussion of how successful active investors have a mental attitude bordering on stoicism; how they control how they interpret the world. Tools to use to help you succeed as an active long-term investor. Long-term data uncovered by What Works on Wall Street that you can use to guide your investment strategy. The importance of value; momentum; financial strength and earnings quality in putting together your portfolio. A highlight of stocks with high versus low shareholder yield (Cash dividend %+Bet Buyback %); it’s efficacy since the 1920s What NOT to own, lottery stocks versus the market. The importance of a stock’s market capitalization—the most profitable stocks come from the smallest part of the market (Micro cap stocks) Putting it all together—should you be an active or passive investor? Weight of the evidence for passive and active investing Which type of investor are you? Getting the best out of the style you choose. Discussion and Q/A.
Thursday, October 3, 2019
Hospital visit - 3 hour visit
Introduction
It is tough decision for me to visit a friend in the hospital in Everett city in Washing state. I learned from a sister in the church, and she told me that she visited once a week. I understood that I also like to serve people who needs help, specially a person in Chinese community.
3 hours visit
I stopped by the hospital and then have my first visit on the road trip from Bothell to Vancouver on Oct. 3, 2019. Life is so challenging, my friend back in Florida and palm beach country Chinese christian church back around year 2000 has brain cancer and he went to hospital this July, the same cancer John Mccain had a few years ago.
Life is so tough since he could not move his left part of body, and he stays inside the room last 2 months, and he has not went out his room even once.
200 minutes road trip | Google grace hopper event in 2019 | Three hours road trip | Blessing of birthday trip
This article is about writing a novel or an essay or a documentary, telling a true story, and contacting countless friends on WeChat. A stranger whom I haven’t seen for a long time, or who is struggling financially or academically.
Follow up
- Add more content in the title;
- Old title: 200 minutes road trip;
- New title: Add more: | Google grace hopper event in 2019 | Three hours road trip | Blessing of birthday trip;
- Get Google 4 pixel 5G phone, and understand the importance to manage storage of mobile phone, get 120 GB one; download free GPS app and use it more often;
- Spend time to watch Google I/O 2019 videos. Learn more about Google and how Google apps help so many people in terms of product design, marketing etc.
Follow up
This article is about writing a novel or an essay or a documentary, telling a true story, and contacting countless friends on WeChat. A stranger whom I haven’t seen for a long time, or who is struggling financially or academically.
Case study: Amazon stock
Here is the article. I will take some notes later.
Seattle road trip on Oct 2. 3, 2019
Introduction
It is my favorite road trip to Seattle. I spent two days on the road trip to Seattle. I like to write something for my road trip.
Road trip
GHC meeting in Google office lake union
Introduction
I like to write a blog to share my such great experience to attend GHC meeting on Oct. 2, 2019.
Wednesday, October 2, 2019
Tuesday, October 1, 2019
#4 - 10 DISTINCTIONS BETWEEN MILLIONAIRES AND THE MIDDLE CLASS PEOPLE - PART 2
Distinction # 7 Millionaires think long term The middle class thinks short term. Distinction # 8 Millionaires take calculated risks. The middle class is afraid to take risks. Distinction # 9 Millionaires embrace change. The middle class is threatened by change Distinction # 10 Millionaires believe they must be generous. The middle class believes they can’t afford to give.
#3 - 10 DISTINCTIONS BETWEEN MILLIONAIRES AND THE MIDDLE CLASS PEOPLE - PART 1
#3 - 10 Distinctions between millionaires and the middle class people - Part 1 Distinction # 1 Millionaires ask themselves empowering questions. The middle class ask themselves disempowering questions. Distinction # 2 Millionaires focus on increasing their net worth. The middle class focuses on increasing their paychecks. Distinction # 3 Millionaires continually learn and grow. The middle class thinks learning ended with school. Distinction # 4 Millionaires talk about ideas. The middle class talks about things and other people. Distinction # 5 Millionaires work for profits. The middle class works for wages. Distinction # 6 Millionaires have multiple sources of income. The middle class only has one or two.
13 Surprising Facts from 100 Millionaire Interviews and What We Can Learn from Them
10 Differences Between Middle Class And Rich People
5. The middle class work to earn, the rich work to learn
-Robert Kiyosaki
Learn to write
The middle class -> more money -> change jobs -> easily persuaded
working isn't about the money
the rich thinks working is to learn. Specially in early years.
Develop the skills and traits -> The rich thinks about that.
Most rich people didn't get there by earning a high salary.







