Wednesday, October 21, 2020

Trie data structure: 425 Word square

 Here is the gist. 


Ideally it should take me less than 10 minutes to come out Trie data structure with design, and then go over depth first search, word by word, each word should consider if the first few chars ( 0 - level - 1) should be fixed, which can be looked up in ith column, i's value is level. 

When I worked on my first practice yesterday, I did not come out the clear idea illustrated in the following graph. It should be really simple and straightforward. 








Here are some highlights:

Hard level algorithms - six hard level algorithms

 Hard level algorithms: 

  1. 630 course schedule
  2. 269 Alien dictionary
  3. 759 Employee free time
  4. 632 smallest range covering elements from k lists
  5. sequence reconstruction
I plan to work on those 5 hard level algorithms in next few days. 


SU.TO stock: Suncor stock analysis

 https://svencarlin.com/suncor-stock-analysis/

Tuesday, October 20, 2020

The Stock Market Is Ignoring the Economy. Here's Why | WSJ

 Here is the link. 

Stocks are booming while companies shed millions of workers from payrolls. WSJ explains why the stock market seems disconnected from economic reality in the U.S. Photo Illustration by Carlos Waters/WSJ


20M+ Americans Risk Eviction by the End of September | NowThis

 Here is the link. 


3.6 million evictions -> 11.7 million eviction 


The Eviction Process in 5 Steps

 Here is the article. 

1. Prepare your eviction notice

2. You must "serve" your eviction notice

3. Tenant stil there? Time to sue for Forcible Entry and Detainer

4. Go to court for your hearing

5. Still not out? Time to get the Sheriff involved

Homeless count in the U.S. 

552K total

358K sheltered, 65%

194K unsheltered, 35%

500,000 people are homeless in the U.S. 

The rent is not paid -> Property tax -> School not paid. 

42 million home for rent - 60% will not pay ...



Why The U.S. Faces An Eviction Crisis

 Here is the link. 

Nearly a third of Americans didn't pay their housing costs in July. Now local, state and federal moratoria on evictions originally put in place during the coronavirus pandemic are expiring. While landlords may be sympathetic to tenants needs, communities face hardships when rent goes unpaid. A movement to cancel rent has been growing as the patchwork of solutions across the country leaves many renters falling through the cracks. Watch the video to find out why Americans are facing an eviction crisis.


Eviction crisis: Heartbreaking CNN Segment Highlights Eviction Crisis

 Here is the link. 

CNN puts a face to the eviction crisis that could hit 30-40 million Americans by the end of 2020.

30 million of people will be evicted by estimation.


Sunday, October 18, 2020

FLP theorem: FLP and CAP aren't the same thing

 Here is the article. I like to take 10 to 15 minutes to read the article. 

Equity research: Technology stock - I should find a few to invest

 Oct. 18, 2020

Introduction

I like to spend time wisely on technology stock research. I do like to spend one or two hours early in the morning and learn about so many business in USA. I definitely like to learn more about equity research. 

APTX stock - after market 100% return on Oct. 19, 2020. 


Amazon code screen: Plan to prepare in one month

 Oct. 18, 2020

Introduction

I got invited to take another Amazon code screen. I am working on Google phone screen in early November, and I just enjoy learning system design, and also I have time to practice more algorithms as well. What is good time to take online code assessment? 

One more month

I like to take the assessment in a month. Since there is six month waiting period, I should prepare more in order to pass any code assessment from Amazon anytime. 

I have to practice at least 100 to 200 Leetcode algorithm hard level, therefore I may be able to pass online code assessment any time.

I should play more Leetcode weekly contest. Also I have to go over more hard level algorithms and medium level algorithms in next two weeks. 


Microsoft: November Vancouver Microsoft office hiring event - I may be a good candidate

 Oct. 18, 2020

Introduction

It is so exciting to prepare for phone screen or code screen, or virtual onsite. I just could not believe that I am still a candidate after Sept. 2020 phone screen.

Preparation and learning

It is so hard for me to get myself focus on learning system design, distributed system, Microservice and all other exciting and challenging topics. I struggle a lot in order for me to complete more Leetcode algorithms, improve Leetcode weekly contest performance, and read technical books as well. 

I will figure out what I can do better this time. 


System design: Distributed Systems | Distributed Computing Explained

 Here is the link. 

