updates table information below
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, May 5, 2019
David Darst
Here is the link.
Darst has lectured at Wharton, Columbia University, INSEAD, New York University, Washington State University, and Rice University business schools, and for nine years, Darst served as a visiting faculty member at Yale College, Yale School of Management, and Harvard Business School. He serves on the Investment Committee of the Phi Beta Kappa Foundation, and is a CFA Charterholder and a member of the New York Society of Security Analysts and the CFA Institute. On November 3, 2011 at the Metropolitan Club in New York, Darst was inducted by Quinnipiac University into their Business Leaders Hall of Fame.
20 recession, each one lasts less than 24 months.
Darst has lectured at Wharton, Columbia University, INSEAD, New York University, Washington State University, and Rice University business schools, and for nine years, Darst served as a visiting faculty member at Yale College, Yale School of Management, and Harvard Business School. He serves on the Investment Committee of the Phi Beta Kappa Foundation, and is a CFA Charterholder and a member of the New York Society of Security Analysts and the CFA Institute. On November 3, 2011 at the Metropolitan Club in New York, Darst was inducted by Quinnipiac University into their Business Leaders Hall of Fame.
20 recession, each one lasts less than 24 months.
How to hedge against a loonie in decline
Here is the link.
The hedged iShares S&P 500 Index Fund (XSP) made 3.2 per cent annually for the five years to May 31, while the S&P 500 made 4.1 per cent. XSP's management expense ratio is 0.25 per cent, which means tracking error caused in part by currency hedging played a role in the rest of the shortfall.
Over periods of 10 years or longer, many experts believe hedging is unnecessary because currency ups and downs cancel each other out. It's also thought that hedging isn't needed when investing in a broad index of international countries, where currency risk is limited by diversification.
Vanguard S&P 500 Index ETF (CAD-hedged)
Here is the link.
Objective
The fund seeks to track, to the extent reasonably possible and before fees and expenses, the performance of a broad U.S. equity index that measures the investment return of large-capitalization U.S. stocks, which Index is hedged to the Canadian dollar. Currently, this Vanguard ETF seeks to track the S&P 500 Index (CAD-Hedged) (or any successor thereto).
It invests directly or indirectly primarily in stocks of U.S. companies and uses derivative instruments to seek to hedge the U.S. dollar exposure of the securities included in the S&P 500 Index back to the Canadian dollar.
About the benchmark
The S&P 500 Index (CAD-Hedged) is a market-capitalization-weighted index that is designed to represent the returns of large-capitalization U.S. stocks, with the U.S. dollar exposure of the securities included in the S&P 500 Index hedged to the Canadian dollar.
Objective
The fund seeks to track, to the extent reasonably possible and before fees and expenses, the performance of a broad U.S. equity index that measures the investment return of large-capitalization U.S. stocks, which Index is hedged to the Canadian dollar. Currently, this Vanguard ETF seeks to track the S&P 500 Index (CAD-Hedged) (or any successor thereto).
It invests directly or indirectly primarily in stocks of U.S. companies and uses derivative instruments to seek to hedge the U.S. dollar exposure of the securities included in the S&P 500 Index back to the Canadian dollar.
About the benchmark
The S&P 500 Index (CAD-Hedged) is a market-capitalization-weighted index that is designed to represent the returns of large-capitalization U.S. stocks, with the U.S. dollar exposure of the securities included in the S&P 500 Index hedged to the Canadian dollar.
Case study: Canada asset portfolio
May 5, 2019
It is time for me to build a portfolio for $30,000 Canadian dollars on questtrade.com. It is the first time and I like to set up a portfolio by trial and error.
I like to think about how to purchase the asset of ETF fund.
Here are some candidates for ETF funds:
1. VGT
Vanguard information technology ETF
$3000 US dollars - $4000 Canadian dollars
2. VYM
Vanguard dividend ETF
$3000 US dollars - $4000 Canadian dollars
3. VTI
Vanguard total market index fund
$3000 US dollars - $4000 Canadian dollars
5. VPU
Vanguard utilities ETF
$3000 US dollars - $4000 Canadian dollars
4. BND
Vanguard total bond market ETF
$10000 US dollars - $13000 Canadian dollars
Introduction
It is time for me to build a portfolio for $30,000 Canadian dollars on questtrade.com. It is the first time and I like to set up a portfolio by trial and error.
Case study
I like to think about how to purchase the asset of ETF fund.
Here are some candidates for ETF funds:
1. VGT
Vanguard information technology ETF
$3000 US dollars - $4000 Canadian dollars
2. VYM
Vanguard dividend ETF
$3000 US dollars - $4000 Canadian dollars
3. VTI
Vanguard total market index fund
$3000 US dollars - $4000 Canadian dollars
5. VPU
Vanguard utilities ETF
$3000 US dollars - $4000 Canadian dollars
4. BND
Vanguard total bond market ETF
$10000 US dollars - $13000 Canadian dollars
Vanguard Information Technology ETF (VGT)
Here is the link.
Product summary
- Seeks to track the performance of a benchmark index that measures the investment return of stocks in the information technology sector.
- Passively managed, using a full-replication strategy when possible and a sampling strategy if regulatory constraints dictate.
- Includes stocks of companies that serve the electronics and computer industries or that manufacture products based on the latest applied science.
I like to save the price history and $10,000 growth from 2009 to 2019. I saved on May 5, 2019.
The VGT price on May 5, 2019 is $213.49, and the total value is $59,571.31. The value of dip in Dec. 2018 is $50,683.68.
The VGT price on May 5, 2019 is $213.49, and the total value is $59,571.31. The value of dip in Dec. 2018 is $50,683.68.
1038. Binary Search Tree to Greater Sum Tree
I wrote a post to share on Leetcode.com discuss. Here is the link. I also like to copy and paste here in case one day the algorithm is set to the private and the discussion post is no longer available.
It is a medium level tree algorithm. I worked on the algorithm in weekly contest, I was nervous. Two mistakes dragged down my performance. It should take me 10 minutes, but I actually spent over 50 minutes, last two minutes I finally made it work in the contest.
Two most common mistakes
Let me introduce the first mistake I had, and I had to take time to figure out. I like to traversal the tree using Right, Root, Left so that all numbers will be decending order.

