May Reflection 2023

| 4 min read

Monthly Reflection

This month was a bit slow for me, but I managed to brainstorm at least 5+ blog post ideas. I suppose this is not a bad thing. As always, celebrate this win!

Achieved List for the month:

  • Published 2 blogs, What is Nullish Coalescing Operator and Exploring JavaScript Prototype Inheritance
  • Read What is a Url blog post
  • Read Chapter 2 of System Design - Back of the Envelope Estimation
  • Learned about Docker
  • Harvard CS50 - the beginning to week 2

Blogs

Nullish Coalescing Operator

It is an operator that checks for null or undefined values only. Keep in mind about a pitiful, if the value contains true or false in a boolean context, the nullish coalescing operator would not work on this. In this case, the logical OR operator or ternary operator should be used.

const value = null;

const check = value ?? "2nd value";
console.log(check); // 2nd value
// try assign undefined to value, it will return 2nd value again
const value = "1st value";

const check = value ?? "2nd value";
console.log(check); // 1st value

Exploring JavaScript Prototype Inheritance

I deeply dive into the topic of inheritance for object and function and learned the differences between them. You could use either the new keyword (for function) or Object.create() (for object and function).

What is a URL?

The blog post by the creator of curl highlights a funny URL and explains how different systems handle it. However, it doesn’t delve into the impact of varying system interpretations of URLs. A talk by Orange Tsai uncovers inconsistencies between different libraries and the resulting security risks. Understanding the parts of a URL, such as a scheme, username, password, host, port, path, query, and fragment, is essential but challenging due to differing interpretations.

Inconsistencies can lead to parsing errors, as exemplified by different behaviors in query/username and port/path parsing. Handling URLs securely, especially when dealing with user input, requires careful consideration and architectural safeguards.

System Design

Load balancing

I discovered this article on load balancing, which artfully employs visuals to illustrate a gradual progression from the simplest concepts to a comprehensive exploration of various load balancing algorithms, including round robin, weighted round robin, and many more.

Back of the Envelope Estimation

This chapter introduces the concept of back-of-the-envelope (BOTE) estimation, a quick and rough technique used in system design interviews to estimate metrics like storage, traffic, and processing power. It can be likened to forecasting sales or predicting weather conditions.

For example, estimating the storage size needed for daily user posts on a platform like LinkedIn involves considering daily user activity and extrapolating it to future years. Accurate estimations can help companies scale their databases effectively, plan upgrades or adjustments to cloud services, and obtain quotes from different cloud providers. The chapter prompted the reader to engage in calculations and considerations regarding the amount of storage space required in future years.

Docker

What is container and container image? It is a lightweight, standalone, executable package of software that includes everything needed to run an application. This package contains underlying OS dependencies, runtime dependencies (e.g. Python runtime), libraries (e.g. SQL Alchemy) and application code.

Harvard CS50

I watched from the beginning to the week 2 section of the video.

Summary:

  • Creating your first program in C.
  • Working with variables, conditionals, and loops.
  • Utilizing the Linux command line.-_+
  • Problem-solving approach for computer science problems.
  • Understanding the basics of arrays, strings, and command-line arguments.

Links:

Thank you!

Thank you for your time and for reading this