Low Level Design

54 items across OOP foundations (encapsulation / abstraction / inheritance / polymorphism + UML), SOLID principles, the Gang-of-Four design patterns, worked OOD interview case studies (Parking Lot, Elevator, ATM, Chess, Hotel, LinkedIn, and more), and open design exercises. Each kind follows a consistent H2 template so writeups are scannable across topics.

26 Foundational 21 Intermediate 7 Advanced 5 topics RSS

Foundations

10 items

Object-oriented programming fundamentals — the four pillars, OOAD, and the UML diagrams every LLD interview will ask you to draw.

  • OOP Fundamentals — The Four Pillars

    Encapsulation, abstraction, inheritance, polymorphism. The vocabulary every LLD interview assumes you have internalised.

    Concept Foundational
  • Encapsulation

    Hiding internal state behind a public API. Why fields are private, why getters/setters are not always the answer.

    Concept Foundational
  • Abstraction

    Modelling a concept as the minimum set of operations a caller needs. Where interfaces beat concrete classes, and where they don't.

    Concept Foundational
  • Inheritance and Generalization

    is-a relationships, the hierarchy taxonomy, when to prefer composition over inheritance.

    Concept Foundational
  • Polymorphism

    Compile-time (overloading) vs run-time (overriding) dispatch. Why polymorphic code beats switch-statements.

    Concept Foundational
  • OOAD and UML — Overview

    Object-Oriented Analysis and Design, the role of UML, when each diagram type pays off, the bottom-up approach to interviews.

    Concept Foundational
  • Use Case Diagrams

    Actors, use cases, system boundary, include/extend relationships — and the right level of detail for an interview.

    Concept Foundational
  • Class Diagrams

    Classes, attributes, methods, associations, aggregation, composition, inheritance, multiplicities — the workhorse OOD diagram.

    Concept Foundational
  • Sequence Diagrams

    Objects, lifelines, synchronous vs asynchronous messages, activation bars. Communicating dynamic behaviour in interviews.

    Concept Foundational
  • Activity Diagrams

    Workflow modelling — initial node, actions, decisions, forks/joins, final node. When activity beats sequence.

    Concept Foundational

Five design principles that guide good OOD — Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, Dependency Inversion.

Design Patterns

15 items

The canonical Gang-of-Four patterns — creational, structural, behavioral — that show up in every LLD interview.

  • Singleton Pattern

    One instance, global access point. The threading caveats, the why-everyone-says-don't, and when it's still right.

    Pattern Foundational
  • Factory Method Pattern

    Defer instantiation to a method subclasses override. The seam between knowing what to make and knowing how to make it.

    Pattern Foundational
  • Abstract Factory Pattern

    Families of related objects without specifying concrete classes. When one factory isn't enough.

    Pattern Intermediate
  • Builder Pattern

    Step-by-step construction of complex objects, fluent API, telescoping-constructor problem solved.

    Pattern Foundational
  • Prototype Pattern

    Clone an existing object instead of constructing from scratch. Shallow vs deep copy and when each is correct.

    Pattern Intermediate
  • Adapter Pattern

    Make incompatible interfaces work together. Object adapter vs class adapter, and the legacy-integration use case.

    Pattern Foundational
  • Decorator Pattern

    Wrap an object to add behaviour without subclassing. The classic IO-stream example and how to avoid wrapper explosion.

    Pattern Intermediate
  • Facade Pattern

    A single entry point hiding a complex subsystem. The architectural cost of skipping it.

    Pattern Foundational
  • Composite Pattern

    Treat individual objects and compositions uniformly. The recursive tree-of-things pattern that shows up everywhere.

    Pattern Intermediate
  • Strategy Pattern

    Encapsulate interchangeable algorithms behind a common interface. The dual of the Open-Closed Principle in practice.

    Pattern Foundational
  • Observer Pattern

    Publish-subscribe for objects. Push vs pull, the leaky-listener problem, and modern event-bus alternatives.

    Pattern Foundational
  • State Pattern

    An object's behaviour changes with its internal state — represented as a class hierarchy. The state-machine pattern in disguise.

    Pattern Intermediate
  • Command Pattern

    Encapsulate a request as an object. Undo, queue, log, and macro — all fall out of this one structure.

    Pattern Intermediate
  • Template Method Pattern

    Define the skeleton of an algorithm in a base class and let subclasses fill in the steps. The hollywood principle illustrated.

    Pattern Intermediate
  • Architectural Design Patterns — Overview

    MVC, MVVM, layered, microservices, event-driven, hexagonal. The patterns that organise whole systems, not just classes.

    Concept Intermediate

