Thursday, October 15, 2020

System design: Four Distributed Systems Architectural Patterns by Tim Berglund

 Here is the link. 


Reference Architectures [2:08] Modern Three-Tier [2:25]  Presentation - Business - Data [2:54] (JSP EJB Oracle) (React.js Node.js Cassandra) Strengths [12:43] Rich front-end framework (scale, UX) Hip, scalable middle tier Basically infinitely scalable data tier Weaknesses [14:57] State in the middle tier Overall Rating [15:32] Scalability 4 Hipness 2 Difficulty 3 Flexibility 5 Sharded [16:49] When Sharding Attacks [19:53] Strengths [23:38] Client isolation is easy(data and deployment) Known, simple technologies Weaknesses [24:56] Complexity No comprehensive view of data (ETL) Oversized shards Overall Rating [28:00] Scalability 3 Hipness 1 Difficulty 4 Flexibility 3 Lambda [28:39] http://softwareengineeringdaily.com/2016/08/19/apache-beam-with-frances-perry/ Messaging [34:42] Kafka [35:09] Strengths [38:20] Optimizes subsystems based on operational requirements Good at unbounded data Weaknesses [39:09] Complex to operate and maintain No, seriously Overall Rating Scalability 5 Hipness 1 Difficulty 5 Flexibility 2 Streaming [39:57] Streaming [40:04] Integration is a first-class concern Life is dynamic; databases are static Tables are streams and streams are tables Keep your services close, your computation closer Integration [41:55] Database Abstraction [45:25] Storing Data in Messages [46:26] Retention policy? Don't be so hasty Whole-hearted I/O performance O(1) writes Partitioning, replication Elastic scale First-class events [47:07] Streams API for kafka [48:05] Core Kafka since 0.10 (May, 2016) Filters, aggregations, joins Doesn't require a separate cluster! Keep stream computation near your code Overall Rating Scalability 5 Hipness 5 Difficulty 4 Flexibility 5

System design: Design Microservice Architectures the Right Way

 Here is the link. 

QCon Plus covers the trends, best practices, and solutions leveraged by the world's most innovative software shops. Taking place between November 4-18, the event is thoughtfully designed with shorter, focused technical sessions spread over 3 weeks. You’ll learn from 54 speakers and 4 keynotes across 18 tracks. The event includes highly interactive sessions, Q&As, AMAs, breakouts, and real-time collaborative action.

Michael Bryzek highlights specific key decisions that very directly impact the quality and maintainability of a microservice architecture, covering infrastructure, continuous deployment, communication, event streaming, language choice and more, all to ensure that teams and systems remain productive and scale.


GME stock: 13% gains on Oct. 15, 2020 - 400% return in 3 months

The stock has 400% return starting from August 2020. The price was arond $4.00 dollar/ share in August, 2020. 

I should look into how institution buyers or retail buyers pushing up the price. 

I bet on 30 shares on Oct. 9, 2020, but I sold in panic with loss $30.00 dollars. I should start to look into more about GME stock. 


Arry stock: IPO first day

 Oct. 15, 2020

Introduction

I have to push myself harder to work on equity research. I got up at 8:00 AM and then I did some equity research, I did purchase $1000 dollars stocks: NCLH, SU, AAL. I did not pay attention to Arry stock, my friend in wechat chinese group shared the stock information, one person followed her sharing. 

Arry stock:

It is the first day IPO. My friend later shared her story, she purchased 1000 shares, bought at price $20, and sold at $26. The price went up $36.00 dollars. I did not notice the stock at all through wechat conversations. 




My research

I have to take it seriously, and work on equity research. I should pay attention to IPO stock as well. No one can avoid market risk, but it takes hard work to understand which stock went to IPO today. I should start to read more about Arry stock. 



Book reading: .NET Microservice: Architecture for Containerized .NET applications

 Oct. 15, 2020

Introduction 

I like to rush and read as many pages as possible. I am reading the book, and I like to prepare my Saturday system design mock interview, so I can understand better and talk about better about system design. 

Book reading

There are so many good content for me to understand Microservices. But how do I find the book? I did read the article about Microservice system design, and then I checked the reference [8]. Here is the blog. 


Wednesday, October 14, 2020

Algorithm practice: Learn from my own performance on interviewing.io as an interviewee

Oct. 14, 2020

Introduction

It is unbelievable to find almost all questions asked on Leetcode.com. I quickly wrote a discussion post for each algorithm, and enjoyed the benefit to solve another 5 algorithms at least. 

My mock interviews and leetcode discussion post 

