Low-level design (LLD)

Learn to design classes the way LLD interview rounds expect. Read and draw class diagrams, apply SOLID and the few patterns that matter, then walk through parking lot, elevator, vending machine and Splitwise designs step by step, with C# code for each.

7 chapters4 case studies29 practice questions
Open the courseChapters, a study plan and timed practice exams.

Chapters

  1. 1. Reading and drawing class diagrams 20 min

    The small subset of UML you need for low-level design interviews: classes, interfaces, and the six relationships between them, each with the C# it turns into.

    • Read a class box: name, fields and methods with visibility.
    • Tell inheritance, implementation, composition, aggregation, association and dependency apart.
    • Turn a diagram into C# and C# into a diagram.
  2. 2. How to approach an LLD interview 15 min

    A repeatable 45-minute plan: clarify, find the nouns and verbs, draw the classes, assign responsibilities, pick patterns only where they help, then write the core code.

    • Run a low-level design round in a clear order.
    • Turn requirements into classes using nouns and verbs.
    • Know what interviewers score: clean responsibilities, extensibility, and working code.
  3. 3. Patterns that keep coming up 25 min

    Strategy, Observer, State, Factory and Singleton, each drawn as a class diagram with the problem it solves in LLD case studies.

    • Recognise when a pattern actually fits a requirement.
    • Draw Strategy, Observer and State from memory.
    • Know the risks of Singleton and the C# alternative.
  4. 4. Case study: parking lot 30 min

    The classic LLD question: levels, spot sizes, tickets, fees and gates, with a thread-safe way to assign spots.

    • Model spots, vehicles, tickets and fees with clear owners.
    • Match vehicles to spot sizes without type checks everywhere.
    • Prevent two cars getting the same spot.
  5. 5. Case study: elevator system 30 min

    Several cars, hall and cabin requests, a dispatcher that picks the best car, and a car that serves stops in its current direction.

    • Separate dispatching from moving a single car.
    • Model direction and door state cleanly.
    • Explain the scheduling rule and its trade-offs.
  6. 6. Case study: vending machine 25 min

    The State pattern in action: idle, has money, dispensing and sold out, with inventory and change handled by their own classes.

    • Replace status switches with state classes.
    • Keep inventory and payment separate from state logic.
    • Handle invalid actions in every state.
  7. 7. Case study: expense sharing (Splitwise) 30 min

    Users, groups and expenses with equal, exact and percentage splits, balances between pairs, and simplifying who pays whom.

    • Model split types with Strategy.
    • Keep balances in a structure that is easy to update and query.
    • Explain debt simplification.