In this lesson, I explain: * What is a Distributed System * Distributed Systems Components * Characteristics of Distributed Systems * Distributed Computing Concepts * Types of Distributed Systems * Why Building a Distributed System * Issues of Distributed systems * Advantages and limitations of Distributed Systems

A distributed system is a collection of seperate and independernt software/hardware components, called nodes, that are networked and work together coherently by coordincating and communicating through messages passing or events, to fulfill one end goal. Nodes can be unstructure or highly structured, depending on the system requirements. The complexities are hidden away from the end user, making the whole system appear as one computer. ### Characteristics 1. No shared clock. order evenets - logical clock is achieved through coordination 2. No shared memory. state is distributed throughout the system 3. Concurrency. tasks are executed concurrently 4. Heterogeneity and Loose Coupling. (optional) different OS and technologies Distributed systems are usually - Dynamic - Overlay Networks Examples: Paas, Iaas, Serverless, etc. ### Basic Concepts Nodes have their own processors and could be hardware/software, forming open or closed groups. Resource is an asset that's accessed remotely. It could be virutally anything, such as files, services, storage, other networks, etc. Distribution Transparency is to keep as much of the system as hidden as possible, from the user. This is done through a middleware. Middleware is a logical layer on top of the collective nodes. It handles communication, security, failures, etc. It can be though of as the backbone of the system. Concurrency is the parallel completion of multiple tasks and operations. It is an intrinsic property of distributed systems. Coordination is the smooth collaboration between operations and events. Synchronzaion orders and controls resource sharing. The Architectural Model: - Arrangement of Nodes - Structure of system - Interaction and communication between nodes - Provides: Mangement of complexity and ease of maintenance Global State: - The union of the states of seperate processes - Overview of the entire system - Equivalent of a global namespace or object that holds all global variables ### Common Motives 1. Concensus - Online Banking - Bidding Platform 2. Resource Sharing - Distributed Databases - Distributed File Systems - Example: BitTorrent 3. Data replication 4. Horizontal Scalability 5. Availability ### Types of Distributed System 1. Coupling and Scale 1. Cluster Computing - Homogenous - Management is centralized - Used for high perfomance and minimum downtime 2. Grid Computing - Heterogenous and geographically dispersed - Management is decentralized - Used for large repository of data and high computing power 2. Architecture Model 1. Layered Nodes are grouped into seperate layers, each with a specific goal, e.g. Client-Server Model 2. Object-Based Nodes are loosely coupled with synchronous communication that can make direct calls to other nodes. 3. Data-centered The system is based around a primary data centre through which the nodes communicate. 4. Event-based Nodes communicate and perform operations through their reaction to events. ### Advantages 1. Reliability 2. Scalability 3. Fault Tolerance 4. Increased Performance ### Disadvantages 1. Difficult to detect failures 2. Performance bottlenecks 3. Redundancy 4. Inconsistency ### Issues and Considerations Assumptions made by developers which lead to pitfalls: 1. Zero latency 2. Network is secure and reliable 3. Topotlogy won't change The most important principle that needs to be followed is: The Design for Failure

10 benefits to play leetcode weekly contest on Oct. 17, 2020

 Oct. 18, 2020

Introduction

It is the first time I played weekly contest on Leetcode in 2020. I like to write down 10 benefits. 

10 benefits to play again

  1. I like to improve my rating on Leetcode weekly contest. I stopped playing and my rating went after 70,000. 
  2. After I solved two algorithms and failed to solve one dynamic programming algorithm, I learn to be humble and rush to review dynamic programming algorithm. 
  3. After the contest, I learned a few things from two players, and one is a Google engineer. I like his youtube channel as well. Here is the link. Here is his youtube channel called interview recipe.  
  4. My performance is not so good, ranking 2200 in weekly contest, even though I started 20 minutes late. 
  5. I need to work on hard level algorithm, graph algorithm. 
  6. I was too busy the whole week on system design, Microservice learning. I wrote less than 10 algorithms in the week. 
  7. There are new players and a lot of good discussion posts for me to learn after the contest. 
  8. It is helpful for me to prepare Google, Amazon and Microsoft phone interview, code screen, and hiring day event. 
  9. I should try to push my weekly contest ranking to top 10,000 first. 
  10. Saturday 7:30 PM - 9:00 PM is perfect for me to play. 