Case Studies

21 items

Worked OOD interview problems — Parking Lot, Elevator, ATM, Chess, Hotel, LinkedIn, and more. Each one demonstrates a class of design decisions.

  • Parking Lot

    The canonical OOD interview problem. Multi-floor lot, spot types, tickets, payment. The first hour of every LLD prep.

    System Foundational
  • Elevator System

    Single and multi-elevator scheduling, request handling, state machine, edge cases (maintenance mode, emergency stop).

    System Intermediate
  • Library Management System

    Books, members, borrowing/returning, reservations, fines. The classic CRUD-plus-rules domain model.

    System Foundational
  • Amazon Locker Service

    Locker assignment, package lifecycle, OTP-based pickup, expiry, capacity planning across sizes.

    System Intermediate
  • Vending Machine

    State-pattern showcase — idle, selection, payment, dispense. Coin and bill handling, refund flow.

    System Foundational
  • Meeting Scheduler

    Calendar, rooms, attendees, conflicts, recurring events. Where availability search meets booking integrity.

    System Intermediate
  • Movie Ticket Booking System

    Theatres, shows, seats, holds, payment, concurrent booking. The seat-lock race condition every candidate misses.

    System Intermediate
  • ATM System

    Card, PIN, account, transaction, cash dispenser, hardware abstraction. State machine plus banking ops.

    System Foundational
  • Chess Game

    Board, pieces, moves, rules engine, check/checkmate, game state. Polymorphism over piece behaviour.

    System Intermediate
  • Hotel Management System

    Rooms, room types, reservations, check-in/out, billing, housekeeping. A multi-actor domain done right.

    System Intermediate
  • Amazon Online Shopping System

    Catalogue, cart, order, payment, inventory, shipping. The end-to-end e-commerce domain in one OOD.

    System Advanced
  • Online Blackjack Game

    Player, dealer, deck, hand, round. State machine on the round and a Strategy for dealer policy — the cleanest cards-game OOD.

    System Intermediate
  • Car Rental System

    Fleets, reservations, pickup/return, insurance, billing. State machine on the rental and a Strategy for tiered pricing.

    System Intermediate
  • Stack Overflow

    Questions, answers, votes, comments, badges, tags. Reputation as derived state; moderation as a workflow.

    System Advanced
  • Restaurant Management System

    Tables, reservations, orders, menu, bill, waiter, chef. Order state machine plus table-assignment Strategy.

    System Intermediate
  • Facebook

    Users, friendships, posts, reactions, comments, groups, pages. Friendship state machine plus Observer for notifications.

    System Advanced
  • Online Stock Brokerage System

    Accounts, portfolios, market/limit/stop orders, matching, transactions. Order state plus price-time matching strategy.

    System Advanced
  • Jigsaw Puzzle

    Puzzle, piece, solver. The lightest case study — focus is the class model and a recursive backtracking solver.

    System Foundational
  • Airline Management System

    Aircraft, flights, schedules, crew, bookings, seats, itineraries. Multi-aggregate transactional design at scale.

    System Advanced
  • ESPNcricinfo

    Tournaments, matches, innings, overs, balls, scorecards. Ball-by-ball event stream plus Observer for live-score subscribers.

    System Advanced
  • LinkedIn

    Profiles, connections, feed, messaging, search. Social-graph mechanics expressed as an object model.

    System Advanced

Meta-tips for the OOD round plus open-ended design exercises — ride-sharing and food-delivery prompts that mirror real interview asks.

  • Approaching the OOD Interview

    The 45-minute structure: clarify scope, identify entities, draw the class diagram, narrate a flow, defend trade-offs. The meta-script.

    Exercise Foundational
  • Design a Ride-Sharing System

    Open-ended exercise — riders, drivers, matching, pricing, surge, trip lifecycle. Scope it like a real interview.

    Exercise Intermediate
  • Design a Food Delivery System

    Restaurants, menus, orders, delivery agents, real-time tracking. A multi-actor design with clear failure modes to discuss.

    Exercise Intermediate
Search ESC

Keyboard shortcuts

Shortcuts are disabled while typing in inputs.