From the above diagram, a, b, c, d and e are used to mark the order of all elements in the tree. I was confused that d and e two nodes, which one should go first. I was not sure. It took me extra five minutes at least
Let me introduce my second mistake, calculate the sum of visited nodes in the tree.

private static void traversalRightRootLeft(TreeNode root)
{
if(root.right != null)
{
traversalRightRootLeft(root.right);
}
// visit root
var firstCheck = previous != null ;
if(firstCheck)
root.val += previous.val;
previous = root;
if(root.left != null)
{
traversalRightRootLeft(root.left);
root.left.val += root.val; // this is a second bug
}
}
The second bug is to write code in the left child; The simple reasoning can pinpoint the code is wrong. Every node will be visited once, how come the node which is left child will be counted twice in calculation of node's value?
I like to explain this common mistake in recursive function so that it is much easy to understand the reasoning.

Advice on weekly contest
Based on the above facts, I should focus on reasoning, not just try to pass all test cases in problem solving; It is hard for me to work on something new in the contest, I was nervous but I learned two lessons from the above two mistakes in the contest.
I like to write down and share with others. We all know that practice makes perfect. What I like to do is to talk about mistake, and try to work on my reasoning skills in the contest. That will help me to improve my performance. Between 50 minutes to solve and 10 minutes to solve are huge difference in 90 minues contest.
References:
- weekly contest 135 website is here.
- My weekly performance 135 diagram with time spent on the second algorithm 54 minutes.

- Top 10 players and their time spent on the algorithm.