System design: Lesson 18 - The Fallacies of Distributed Computing

 Here is the link. 

In this lesson Mark Richards reviews the 8 fallacies of distributed computing, something that we face as both developers and architects when breaking apart our monolithic applications into distributed architectures like Service-based architecture or Microservices. Knowing and understanding these 8 fallacies will save you time, money, and pain when moving to distributed architectures. Stay tuned each Monday for more lessons in Software Architecture at https://www.developertoarchitect.com/....



2.1.a-Networking--Fundamentals--Fallacies of distributed computing

 8 fallacies of distributed computing - 

Here is the link. 


System design: A note on distributed computer - Jim Waldo

 Here is the link. 

I like to spend 10 minutes to read the paper. I like to understand some basics and learn better through paper reading. 

I got this idea to read the paper from the presentation talk - Denise Yu, Why distributed systems are hard. 

Suncor: 550 shares purchase - I like to start to learn from my own failure

 Oct. 18, 2020
Introduction

It is important for me to try to stay consistent and then I can quickly recover when SU.TO was lowest below $15. share more than two weeks ago. I quickly figured out my mistake and then I purchased 500 shares of Su.TO and 50 shares of SU stock. 

My positions


One of Yahoo->Finance->conversations

Many analysts anticipate a third quarter loss. If the loss is within their target, the worst is over for Suncor. Uptrend is ahead. But if the loss is less than their target, or Suncor reports break even in third quarter, the stock will go up. Either case, the worst is over for Suncor. Downside is limited.


System design: Why Distributed Systems Are Hard

 Here is the link. 

Denise Yu covers a brief history of distributed computing, presents a survey of key academic contributions to distributed systems theory including the CAP theorem and the FLP correctness result, and digs into why network partitions are inevitable today. Yu talks about why one needs to account for the human factor when designing a complex system.

Scale Horizontally

Shard, latency

Shared memory, send message to each other - a note on distributed computing - 1994 
Jim Waldo Geoff Wyant, A...

Paper worthy reading - Latency, memory access, partial failures, the hard parts! 

8 Fallacies - 

Saturday, October 17, 2020

Work stock: 5 Stocks ARK INVEST is Buying in October 2020

 Here is the link. 


5 Stocks Ark Invest Cathie Wood is buying in October 2020! Ark Investing is buying many growth stocks in 2020 - and in this video I cover a few stocks that Ark has been buying in their ETF funds so far in October 2020. Most of these companies are high growth stocks and Ark Invest has been spending MILLIONS on these stocks. The stocks include Slack Stock WORK, IPOB Stock Opendoor Stock, Takeda Stock TAK, Intercontinental Exchange Stock ICE Stock, and Iridium Stock IRDM Stock.


ENB stock: Enbridge (TSX:ENB) Stock’s 8.5% Yield Is Unbelievable!

 Here is the article. 

It’s not often you see a stock with an 8.5% yield. But at today’s prices, that’s exactly the yield you get on Enbridge (TSX:ENB)(NYSE:ENB) stock. Thanks to a dividend hike and a beating in the COVID-19 market crash, the stock has the highest yield it’s had in years. Normally, when you see a yield pushing 10%, your first reaction is to doubt it. If a stock is paying out that much, it must be beaten down for good reason — or have a ridiculous payout ratio. But in Enbridge’s case, the dividend may be safer than it appears. As you’re about to see, Enbridge actually did quite well in the second quarter. And the beating it took this year may not have been justified.

Why ENB’s yield is so high

The reason ENB’s yield is so high is because its dividend payout is increasing, while its share price falls. In 2020, Enbridge raised its dividend by 9.8%. At the same time, its stock fell 25%. When you’ve got a stock falling while its dividend rises, its yield is likely to increase a lot. That’s exactly what happened with Enbridge.

That’s not to say that Enbridge was a low yielder before 2020. Even last year, it yielded as much as 7%. But the combination of the dividend increase and the COVID-19 market crash losses took it to a whole other level.

There’s also the fact that Enbridge is actually doing quite well as a company. In the second quarter, the company had $1.65 billion in earnings, $1.13 billion in adjusted earnings, and $2.34 billion in distributable cash flow. The first two of these figures were down only slightly year over year, while the latter was actually up. And as far as dividends go, distributable cash flow is the metric you want to look at. It’s the percentage of the company’s cash that it’s free to pay out to shareholders. So, if that’s going up, then the company has the capacity for more dividend increases in the future.


