Category
object oriented design
9 articles across 6 sub-topics
LLD for Parking Lot System: Designing a Smart Garage
TLDR TLDR: A Parking Lot is the "Hello World" of Low-Level Design. It teaches Encapsulation (ParkingFloor hides its Min-Heap), Abstraction (PricingStrategy interface), Inheritance (BikeSpot/CompactSpot/LargeSpot extend ParkingSpot), and Polymorphism...
LLD for Elevator System: Designing a Smart Lift
TLDR TLDR: An elevator system is a textbook OOP design exercise: ElevatorCar encapsulates its stop queue, ElevatorState polymorphically handles direction changes (State Pattern), and DispatchStrategy keeps assignment algorithms swappable (Strategy P...

LLD for Tic-Tac-Toe: Designing an Extensible OOP Game
TLDR: Tic-Tac-Toe looks trivial — until the interviewer says "make it N×N with P players and pluggable winning rules." The key design decisions: a Board abstracted from piece identity, a Strategy Pattern for win conditions, and a Factory for player c...

LLD for Ride Booking App: Designing Uber/Lyft
TLDR: A ride-booking system (Uber/Lyft-style) needs three interleaved sub-systems: real-time driver location tracking (Observer Pattern), nearest-driver matching (geospatial query), and dynamic pricing (Strategy Pattern). Getting state transitions ri...
LLD for URL Shortener: Designing TinyURL
TLDR TLDR: A URL Shortener maps long URLs to short IDs. The core challenge is generating a globally unique, short, collision-free ID at scale. We use Base62 encoding on auto-incrementing database IDs for deterministic, collision-free short codes. ...
LLD for Movie Booking System: Designing BookMyShow
TLDR TLDR: A Movie Booking System (like BookMyShow) is an inventory management problem with an expiry: seats expire when the show starts. The core engineering challenge is preventing double-booking under concurrent user load with a 3-state seat mode...
LLD for LRU Cache: Designing a High-Performance Cache
TLDR TLDR: An LRU (Least Recently Used) Cache evicts the item that hasn't been accessed the longest when it's full. The classic implementation combines a HashMap (O(1) lookup) with a Doubly Linked List (O(1) move-to-front) for overall O(1) get and p...

Strategy Design Pattern: Simplifying Software Design
TLDR: The Strategy Pattern replaces giant if-else or switch blocks with a family of interchangeable algorithm classes. Each strategy is a self-contained unit that can be swapped at runtime without touching the client code. The result: Open/Closed Pri...
