Skip to content
FollowtheDamnCode

Design patterns and low-level design

The whole track is free.

Object-oriented foundations

Classes, objects, and the handful of ideas every pattern is built from — encapsulation, composition, polymorphism, interfaces, and how tightly things should depend on each other.

SOLID and design principles

Five principles for code that bends instead of breaking, plus the three rules of thumb (DRY, KISS, YAGNI) that keep you from overdoing them.

Creational patterns

Five ways to decide who creates an object and how, so the code that uses it doesn't have to know.

Structural patterns

Seven ways to assemble objects into bigger structures — wrapping, adapting, sharing, and simplifying — without welding them together.

Behavioral patterns

Eleven ways for objects to divide up work and talk to each other without every one knowing about every other.

Code smells

The warning signs that a design is drifting, grouped into five families — each with a broken program to refactor until it's right.

Refactoring techniques

Small, safe, behaviour-preserving changes — the moves that turn a smell into clean code, one step at a time.

Low-level design case studies

The machine-coding and LLD rounds interviewers ask, worked end to end — requirements, entities, class diagram, key flows, a runnable skeleton, and the extensions they'll push on.

  1. How to Approach an LLD RoundA repeatable six-step method for low-level design interviews — from a vague prompt to classes, flows, and working code in under an hour.
  2. LLD: Parking LotLevels, spot sizes, tickets, and fees — the classic LLD warm-up, with spot allocation and pricing as swappable strategies.
  3. LLD: Elevator SystemSeveral cars, many floors, and a dispatcher deciding who goes where — state per car, a scheduling strategy, and a step-by-step simulation.
  4. LLD: Vending MachineCoins in, product out, change back — a textbook State-pattern design where every button means something different depending on what the machine is doing.
  5. LLD: LRU CacheO(1) get and put with least-recently-used eviction — a hash map for lookup plus a doubly linked list for recency, behind a clean cache interface.
  6. LLD: Rate LimiterAllow N requests per client per period — token bucket and sliding window as interchangeable algorithms behind one limiter interface, with a testable clock.
  7. LLD: Library Management SystemBooks versus copies, members, loans, holds, and fines — a domain-modelling exercise where getting the nouns right is most of the work.
  8. LLD: ChessBoard, pieces, moves, and turns — polymorphic pieces that know how they move, a game that knows the rules around them, and moves as objects you can undo.
  9. LLD: Expense SplitterGroups, shared expenses, equal/exact/percentage splits, net balances, and the fewest payments to settle up — split rules as strategies, money as integer cents.
  10. LLD: Movie Ticket BookingCinemas, shows, seat maps, and the hard part — holding seats for a few minutes so two people can never buy the same one.
  11. LLD: Logging FrameworkLoggers, levels, handlers, and formatters — a small framework that shows Singleton, Chain of Responsibility, Strategy, and Observer working together.