Luyi's Blog

From 0 to 1, My Tech Journey

Topological Sorting

graph theory

Real Work Challenge Many real world problems can be modelled as a graph with directed edges where some event must occur before others. Things like school class prerequisites, program dependencies,...

Lowest Common Ancestor of Binary Tree

LCA

What is the Lowest Ancestor (LCA) of Binary Tree? The lowest common ancestor is the lowest node in the tree that has both p and q as descendants. Hence, the LCA of a binary tree with nodes p and q ...

Segment Tree

Range Query

What is Segment Tree? From Wikipedia: In computer science, a segment tree, also known as a statistic tree, is a tree data structure used for storing information about intervals, or segments. In sho...

Takeaways from AWS Kinesis Outage

Serverless Application

On Nov. 25 2020, AWS had a serious outage in northern Virginia region which impacted lots of companies, my company included as well no doubt. Specifically, this outage came from Kinesis, but then i...

LeetCode 4: Median of Two Sorted Arrays

Binary Search

This is a traditional LeetCode challenge, but it has a few important things we have to dig it, so let’s take a review how to solve it. Problem Statement Link: LeetCode. 1 Given two sorted arrays n...

Few Thoughts on Concurrency in Singleton

Double Checked Locking

Making singleton thread safe is a traditional topic in concurrency programming. There has a lot of implementations here but one of the most popular is Double-Checked Locking. A project bug I found ...