Journal & Essays

Explorations and deep dives across science, technology, finance, investing, economics, and photography.

Essential Software Design Patterns: Architectural Principles and Multi-Language Implementations

Design patterns offer proven, language-agnostic blueprints for solving recurring software engineering challenges. While the underlying architectural principles remain universal, their concrete implementations vary meaningfully depending on each language’s type system, memory model, and native...

Understanding the Repo Market: Fundamentals, Mechanics, and Key Players

The Repurchase Agreement (Repo) market is often described as the “plumbing” of the global financial system. While it rarely makes headlines during normal times, trillions of dollars flow through it every single day. Without...

Cartesian Matching Algorithm

Every now and then I encounter algorithms that is both intuitive as well as far-reaching. The algorithm to be described in this post is called Cartesian Matching Algorithm. Bear with me here, as this...

Day of the date

I like seeing elegant algorithms arise out of prodigious mathematical methods. One such is calculating day of any date in O(1). Let’s take a look at the implementation. int getDay(std::vector<int> date){ int m=date[0], d=date[1],...

Variadic Templates

One of the remarkable features of Modern C++ is variadic templates. Ability of templates to take variable number of was initially designed by Douglas Gregor and Jaakko Järvi and then standardized in Modern C++....

Linear Time Median

Median is considered one of the important measures in Statistics. Unlike Mean, it is not skewed by a few very large values in the dataset. Computing Median can seem like a trivial problem and...

C++ Smart Pointers - What they do and How they work?

I recently had a chance to watch an interesting CppCon lecture by Arthur O’Dwyer titled Back To Basics: Smart Pointers. Atleast for me, the talk was a pretty good review/refresher of what Smart Pointers...

Quack - A Queue and a Stack in one

Quack is an unique data structure that combines the properties of both Stack and a Queue. The structure can be viewed as a list of items written from left to right. It lets you...