BC condos: 46289 Yale Road, Chilliwack

 Here is the link. 

I like to check market of this community next three months, and see what it best time to get in the market to purchase with a good deal. 

I like to see at least 30% price drop, below 2018. 

Less than 15 years community. The building shoud be in good shape, less maintenance. I like to see if I can get mortgage and also a good deal for a small home. 




Canada first home purchase: 46289 Yale Road, Chilliwack, British Columbia V2P 0B9

 I like to look into a home to purchase, compared to Surrey and Chilliwack, I also like to consider Chilliwack as my choice. 

Home is the investment and I think that it is important for me to own a cheap place so that I have small mortgage amount. 

Property Summary for 46289 Yale Road

Type
 
Condominium
Sub-Type
 
Condominium
Style
 
Apartment
MLS® Number
 
R2509014
Year Built
 
2008
Association Fee
 
238.32 CAD
Taxes
 
1,063.36 CAD (2019)
Neighborhood
 
Chilliwack Proper
Postal Code
 
V2P 0B9

Description for 46289 Yale Road

INVESTOR ALERT! Welcome to The NewMark Condo's. This well-maintained 1 bedroom 1 bath + den home offers a spacious layout and a Central location in the Heart of Chilliwack. Short walk to grocery, shopping, restaurants, recreation & much more! 5 min drive to Highway and Chilliwack mall. Well run strata, rentals allowed, small pets allowed. Unit comes with 1 under ground parking stall & 1 storage locker. This unit is tenanted month to month to great long-term tenant who would love to stay. Call now for your viewing and more info!

Case study: Social graph - search shortest path in the graph

 Here is the gist. 



Amzn stock: tech stock - AWS cloud - largest public cloud platform in the world

 Another high growth tech stock is Amazon (AMZN - Get Rating), which is also part of the Berkshire Hathaway portfolio. Amazon is the largest e-commerce retailer in the world and while the traditional retail segment has been massively disrupted due to COVID-19, the online platforms have seen an equally surprising surge in demand.

The ongoing pandemic has acted as a tailwind for Amazon and several other e-commerce peers including Shopify (SHOP) and Etsy (ETSY). The shift to online shopping is a fundamental change in consumer shopping behavior which is here to stay. Total online sales accounted for 16% of total retail sales in the second quarter of 2020, up from just 11% in the fourth quarter of 2019.

Investors can expect this figure to move higher over the upcoming decade. Further, there is tremendous growth for Amazon in emerging economies such as India where online shopping is still at a nascent stage.

Amazon’s other business segment such as Amazon Web Services and Amazon Advertising will also support top-line growth. AWS is the largest public cloud platform in the world while its ad platform is the third-largest digital platform after Facebook and Google.

CRM stock: 2004 - 65 times bagger stock - New Done Jones stock

 The third company on the list is SaaS company Salesforce.com (CRM - Get Rating), which has just replaced Exxon Mobil (XOM) on the Dow Jones Index. In the last two quarters, Salesforce’s total sales were up 30% year-over-year. Each of its verticals experienced revenue growth north of 20% while its Platform business increased sales by 64% year-over-year.

Salesforce has been the leading customer relationship platform (CRM) in the world since 2013 and ended 2019 with a market share of 18.4%, according to research firm IDC.

Salesforce continues to benefit as businesses are rapidly shifting operations towards the cloud. However, the stock has returned 6,500% since its IPO in 2004 which has resulted in a sky-high valuation. Salesforce stock is trading at a forward price to earnings multiple of 100x while its price to sales multiple is 11x.

Roku stock: A streaming bet

ROKU - IPO in Sept. 2017, 800% gains - 

If you think streaming is the way we are going to consume entertainment in the future, you can look to invest in Roku (ROKU - Get Rating). Shares of Roku have gained a staggering 800% since its IPO in September 2017.

Roku is the largest selling smart-TV operating system in North America and is platform agnostic which allows you to access several streaming applications including Disney+, Netflix, and Amazon Prime as well as a number of ad-supported content platforms.

In the second quarter, Roku sales were up 42% year-over-year, while the number of active accounts grew 41% and the number of streaming hours jumped 65%. However, Roku remains unprofitable and reported a net loss of $43 million in the June quarter, up from a loss of $9.3 million in the prior-year period.

