Category
oop
5 articles across 4 sub-topics

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...
Python OOP: Classes, Dataclasses, and Dunder Methods
📖 Why Every Java Developer Writes Un-Pythonic Classes on Day One Imagine a developer — let's call him Daniel — who has written Java for six years. He sits down to write his first Python class and produces this: class BankAccount: def __init__(se...
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...