Oct. 13, 2020

  1. Combinations
    C# Depth first search practice

  2. Generate Parentheses
    C# brute force solution to enumerate all possible combinations

  3. Word Search
    C# Word search - DFS algorithm
    C# code review my practice on June 14 2017
    C# my practice in July 2015

  4. Subarray Sum Equals K
    C# I learned from my own mock interview performance

  5. 01 Matrix
    C# Apply breadth first search to find shortest distance

  6. Spiral Matrix
    C# practice on interviewing dot io as an interviewee

  7. Maximal Rectangle
    C# Review my practice on August 1, 2017

Stock investment: Monthly goal - set $500 gains as my goal

 Oct. 14, 2020

Introduction

It is so hard to get rid of market risk. I like to learn better to manage risk. One of ideas is to set goal low, like $500 dollars gain, so the loss may be less than $1000/ month. I like to stay positive, do not time the market. Get back in again. 

My Ameritrade.com IRA account

I only held around $1200 dollars stock. I like to purchase at most less than $6000 dollars stock, and I plan to make some gains around $500 / month. 

I like to hold cash around $13,000 dollars in case there is big market correction or 20% to 30% pullback. 

TFSA account 

I also like to purchase around $10,000 dollars stocks and then try to make profit around $500/ month. I like to learn how to stay consistent, and learn to love equity exposure. Live a day with market go up and down. Learn how to take it easy, and do not let the market interrupt my daily work and my life. 


System design: Linkedin profile - Randy Shoup - Microservice architecture

 Here is the link. 

About

I have worked as a senior technology leader and executive at companies ranging from small startups, to mid-sized places, to eBay and Google. I have found that high-performing organizations combine clear goals, supportive culture, efficient organization, and flexible technology. I believe in small multidisciplinary teams, autonomy and accountability, and goals over solutions. Mostly, I believe in doing something you care about with people you like and respect.

I have a broad range of technology interests, and I like a new challenge. So I suppose I have been more or less a serial expert, moving from databases and analytics platforms, to security software, to ecommerce and search, and more recently to cloud infrastructure. One common thread across the last 30 years has been working on highly scalable, highly available, multi-tenant distributed systems serving hundreds of millions of users.

I enjoy sharing my experiences with others through advising and conference speaking. You can find a range of topics covered at slideshare.net/randyshoup, and on my blog at randyshoup.com.
 

System design: How to learn better as a beginner?

 Oct. 14, 2020

Introduction

It is easy to set up ambitious goal to solve another 100 algorithm on Leetcode.com. I only have two more weeks to prepare for Leetcode algorithm practice. But I do really like to motivate myself to be a good system architect one day. How can I start the journey? I do think that it can be done. Today is the day one. 

Managing Data in Microservices

I learned from the presenter - he talked about his own experience, and I need to write down his name, and then look up through Linkedin.com. 


FSLY stock: Fastly Plummets After Tension Over ByteDance Curbs Sales

 Here is the article. 

One of Chinese friends in wechat investment group invested 200 shares of FSLY at price of $89.00. 

Fastly shares fell as much as 30% in late trading Wednesday after the cloud-platform provider said revenue for the period will be in the range of $70 million to $71 million, compared with its previous guidance of at least $73.5 million. Analysts were estimating sales of at least $74.2 million.

Fastly has been among the biggest pandemic winners in the stock market this year, with its shares gaining more than 500% as a result of increased internet traffic due to stay-at-home measures.

Content delivery networks use a tech distribution platform to push speedy internet content in front of consumers whether they’re buying cases of beer on Shopify, or loading videos on TikTok.


System design: Managing in Microservices

 Here is the link. 

Randy Shoup shares proven patterns that have been successful at Google, eBay, and Stitch Fix. Shoup covers managing data, the need to isolate a microservice's data store behind the service interface, using events as a first-class tool in the architectural toolbox, techniques for service extraction from a monolithic database and much more. This presentation was recorded at QCon New York 2017. The next QCon is in London, March 5-7, 2018. Check out the tracks and speakers: http://bit.ly/2hxsoN1


Starting from 28:00 - 30:38

Talk about stitch fix - how to extract microservice?

Two apps, - three tables

Extract -> client- service

core client

item-service - core item

style-service -> core sku

Styling app / warehouse app

Two apps -> three services -> three databases - dependency, join, and then ...

Extract things to service

Microservice techniques: Shared Data


Manage data - Join,

System design: Microservices vs SOA | Microservices Tutorial for Beginners | Microservices Training | Edureka

 Here is the link. 

