← All items

Foundations

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

10 items 10 Foundational

Low-level design interviews assume you can speak OOP fluently and draw UML on a whiteboard without thinking about syntax. The Foundations topic covers the small set of ideas that make every later topic make sense: encapsulation, abstraction, inheritance, polymorphism, generalization, and the four UML diagrams (use case, class, sequence, activity) that you'll actually use in an interview.

Most candidates skip this layer because they 'already know' OOP. The result is class diagrams with the wrong arrowhead, sequence diagrams that conflate synchronous and asynchronous calls, and use-case diagrams that show classes instead of actors. The interviewer notices.

Key concepts

  • Encapsulation hides state; abstraction hides complexity — they're different and both matter
  • Composition over inheritance is the default; deep inheritance hierarchies are an interview smell
  • A class diagram is the single most important LLD artefact — sequence and activity are supplements
  • Use cases describe actors and intent, not classes or methods
  • UML is a communication tool, not a specification language — be ready to adapt notation to the interview

Reference template

// The 45-minute LLD round, structured
1. Clarify scope            (5 min — what's in, what's out)
2. Identify entities         (5 min — nouns become candidate classes)
3. Draw the class diagram    (15 min — relationships first, attributes second)
4. Narrate one key flow      (10 min — sequence diagram for the headline use case)
5. Implement a critical class (5 min — code one core class on the board)
6. Defend trade-offs         (5 min — interviewer drills the design)

Adapt to your problem; the structure is the load-bearing part.

Common pitfalls

  • Drawing the class diagram before clarifying scope — you'll model the wrong thing
  • Confusing aggregation vs composition arrows on the class diagram
  • Showing all attributes and methods — strip to what's essential for the conversation
  • Skipping the sequence diagram and trying to explain dynamic behaviour from a class diagram alone

Related topics

Items (10)

  • 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
Search ESC

Keyboard shortcuts

Shortcuts are disabled while typing in inputs.