Blog

Notes on data structures & algorithms, system design, and things I learn along the way.

Learning DSA? Follow the structured path — ordered articles from recursion to dynamic programming.→
October 17, 2026LLD Case Study: Designing a Parking Lot10 min read

The most common low-level design interview question, worked end to end: clarifying requirements, finding the entities, choosing composition over inheritance, putting spot allocation and pricing behind strategies, handling concurrent arrivals, and the code for the core flow.

#LLD
October 16, 2026Dependency Injection Without the Framework3 min read

Dependency injection sounds like a framework feature, but it's one idea: a class receives its collaborators instead of creating them. Why that makes code testable and replaceable, the composition root where real implementations are chosen, what DI containers add, and the mistakes that turn it into indirection for its own sake.

#LLD
October 16, 2026Factory and Builder: Two Patterns for Creating Objects4 min read

When 'new SomeClass(...)' starts spreading decisions and long argument lists through your code, two creational patterns help. A factory decides which class to build; a builder assembles a complex object step by step. When each one earns its place, and how they look in idiomatic TypeScript.

#LLD
October 10, 2026Composition over Inheritance, with Numbers3 min read

Why inheritance hierarchies explode when behaviours combine, how composing small objects avoids it, and when inheritance is still the right tool. With the arithmetic, the fragile base class problem, and decorators in TypeScript.

#LLD
October 10, 2026The Observer Pattern: Telling Others Without Knowing Them3 min read

How a subject notifies a list of observers through a small interface, so new reactions can be added without editing the code that triggers them. Implementing it in TypeScript, its pitfalls — ordering, errors, leaks, re-entrancy — and how it relates to event emitters, pub/sub and the DOM.

#LLD
October 10, 2026SOLID Principles, Shown on One Class10 min read

Five principles for object-oriented design, applied one at a time to a single order service. What each one actually prevents, how to spot a violation in a code review, and when following them blindly makes code worse.

#LLD
October 10, 2026State Machines and the State Pattern3 min read

A vending machine, an order, a TCP connection: objects that respond to the same event differently depending on what happened before. How to model them as explicit state machines, implement them with the State pattern or a transition table, and stop invalid states from existing.

#LLD
October 10, 2026The Strategy Pattern: Swapping Behaviour Without if/else3 min read

When one step of an algorithm varies — pricing, sorting, retry policy, compression — the Strategy pattern puts each variant behind an interface and picks one at runtime. How it works, how it looks in TypeScript with classes or plain functions, and when a switch statement is still better.

#LLD

8 posts tagged LLD · page 1 of 1