Even though there isn’t a formal definition of microservices architectural style, there are some common characteristics that all applications adhering to this architecture should exhibit to make them scalable. These characteristics are smart endpoints & dumb pipes, decentralized governance, infrastructure automation, and failure isolation. Let’s discuss about each characteristic in the following sections.

1. Integration pattern: smart endpoints and dumb pipes

As a microservices application split up its structure into loosely coupled multiple components, natural questions to ask seem to be: In which protocols are pairwise components communication conducted? Given the protocols, in what patterns should the data be routed throughout the application?

a. Communication Protocols

When building communication structures between different processes, there’re many products and approaches that stress putting significant effort into the communication mechanism itself. A good example of this is the Enterprise Service Bus (ESB), where ESP products often include sophisticated facilities for message routing, choreography, transformation, and applying business rules. (ESB is also the fundamental difference between Microservices and Service-oriented Architecture (SOA). Further comparison between the two can be found at [2]).

Microservices, instead, favors an alternative approach: “smart endpoints and dumb pipes”. Microservices applications aim to be as decoupled and as cohesive as possible — they own their own domain logic an act more as filters in the classical Unix sense- receiving a request, applying logic as appropriate and producing a response, which is choreographed using mostly two commonly form of communications: Request-Response and Observer.


ENB stock: value stock, good time to purchase more

Here is the article.  

Fortunately, on this metric, the company seems to be in good shape. Management expects to generate $5.9 to $6.3 per share in distributable free cash flow this year. That’s because demand for natural gas has been relatively robust, despite the pandemic. Meanwhile, this year’s expected dividend is $2.46.

That means Enbridge stock could generate roughly double the amount it needs to provide a dividend. That makes the dividend incredibly reliable. 

Enbridge stock valuation

Unsurprisingly, Enbridge stock is also trading at a beaten-down valuation. Investor anxiety about energy demand has pummelled all oil and gas stocks this year. However, Enbridge isn’t an oil and gas producer, but a transporter. In other words, it owns and operates the pipelines used to distribute gas. 

In fact, Enbridge supplies 25% of crude oil produced in North America, and nearly 20% of the natural gas consumed in the U.S. Volumes dipped this year as North America went into lockdown, but should recover next year as the economy regains momentum. 

That bounce back hasn’t been priced into the Enbridge stock price yet. The stock trades at six times earnings before interest, taxes, depreciation and amortization (EBITDA). That’s far below its historic average of 8.9 times EBITDA. The stock also trades at a forward price-to-earnings ratio of 14.3 and just 34% higher than book value per share. 

It’s the ultimate value stock. In this environment, it’s also an incredible contrarian opportunity, especially for income-seeking investors.  My Fool colleague Andrew Button believes a Trump re-election could be the catalyst that helps unlock value in Enbridge stock. At this point, that seems fairly likely. 

Tuesday, October 13, 2020

Alida ( Vision Critical): Customer - Aurora healthcare

 Here is the link. 


System design: Microservice

 Here is the link. 

I had a mock system design interview, and then my interviewer was so smart and gave me the hint to ask me talk about more about Microservice. It is such great help for me to go back to learn something about Microservice. 

The interviewer dropped me and quitted the interview early, but I quickly figured out what to do next. The world is changing so quickly, I could not focus on so many things. 

Here is the article about Microservice system design. 

Here are some good ideas to look into: 

These characteristics are smart endpoints & dumb pipes, decentralized governance, infrastructure automation, and failure isolation. Let’s discuss about each characteristic in the following sections.

A good example of this is the Enterprise Service Bus (ESB), where ESP products often include sophisticated facilities for message routing, choreography, transformation, and applying business rules. (ESB is also the fundamental difference between Microservices and Service-oriented Architecture (SOA). Further comparison between the two can be found at [2]).

Let me find out those two articles, and I like to spend time for each article over 10 minutes at least. 

Chained or chain of responsibility 

Branch pattern

Saga pattern 





Alida (Vision Critical): Customers

 Here is the link. 


How eviction works in USA

 Here is the link. 


Florida rental condo: An engineer works remotely and plan to move in

 Oct. 13, 2020

Introduction

USA is such a great country. The engineer is so smart and then figure out moving to Florida for cheap rent. Work remotely is such great deal for family and professionals. Specially for those working at Florida before. 

Florida rental condo

I am planning to rent out the condo in Nov. 2020 for a new renter. History is such great thing for me to write about. 

I will try to find some pictures back in 2001. It is almost 20 year since my friend moved in the rental place, who used to be my first renter back in 2000. 

An engineer decided to move from Sillicon Valley back to Florida. It is smart decision and then Florida winter is such great time to enjoy. 