Roku continues to trade at a premium and has a price to sales multiple of 20. However, we can see that the company’s valuation is supported by robust growth.

V stock: Visa - A fintech giant

Here is the article. 

Another stock from the Berkshire Hathaway stable is fintech behemoth Visa (V - Get Rating), a company that owns about 53% of the credit card network purchase volume in the U.S. which is also the world’s largest economy.

Visa is not a lender and just a payment facilitator making it relatively immune to economic cycles. However, in a recessionary environment consumer spending tapers off which will impact Visa’s top-line growth.

Visa has tremendous potential given the digital payment revolution is just starting in developing economies of Asia and Latin America. Visa is one of the fastest-growing stocks in Berkshire’s portfolio as analysts expect the company’s annual earnings to grow by 8.5% through 2023.

Visa recently pumped in $5 billion to acquire Plaid, another player in the fintech space, which shows it is not averse to big-ticket acquisitions.

Friday, October 16, 2020

Edward Jones: Navigating the Investing Rules of the Road

Here is the article. 

Here is the service change detail. 

How are we paid for our service? Buying & Selling Front-End Load (FE) purchase option: A purchase cost is charged directly to you and deducted from the amount invested in the fund. This can range from 0% to 5% of the value of the investment (e.g., a $1,000 investment at 5% FE load means $50 would go to Edward Jones and the remaining $950 would be invested for you in units of the Mutual Fund).


System deisgn: Microservice - How to quickly learn system design applying Microservice?

 Oct. 16, 2020

Introduction

I think that reading a very written book is a top choice, but for me it seems that I have so many issues. I tried to read design large data intensive application, but I almost fell asleep after reading one or two hours. One of ideas is to using Google image search. 

Microservice read and write architecture

I search Google and then choose image tab, and then I think that there are so many images, and each one has a nice blog about the architecture. Starting reading, if I get bored, then I should take a break. 

Best book I am reading now

I am reading this book now. 


System design: Why we failed to implement CQRS in Microservice architecture.

 Here is the article. 

If I can draw the diagram like the one called CQRS implementation, then I will start my journey as a serious system design learner 

Medium is very good to figure out what I like to read. It is such a good place for me to learn system design. 





Thursday, October 15, 2020

System design: Microservice - The hardest part of microservices is your data

 Here is the link. 


GME stock: secrets behind share price 400% gains from August to Oct. 2020

 The lifecycle of consoles is growing, meaning GameStop likely won't survive if all it does is hope to ride the current upgrades until the next cycle bubbles up. With new systems lasting seven years or more on average, GameStop needs to do something now if it wants to be around then.

To an extent, it is -- the pandemic showed the retailer how to leverage its online presence and physical footprint to grow revenue. E-commerce sales jumped 800% in the second quarter after having been up as much as 1,000% during a six-week period in the first.

GameStop has hired a new chief digital officer to focus on how it confronts the challenge. It has also redesigned its mobile app, which it claims will make a gamer's experience more meaningful, whether he or she is in the store or outside it. 

Management noted e-commerce sales are on track to be a $1 billion business this year, yet they have only achieved 20% penetration, suggesting there remains significant growth in the years ahead. Coupled with arguably one of GameStop's most important developments, the just-announced 10-year agreement with Microsoft to modernize the retailer's back-end operations and expand its digital and physical game options, there is hope for the company's future.

Rental analysis: Chinese student visa/ visiting professor visa

 


首先,保尔森中心今年研究显示,美国拥有全球人工智能领域 60% 的顶尖研究人员,其中美国本土研究者占 31%,中国出生的占 27%。美政府决定限制甚至禁止中国研究生从事敏感课题研究,这会在不久的将来大幅减少中国学者和学生在美国这些领域的贡献。

疫情前 2018 年 5 月至 9 月,获得美国商务、休闲和教育签证的中国公民比前一年减少 10 万多人,下降 13%。尽管 2019 年中国仍是美国国际学生的最大来源,但由于一系列原因美国限制学生签证、中国学生选择赴其他国家留学以及新冠疫情,预计今年及以后人数将骤降。据报道,6 月份只有 8 名中国学生获得赴美的学生签证,8 人获得访问学者签证。与之相比,2019 年 6 月份这两个数字分别是 34001 和 5736。