The minimum time is 1 minutes, maximum time is 9 minutes for those top 10 ranking players.
/**
* Definition for a binary tree node.
* public class TreeNode {
* public int val;
* public TreeNode left;
* public TreeNode right;
* public TreeNode(int x) { val = x; }
* }
*/
public class Solution {
static TreeNode previous = null;
public TreeNode BstToGst(TreeNode root) {
if (root == null)
return null;
previous = null;
traversalRightRootLeft(root);
return root;
}
private static void traversalRightRootLeft(TreeNode root)
{
if(root.right != null)
{
traversalRightRootLeft(root.right);
}
// visit root
var firstCheck = previous != null ;
if(firstCheck)
root.val += previous.val;
previous = root;
if(root.left != null)
{
traversalRightRootLeft(root.left);
// root.left.val += root.val;
}
}
}
Saturday, May 4, 2019
weekly contest 135
May 4, 2019
It is my favorite weekly contest. I solved first two algorithms. I had some difficult time in the first algorithm, and then I came cross the problem with the second algorithm as well. I need to work hard and I should solve the second algorithm tree algorithm in less than 10 minutes.
Here is the snapshot of my ranking.
Introduction
It is my favorite weekly contest. I solved first two algorithms. I had some difficult time in the first algorithm, and then I came cross the problem with the second algorithm as well. I need to work hard and I should solve the second algorithm tree algorithm in less than 10 minutes.
My performance
Here is the snapshot of my ranking.
DALBAR PINPOINTS INVESTOR PAIN ANNUAL REPORT OF INVESTOR RETURNS SHOWS WHEN BIGGEST GAPS OCCURRED
In 30 years of monthly investor returns, DALBAR found that equity investors underperformed the S&P
500 to the greatest extent in October, 2008. In this month, equity investors lost 24.21% compared to
an S&P loss of 16.80% for a net underperformance of 7.41 percentage points.
The next greatest underperformance occurred in March, 2000, when the S&P surged 9.78% but investors took home only 3.72% for an underperformance of 6.06%.
The underperformance results from bad investor decisions at critical points, the first in the face of severe market declines and the second when the equity market surged.
Underperformance in the face of maximum impact events is attributable to a lack of preparedness and is the subject of the recently released 21st Edition of DALBAR’s Quantitative Analysis of Investor Behavior (QAIB). The 21st Edition also reported:
2014 report
The next greatest underperformance occurred in March, 2000, when the S&P surged 9.78% but investors took home only 3.72% for an underperformance of 6.06%.
The underperformance results from bad investor decisions at critical points, the first in the face of severe market declines and the second when the equity market surged.
Underperformance in the face of maximum impact events is attributable to a lack of preparedness and is the subject of the recently released 21st Edition of DALBAR’s Quantitative Analysis of Investor Behavior (QAIB). The 21st Edition also reported:
2014 report
Case study: NYCB 6 year CD external transfer
May 4, 2019
It is my personal finance research. I have to push myself to embrace the stock market and invest into equity market. I have to break CD 6 year term, and pay 12 month interest penalty, and bring those fund into Ameritrade.
I like to document my CD here and my determination to say goodbye to 6 year CD, matured in 2012. I have to be able to learn how to invest on equity market, and then focus on long term growth more than 10 years.
Here are the summary of last 12 month IRA CD.
Introduction
It is my personal finance research. I have to push myself to embrace the stock market and invest into equity market. I have to break CD 6 year term, and pay 12 month interest penalty, and bring those fund into Ameritrade.
External transfer
I like to document my CD here and my determination to say goodbye to 6 year CD, matured in 2012. I have to be able to learn how to invest on equity market, and then focus on long term growth more than 10 years.
Here are the summary of last 12 month IRA CD.
Celebration of Microsoft online code assessment success
May 4, 2019
It is my personal finance research. I am a frugal person, and I know that I have to spend time to learn system design, and I do not want to go for an onsite in Seattle without any preparation. In other words, online assessment is just one hour practice. I like to celebrate it since I learn how to overcome difficulty last 4 years.
It is time for me to mark the success with my Leetcode profile. So I learn that it is so important for me to push myself to complete more algorithms on Leetcode.com, and also write down the journey, share with others.
After the failure of Amazon code assessment this March, I learn that I have to push myself to work on problem solving through more practice.
I started to work on union find algorithm tag, and I found out that it is really hard to live with hard level algorithm. If I am not careful, it will take me a whole day to learn how to solve a hard level algorithm.
As I remember, it is better to go back to work on easy, medium level algorithm. This way I can learn better and learn fast compared to hard level algorithm.
Introduction
It is my personal finance research. I am a frugal person, and I know that I have to spend time to learn system design, and I do not want to go for an onsite in Seattle without any preparation. In other words, online assessment is just one hour practice. I like to celebrate it since I learn how to overcome difficulty last 4 years.
Hardwork and sharing
It is time for me to mark the success with my Leetcode profile. So I learn that it is so important for me to push myself to complete more algorithms on Leetcode.com, and also write down the journey, share with others.
Submission history
After the failure of Amazon code assessment this March, I learn that I have to push myself to work on problem solving through more practice.
I started to work on union find algorithm tag, and I found out that it is really hard to live with hard level algorithm. If I am not careful, it will take me a whole day to learn how to solve a hard level algorithm.
As I remember, it is better to go back to work on easy, medium level algorithm. This way I can learn better and learn fast compared to hard level algorithm.
Why it is so hard to pass Microsoft online code assessment?
May 4, 2019
It is my short research topic. I worked on Leetcode, hackerrank starting from 2015 January, I did take 4 Microsoft online assessment from 2016 to 2019, one for each year. This year it is the first time I can pass online assessment. Why it is so hard?
I did start to work on Leetcode algorithm; In June 2018, I prepared to Amazon onsite in Seattle. I hired a coach who worked in Microsoft intern in Beijing. He told me that I should work on Leetcode easy level algorithms. My coaching sessions are here.
I started to work on Leetcode easy level algorithm. I failed the phone screen from Facebook at the end of July 2018. I spent another 3 months to finish all 200 easy level algorithms.
I also wrote a code assessment in 2018 from Microsoft. But I stumbled on infix expression using stack. My data structure skill is questionable. I wrote a discussion post on stackexchange.com, here is the link.
I took Amazon online assessment in March 2019, but I could not pass the test. I was nervous on second algorithm, even though I worked on the algorithm over 5 times at least on hackerrank.com from 2016 to 2017, and a few times in 2018 and so many peers on mock interview platform. There is another skill to write algorithm on assessment.
I asked a few times on interviewing.io using the same algorithm. I learned from a few candidates and watch and learn how to write a solution from scratch. Young generation with super talent likes to write everything from scratch, and he does not need to copy and paste the code; everything is his head; Just simple while loop and a few explanations. I wrote one blog here saying that I learn first how to write. Here is the case study on union find algorithm 947 remove stones.
I passed one online assessment in 2017, but no more assessment in 2018 from Amazon, 2018 phone screen I passed and then onsite, 2019 I failed Amazon online code assessment.
So I was so surprised to get contacted by Microsoft recruiter again, I started to prepare April Microsoft online assessment. I know that I have to push myself to get used to new algorithms and came out the optimal solution in one hour setting. Otherwise it will not work.
I already solved 395 algorithms on Leetcode.com. I also played over 30 weekly contest and then started to practice mock interviews on Leetcode.com. Here are my celebration blogs on Leetcode algorithms.
I had 48 hours to work on the assessment once I got the link, but I took extra day last long weekend. I did practice 4 days and worked on 50 algorithms, and then I stumbled on a few algorithms. I wrote down my experience very carefully. I know that the weakness is something I should work on next.
I passed the online assessment first time in my life this April. I learn to be humble, and keep learning and practice.
If I have time, I like to write more about algorithm practice and share on Leetcode.com.
I put together a github page called online assessment preparation.
Introduction
It is my short research topic. I worked on Leetcode, hackerrank starting from 2015 January, I did take 4 Microsoft online assessment from 2016 to 2019, one for each year. This year it is the first time I can pass online assessment. Why it is so hard?
Case study
I did start to work on Leetcode algorithm; In June 2018, I prepared to Amazon onsite in Seattle. I hired a coach who worked in Microsoft intern in Beijing. He told me that I should work on Leetcode easy level algorithms. My coaching sessions are here.
I started to work on Leetcode easy level algorithm. I failed the phone screen from Facebook at the end of July 2018. I spent another 3 months to finish all 200 easy level algorithms.
I also wrote a code assessment in 2018 from Microsoft. But I stumbled on infix expression using stack. My data structure skill is questionable. I wrote a discussion post on stackexchange.com, here is the link.
I took Amazon online assessment in March 2019, but I could not pass the test. I was nervous on second algorithm, even though I worked on the algorithm over 5 times at least on hackerrank.com from 2016 to 2017, and a few times in 2018 and so many peers on mock interview platform. There is another skill to write algorithm on assessment.
I asked a few times on interviewing.io using the same algorithm. I learned from a few candidates and watch and learn how to write a solution from scratch. Young generation with super talent likes to write everything from scratch, and he does not need to copy and paste the code; everything is his head; Just simple while loop and a few explanations. I wrote one blog here saying that I learn first how to write. Here is the case study on union find algorithm 947 remove stones.
I passed one online assessment in 2017, but no more assessment in 2018 from Amazon, 2018 phone screen I passed and then onsite, 2019 I failed Amazon online code assessment.
So I was so surprised to get contacted by Microsoft recruiter again, I started to prepare April Microsoft online assessment. I know that I have to push myself to get used to new algorithms and came out the optimal solution in one hour setting. Otherwise it will not work.
I already solved 395 algorithms on Leetcode.com. I also played over 30 weekly contest and then started to practice mock interviews on Leetcode.com. Here are my celebration blogs on Leetcode algorithms.
I had 48 hours to work on the assessment once I got the link, but I took extra day last long weekend. I did practice 4 days and worked on 50 algorithms, and then I stumbled on a few algorithms. I wrote down my experience very carefully. I know that the weakness is something I should work on next.
How I pass Microsoft online assessment?
I passed the online assessment first time in my life this April. I learn to be humble, and keep learning and practice.
If I have time, I like to write more about algorithm practice and share on Leetcode.com.
I put together a github page called online assessment preparation.
Subscribe to:
Posts (Atom)