Airline ticket cost is less than $200 dollars. The transportation of car is around $1000 dollars. I do think that I am also taking risk to lower rent and just cover $300  monthly maintenance, and those property tax $2000 dollars. I need to pay $5000 for roof repair this year. I need to have some cushion in order for me to survive. 

I need to save at least $2000 in order for me to survive as a landlord. Even if the home is paid in full. 


Patience: When I time the market, be alert that 80% I am gambling ...

 Oct. 13, 2020

Introduction

It is Tuesday and I spent a few hours to read about stock market. I checked MRO and SU stock price, and wonder if I should time the market and get back in. 

Time the market

I also need to check next two months and see what I should do since holiday season is coming. 

MRO stock: Marathon Oil Stock Doesn’t Look as If It’s Going Anywhere Anytime Soon

 Here is the article.

The Houston-based energy firm, which has a market cap of about $3.46 billion, can trace its roots to 1887 and Standard Oil, taking twists and turns over the century-plus to even be a part of United States Steel.

Few people would describe Marathon Oil as a high flier. Over the last five years, MRO stock chugged along in the upper teens and 20s, with some peaks and valleys along the way.

The company’s dividend, meanwhile, helped lure energy and income investors to buy its relatively affordable shares.

For instance, five years ago you could buy a share of MRO stock for $19.59. Two years ago, that share fetched $23.41. It hasn’t been that high since.

Over the last 12 months, MRO topped out at $14 and change. The stock’s 52-week low is $3.02. That’s probably less than you would pay for a bottle of soda and snack at the gas station’s store. Now, a gallon of gasoline would cost less – and that is part of Marathon’s woes.

Marathon trimmed costs and capital spending during the quarter, said Lee Tillman, the company’s chairman, president and CEO said in a statement:

“Amid tremendous commodity volatility, our ongoing response to the COVID-19 global pandemic, and a challenging year for our industry, we have remained focused on the factors we can control: how we allocate capital, how we manage our cost structure, and how we execute.”

Marathon Oil is scheduled to post its third-quarter earnings after the market closes on Nov. 4.

The company also is restoring its dividend. The payout of 3 cents per share will be paid quarterly beginning Dec. 10 to MRO stock holders of record as of Nov. 18.

Tillman said the company can break even if oil is priced at $35 a barrel.


F and GE stock: Ford and General Electric are headed back to the double digits, Jim Cramer says

 Here is the article. 

“Longer term, I think both Ford and General Electric are headed back to the double digits,” the “Mad Money” host said, “but if you only want one of these Robinhood favorites in your portfolio, I would go with Ford.”

The investment firm Benchmark on Monday gave Ford a buy rating, up from hold, forecasting momentum in the new year for the automaker. The stock rose almost 6% on the news to a $7.67 close.

Monday, October 12, 2020

DIS stock: Disney reorganizes media, entertainment businesses to focus on streaming

 Here is the article. 

Under the restructuring, content creation will be managed in distinct groups: Studios, General Entertainment and Sports will be headed by current leaders Alan F. Horn and Alan Bergman, Peter Rice, and James Pitaro, respectively. The “Media and Entertainment Distribution” group will determine the monetization of content from all those sources and be led by Kareem Daniel, formerly president of consumer products, games and publishing for Disney. All five leaders will report directly to Chapek.

Streaming service Disney+, which has attracted more than 60 million subscribers since its November 2019 launch, has adopted a more aggressive approach to taking content direct to streaming amid the COVID-19 pandemic. Movies such as “Mulan” and “Hamilton” have debuted on the service instead of in theaters in the U.S., and last week, Disney said Pixar’s next animated film, “Soul,” will premiere on Disney+ on Dec. 25.

Case study: Mock interview - algorithms - spiral matrix and calculate number of subarray with given value k as sum

 



Two algorithms:

calculate number of subarray with given value k as sum. Here is the link. 

Spiral matrix, here is the link. 

Case study: Mock interview practice - Find number of subarray with sum equals to k

 Here is the link. 


Case study: Mock interview practice - find spiral matrix

 Here is the link. 




Here is the discussion link.

Case study: Mock interview practice - Find a list of words in a given string

 Here is the link. 



The interviewer was very experienced, and he said that I know that you are experienced. You have 10 minutes for the first question, and then you have 20 minutes for the second algorithm.
I did not come out using Trie to put all substrings. Once the interviewer gave me hint to think about a string is 100 page long, a billion words. I quickly came out the idea to put all those Trie with substrings starting from 'a' to 'z'.

