teacher
Sign in
Track

Low-Level Design

Object-oriented design in Java and C++ — principles, patterns and real machine-coding problems.

41 lessons~21 hours of lessonsTarget: Intermediate — clean answers in LLD and machine-coding roundsJava · C++
Reality check
  • Patterns are vocabulary, not goals. Forcing a pattern where it is not needed is the most common LLD mistake.
  • Interviewers judge clarity, extensibility and correctness under time pressure. Practise writing the full code in 45–60 minutes.
  • You learn design by changing code. Take each case study and add a new requirement — that is where weak designs crack.
  1. Stage 30/14

    Design patterns

    The creational, structural and behavioural patterns that appear in real code and interviews.

    1. 01SingletonGuarantee one instance of a class, build it safely under threads, and know why it is often the wrong tool.25 min
    2. 02FactoryHide which concrete class gets created behind a name or a subclass, and learn when a plain constructor is the better choice.25 min
    3. 03BuilderConstruct objects with many optional fields step by step, validate once at the end, and know when a record or plain constructor is enough.25 min
    4. 04AdapterMake a class with the wrong interface fit the one your code expects, without editing either side.20 min
    5. 05DecoratorWrap an object in another with the same interface to add behaviour such as logging, retries or caching, and stack the layers freely.25 min
    6. 06FacadePut one simple class in front of several subsystems so common jobs take one call, while the parts stay reachable.20 min
    7. 07ProxyStand in for an object with the same interface to delay its creation, check permission or hide that it lives elsewhere.20 min
    8. 08CompositeTreat a single object and a group of objects through one interface, so trees such as folders and menus need no special-case code.20 min
    9. 09StrategyPut each interchangeable algorithm behind one interface and pass it in, so behaviour can change without if-else chains.20 min
    10. 10ObserverLet many listeners subscribe to one source and be told when it changes, without the source knowing who they are.22 min
    11. 11CommandTurn an action into an object so it can be queued, logged, undone and redone, with a text editor as the worked example.25 min
    12. 12StateLet an object change its behaviour when its internal state changes by moving each state's rules into its own class.22 min
    13. 13Template MethodFix the order of an algorithm's steps in a base class and let subclasses fill in individual steps.18 min
    14. 14Chain of ResponsibilityPass a request along a linked list of handlers until one deals with it, so the sender does not need to know which one.20 min
  2. Stage 50/16

    Case studies

    Complete machine-coding problems, from requirements to working code.

    1. 01LLD Interview FrameworkA repeatable five-step routine for LLD and machine-coding rounds, from a vague prompt to working, extensible code.25 min
    2. 02Parking LotDesign a multi-level parking lot with spot allocation, tickets and pluggable fee rules, in Java and C++.40 min
    3. 03Elevator SystemModel several elevators with a sorted stop set, a sweep-style movement rule and a swappable dispatcher.40 min
    4. 04Vending MachineModel a vending machine with the State pattern so each state owns its own behaviour and transitions.40 min
    5. 05LRU CacheBuild a fixed-size cache that evicts the least recently used entry, with O(1) get and put.35 min
    6. 06BookMyShowDesign a movie ticket booking system around seat locks with expiry, all-or-nothing selection and safe concurrent booking.45 min
    7. 07SplitwiseDesign an expense-sharing app with pluggable split strategies, exact money arithmetic and a debt-simplification step.45 min
    8. 08Rate LimiterDesign a per-client rate limiter with pluggable algorithms (token bucket, fixed window, sliding log) and a testable clock.40 min
    9. 09Tic-Tac-ToeDesign a tic-tac-toe game for any board size, with an O(1) winning check per move that uses line counters.35 min
    10. 10Snake and LadderDesign a snake and ladder game with a pluggable dice, a jump map for snakes and ladders, and a players queue.35 min
    11. 11ChessDesign a chess game with polymorphic pieces, move validation, turn handling and check, checkmate and stalemate detection.50 min
    12. 12Library Management SystemDesign a library with books and physical copies, members, loans, reservations, fines and search, with clear rules for each.45 min
    13. 13ATMDesign an ATM with the State pattern for the card session and a chain of responsibility that picks which notes to dispense.50 min
    14. 14Hotel BookingDesign a hotel booking system with date-range overlap checks, a pricing strategy and a cancellation refund policy.45 min
    15. 15Logging FrameworkDesign a small logging library with levels, a chain of handlers, pluggable appenders and formatters, and a singleton logger.45 min
    16. 16Order Matching EngineDesign the core of a stock exchange, a limit order book that matches buy and sell orders by price then arrival time.50 min