Case study: Mock interview practice - merge two sorted arrays

 Here is the link. 


Case study: Mock interview practice - find distance to closest 0 in a matrix for all those 1

 Here is the gist. 



Here is the link of Leetcode discuss. 


Interviewing.io: Book anonymous interview with company on interviewing.io

 Oct. 12, 2020

Introduction

I am preparing for Google phone screen on Nov. 2020, so I had three mock interviews as interviewee on interviewing.io last weekend. Surprisingly I got invited on interviews. 

Invitation - surprisingly



F stock: Ford's stock rallies after Benchmark analyst turns bullish, sets new target implying 38% gain

 Here is the article.

Shares of Ford Motor Co. F, 6.14% rose 1.1% in premarket trading Monday, after the auto maker was upgraded by Benchmark analyst Michael Ward, citing expectations that third-quarter earnings and a new management team will provide a near-term catalyst for the stock. Ward raised his rating to buy from hold and established a stock price target of $10, which is 38% above Friday's closing price of $7.25. "Better than expected North American production, a positive shift in mix, and improving metrics in the auto credit markets, in our view, are the primary drivers for better than expected earnings performance in the third quarter," Ward wrote in a note to clients. "The management changes along with new product momentum and the benefits of cost improvement actions, in our opinion, are positive variables for the stock." Ford is scheduled to report third-quarter results on Oct. 28, and named a new chief executive, Jim Farley, effective Oct. 1, and also named a new chief financial officer, John Lawler this month. The stock has lost 22.0% year to date through Friday, while shares of rival General Motors Co. GM, 0.91% have declined 12.1% and the S&P 500 SPX, 1.92% has gained 7.6%.



Sunday, October 11, 2020

Market price will go down more - Surrey condo

Oct. 11, 2020

Introduction

I wish that I have learned more about investing. The condo price was around $170,000 Canadian dollars in 2017, now it is on sale with price $249,000. Should I invest and take risk to make purchase? 

I have to pay $700 to $1000 dollar mortgage. I think that it is not easy to make payments. I have free work permit to work in Canada. 



Home purchase plan: Buy a suite and take advantage of low price and low mortgage rate

 Oct. 11, 2020

Introduction

It is tough for me to handle so many stress this year 2020. I just lost $7000 dollars gains and my own capital in TFSA account and $3000 gains on my USA Ameritrade.com retirement account. Now I try to purchase this small suite with 307 square foot and see if I can get loan and purchase my first Canadian home

First purchase

It is hard for me to invest on stock market. I do like to invest on equity, but I missed 2010 to 2020 10 year bull market, all my USA retirement fund has 1% return from 2010 to 2020. I paid the price of finance illiteracy. 

I need to figure out how to get back. It is tough to get loan since coronavirus makes a lot of things uncertain. 

The home is here. 

All my 10 years saving will go away to pay this suite down payment. I just think that I will have free medical insurance in Canada. I should have a home in Canada. I like to live a 5 year old building so that I can enjoy something new. 

BALANCE: Central Surrey's modern solution for space, location and style. Expertly crafted and fashionably finished, BALANCE offers affordable space solutions for all buyers. Light & bright finishes incl modern white embossed quality cabinetry, quartz counters throughout w/tiled bath and IN-SUITE LAUNDRY. Large covered balcony on the QUIET side of the building! Eastern exposure provides lots of natural lighting. A great investment opportunity for an investor or first time buyer: centrally located, walk-able to all amenities and public transit including SKYTRAIN! Still under New Home Warranty, in booming City Centre this studio suite offers great value today and incredible future potential. 1 UNDERGROUND SECURED PARKING & STORAGE INCLUDED! Pet Friendly with NO RENTAL RESTRICTIONS! (id:1937)



Mortgage with $150,000 dollars

I like to learn how to make more money. I need to consider a few things:

  1. If I lose the job, then how long can I support myself to pay mortgage? 
  2. How can I plan to live comfortably in a suite. 
  3. I am 54 year old now. I have to spend some time to enjoy something. Not all of us can live healthy and happy until 54 year old. 
  4. Take it slow. Do not worry too much. 
  5. I will learn how to invest good stocks and build some wealth from stock market. 
It is hard for me to make money as an employee. But I have to push myself hard to prepare Google phone screen, learn more about system design and behavior interview, and also really push myself hard to work on algorithm and data structure. 

Work from home

If most of employees can work from home, then the condo near Surrey sky train should go down. The suite I like to purchase may go down to $170,000, price in 2018. I should wait. 

It takes me 10  years to save those down payment. I should think about it more carefully.