Notes / tag / low-level-design

#low-level-design

115 notes

1 — What is Low-Level Design?

How Low-Level Design differs from High-Level Design, where it sits in the software development lifecycle, and the criteria MAANG interviewers actually use to evaluate it.

low-level-design foundations-of-object-oriented-design book

2 — Object-Oriented Programming Refresher

A fast recap of the four OOP pillars — encapsulation, abstraction, inheritance, and polymorphism — plus the composition-over-inheritance tradeoff the rest of this book leans on.

low-level-design foundations-of-object-oriented-design book

3 — Relationships Between Objects

The association, aggregation, composition, and dependency relationships objects can hold with each other, grounded in real-world examples.

low-level-design foundations-of-object-oriented-design book

4 — Object Lifecycle

How an object comes into existence and who owns it — creation, memory allocation, constructors, factory-based creation, and ownership semantics.

low-level-design foundations-of-object-oriented-design book

1 — SOLID Principles

The five SOLID principles — Single Responsibility through Dependency Inversion — as the baseline design discipline every LLD interview answer gets measured against.

low-level-design object-oriented-design-principles book

2 — GRASP Principles

The nine GRASP patterns — Information Expert, Creator, Controller, Low Coupling, High Cohesion, and more — for assigning responsibility to the right class.

low-level-design object-oriented-design-principles book

3 — OO Design Heuristics

Practical heuristics beyond SOLID and GRASP — favoring composition, programming to interfaces, the Law of Demeter, Tell Don't Ask, and Command Query Separation.

low-level-design object-oriented-design-principles book

4 — Clean Code

The clean-code habits — naming, small methods, spotting code smells, and refactoring for readability — that keep a well-principled design from decaying in practice.

low-level-design object-oriented-design-principles book

1 — UML Fundamentals

The UML notation vocabulary — classes, interfaces, relationships, visibility, and multiplicity — needed to read or draw any diagram in this Part.

low-level-design uml-and-modeling book

2 — Class Diagrams

How class diagrams capture a design's static structure — classes, attributes, methods, and the relationships between them — before any code gets written.

low-level-design uml-and-modeling book

3 — Sequence Diagrams

How sequence diagrams trace the message flow between objects over time to check that a design actually satisfies a use case.

low-level-design uml-and-modeling book

4 — State Diagrams

How state diagrams model an object's lifecycle as a finite set of states and transitions, useful for anything with a status field.

low-level-design uml-and-modeling book

5 — Activity Diagrams

How activity diagrams map the control flow and branching logic of a workflow or business process, independent of any single class.

low-level-design uml-and-modeling book

6 — Object Diagrams

How object diagrams snapshot a specific set of instances and their links at a point in time, useful for validating a class diagram against a concrete scenario.

low-level-design uml-and-modeling book

7 — Package Diagrams

How package diagrams organize classes into higher-level modules and show the dependencies between them, the tool for reasoning about a design's overall structure.

low-level-design uml-and-modeling book

1 — Introduction to Design Patterns

What a design pattern actually is, why the Gang-of-Four catalog still matters in interviews, and how to recognize which category a problem is asking for.

low-level-design design-patterns book

2 — Creational Patterns

The five creational patterns — Singleton, Factory Method, Abstract Factory, Builder, and Prototype — for controlling how and when objects get created.

low-level-design design-patterns book

3 — Structural Patterns

The seven structural patterns — Adapter, Bridge, Composite, Decorator, Facade, Flyweight, and Proxy — for composing classes and objects into larger structures.

low-level-design design-patterns book

4 — Behavioral Patterns

The eleven behavioral patterns — from Strategy and Observer through Visitor and Interpreter — for managing communication and responsibility between objects.

low-level-design design-patterns book

5 — Pattern Selection Guide

A decision framework for picking the right pattern under interview pressure — when to reach for one, when it's overkill, and the trade-offs behind each choice.

low-level-design design-patterns book

1 — Dependency Injection

Compares constructor, setter, and interface injection as ways to supply an object's dependencies from outside itself rather than constructing them internally.

low-level-design dependency-management book

2 — Inversion of Control

Explains how inverting control of object creation and lifecycle from application code to a framework or container reshapes dependency flow in a design.

low-level-design dependency-management book

3 — Service Locator vs DI

Contrasts the service locator pattern with dependency injection, weighing hidden dependency lookups against explicit, visible constructor contracts.

low-level-design dependency-management book

4 — Object Factories

Covers factory patterns that encapsulate object construction logic and decouple it from the code that consumes the resulting objects.

low-level-design dependency-management book

1 — Exception Design

Looks at how to design exception hierarchies and error-signaling contracts so that failures are informative and recoverable rather than opaque.

low-level-design error-handling-and-reliability book

2 — Validation Strategies

Surveys strategies for validating input and state at system boundaries versus deep within business logic, and where each belongs.

low-level-design error-handling-and-reliability book

3 — Defensive Programming

Examines defensive programming techniques for guarding against invalid state and unexpected input without over-defending against impossible cases.

low-level-design error-handling-and-reliability book

4 — Immutability

Explains how immutable objects eliminate mutation after construction, closing off a whole class of concurrency and state-corruption bugs.

low-level-design error-handling-and-reliability book

5 — Value Objects

Introduces value objects as small, immutable types defined by their attributes rather than identity, and where they should replace bare primitives.

low-level-design error-handling-and-reliability book

1 — Thread Safety

Defines what it means for a class or method to be thread-safe and the correctness guarantees a design must uphold under concurrent access.

low-level-design concurrency-design book

2 — Synchronization

Covers synchronization mechanisms that coordinate access to shared mutable state across multiple threads.

low-level-design concurrency-design book

3 — Locks

Examines lock types — mutexes, read-write locks, reentrant locks — and the tradeoffs each makes between safety and throughput.

low-level-design concurrency-design book

4 — Concurrent Collections

Surveys concurrent collection types designed for safe multi-threaded access without requiring external locking by the caller.

low-level-design concurrency-design book

5 — Producer Consumer

Walks through the producer-consumer pattern for decoupling work generation from work processing via a shared bounded queue.

low-level-design concurrency-design book

6 — Thread Pools

Explains thread pool design for bounding concurrency and reusing worker threads instead of spawning a new thread per task.

low-level-design concurrency-design book

7 — Deadlocks

Analyzes how deadlocks arise from circular resource dependencies among threads and the design practices that prevent them.

low-level-design concurrency-design book

8 — Race Conditions

Examines how race conditions emerge from unsynchronized access to shared mutable state and how a design can eliminate them.

low-level-design concurrency-design book

9 — Lock-Free Design

Introduces lock-free and wait-free design techniques that use atomic operations instead of locks to coordinate concurrent access.

low-level-design concurrency-design book

1 — Identifying Entities

Covers how to identify entities in a domain model — objects with a persistent identity that spans changes to their attributes over time.

low-level-design domain-modeling book

2 — Value Objects

Revisits value objects in the context of domain modeling, where they capture descriptive attributes of an entity without carrying identity of their own.

low-level-design domain-modeling book

3 — Aggregates

Explains aggregates as consistency boundaries that group entities and value objects behind a single root for transactional integrity.

low-level-design domain-modeling book

4 — Domain Services

Covers domain services for modeling operations that don't naturally belong to any single entity or value object in the model.

low-level-design domain-modeling book

5 — Repositories

Introduces the repository pattern for abstracting aggregate persistence and retrieval behind a collection-like interface.

low-level-design domain-modeling book

6 — Domain Events

Explains domain events as a way to capture and propagate significant state changes within a domain model to other parts of a system.

low-level-design domain-modeling book

1 — Interface Design

Defines how a service's public surface is shaped so consumers depend on a stable contract rather than on internal implementation details.

low-level-design api-oriented-design book

2 — DTOs

Explains why data transfer objects decouple wire formats from domain models, so internal refactors don't ripple into API consumers.

low-level-design api-oriented-design book

3 — Validation Layers

Distinguishes syntactic, semantic, and business-rule validation so each concern is enforced at the layer best suited to catch it.

low-level-design api-oriented-design book

4 — Mapping Objects

Covers translating between domain models and DTOs at the API boundary without leaking persistence details or business logic across it.

low-level-design api-oriented-design book

5 — Pagination

Compares offset-based and cursor-based pagination strategies and how each behaves under concurrent writes and large result sets.

low-level-design api-oriented-design book

6 — Error Responses

Defines a consistent error response shape and status-code taxonomy so API consumers can handle failures programmatically rather than by parsing prose.

low-level-design api-oriented-design book

1 — Unit Testing

Covers writing isolated, fast, deterministic tests that verify a single unit of behavior without touching external dependencies.

low-level-design testing-design book

2 — Testable Design

Explains how explicit dependency boundaries and small units of behavior make code inherently easier to exercise in isolation.

low-level-design testing-design book

3 — Mocking

Covers using test doubles to isolate the unit under test from collaborators that are slow, external, or nondeterministic.

low-level-design testing-design book

4 — Dependency Injection for Testing

Explains how injecting dependencies rather than constructing them internally lets tests substitute fakes without touching production code.

low-level-design testing-design book

5 — Contract Testing

Covers verifying that a producer and consumer agree on an API or message contract without standing up the full integration.

low-level-design testing-design book

1 — Refactoring Techniques

Surveys the catalog of small, behavior-preserving transformations used to improve code structure without changing external behavior.

low-level-design refactoring book

2 — Identifying Code Smells

Covers recognizing structural warning signs — long methods, feature envy, shotgun surgery — that signal a refactor is due before the design breaks down.

low-level-design refactoring book

3 — Replace Conditional with Polymorphism

Explains replacing branching type-checks with polymorphic dispatch so new cases extend the code rather than modify a growing switch statement.

low-level-design refactoring book

4 — Extract Object

Covers pulling a cohesive group of fields and behavior out of a bloated class into a new, focused collaborator.

low-level-design refactoring book

5 — Introduce Parameter Object

Explains grouping a repeated cluster of parameters into a single object to reduce signature churn and clarify caller intent.

low-level-design refactoring book

6 — Builder Refactoring

Covers migrating a telescoping constructor or setter-heavy object into a builder that enforces a valid construction order.

low-level-design refactoring book

1 — Parking Lot

Models a multi-level parking lot with heterogeneous vehicle and spot types, exercising strategy-based spot allocation and a clean split between lot, floor, and spot entities.

low-level-design classic-lld-interview-problems book

10 — ATM

Models an ATM's cash withdrawal, deposit, and balance-inquiry flows, exercising the state pattern across card-inserted, PIN-entry, and transaction states plus the greedy cash-dispensing algorithm.

low-level-design classic-lld-interview-problems book

11 — Vending Machine

Models a vending machine's product inventory, coin/payment handling, and dispensing logic, exercising the state pattern across idle, selection, payment, and dispense states.

low-level-design classic-lld-interview-problems book

12 — Coffee Machine

Models a coffee machine with multiple beverage recipes and shared ingredient inventories, exercising the recipe/ingredient composition model and low-stock/refill handling.

low-level-design classic-lld-interview-problems book

13 — Cricbuzz

Models live cricket match scoring, commentary, and scorecards, exercising the observer pattern for pushing real-time score updates to subscribed clients.

low-level-design classic-lld-interview-problems book

14 — Amazon Locker

Models a package-locker system for deliveries and pickups, exercising locker-size-to-package-size allocation strategy and the notification flow for one-time pickup codes.

low-level-design classic-lld-interview-problems book

15 — Cab Booking

Models a ride-hailing service matching riders to nearby drivers, exercising the driver-matching/dispatch strategy and dynamic surge-pricing calculation.

low-level-design classic-lld-interview-problems book

16 — Food Delivery

Models restaurants, menus, orders, and delivery-partner assignment for a food-delivery platform, exercising order-state-machine design and partner-assignment strategy.

low-level-design classic-lld-interview-problems book

17 — Notification Service

Models a multi-channel notification system spanning email, SMS, and push, exercising the strategy pattern for channel selection and template-based message rendering.

low-level-design classic-lld-interview-problems book

18 — Cache (LRU/LFU)

Implements an in-memory cache with fixed capacity, exercising O(1) get/put eviction design via a hash map paired with a doubly linked list for LRU or frequency buckets for LFU.

low-level-design classic-lld-interview-problems book

19 — Rate Limiter

Designs an API rate limiter enforcing per-client request quotas, exercising the tradeoffs between token-bucket, sliding-window, and fixed-window algorithms.

low-level-design classic-lld-interview-problems book

2 — Elevator System

Designs a multi-elevator dispatch system for a building, exercising the SCAN/LOOK scheduling algorithm choice and the state machine governing elevator direction and door control.

low-level-design classic-lld-interview-problems book

20 — Logging Framework

Designs a pluggable logging library with configurable levels, formatters, and appenders, exercising the chain-of-responsibility pattern for log-level filtering and multi-destination output.

low-level-design classic-lld-interview-problems book

21 — File System

Models a hierarchical in-memory file system with files and directories, exercising the composite pattern for uniform file/directory traversal and path resolution.

low-level-design classic-lld-interview-problems book

22 — Linux `find`

Implements a simplified version of the Unix find command over a directory tree, exercising predicate composition for filter chaining by name, type, size, and depth during traversal.

low-level-design classic-lld-interview-problems book

23 — Kafka-like Queue

Models a simplified publish-subscribe message queue with partitions and consumer groups, exercising partition-assignment strategy and offset-tracking for at-least-once delivery.

low-level-design classic-lld-interview-problems book

24 — Pub/Sub System

Models a generic publish-subscribe messaging system decoupling publishers from subscribers, exercising the observer pattern and topic-based routing/fan-out design.

low-level-design classic-lld-interview-problems book

3 — Library Management System

Models book catalog, members, and lending/reservation workflows for a library, exercising due-date and fine-calculation logic and the relationship between books, copies, and holds.

low-level-design classic-lld-interview-problems book

4 — Hotel Booking System

Models room inventory, reservations, and pricing across a hotel chain, exercising availability search and overlapping-date conflict resolution for bookings.

low-level-design classic-lld-interview-problems book

5 — Movie Ticket Booking

Models cinemas, shows, and seat inventory for booking movie tickets, exercising the concurrent seat-locking strategy needed to prevent double booking during checkout.

low-level-design classic-lld-interview-problems book

6 — Splitwise

Models shared expenses and running balances among a group of users, exercising the debt-simplification algorithm that minimizes the number of settlement transactions.

low-level-design classic-lld-interview-problems book

7 — Snake and Ladder

Models the classic board game with dice, snakes, and ladders for multiple players, exercising the board's jump-mapping design and the turn-based game-loop control flow.

low-level-design classic-lld-interview-problems book

8 — Chess

Models a full chess board, pieces, and move validation, exercising the polymorphic per-piece move-rule design and check/checkmate detection.

low-level-design classic-lld-interview-problems book

9 — Tic Tac Toe

Models a simple two-player grid game, exercising win-condition detection and a pluggable player strategy for human versus AI opponents.

low-level-design classic-lld-interview-problems book

1 — Hexagonal Architecture

Isolates core domain logic behind ports and adapters so infrastructure choices like databases or messaging can be swapped without touching business rules.

low-level-design advanced-object-oriented-design book

2 — Clean Architecture

Layers a system into entities, use cases, interface adapters, and frameworks so dependencies always point inward toward stable business rules.

low-level-design advanced-object-oriented-design book

3 — Domain-Driven Design Essentials

Introduces bounded contexts, aggregates, and ubiquitous language as the core tools for modeling complex business domains in code.

low-level-design advanced-object-oriented-design book

4 — Event-Driven Design

Decouples components by having them communicate through published events rather than direct calls, trading immediate consistency for looser coupling.

low-level-design advanced-object-oriented-design book

5 — CQRS Basics

Splits read and write models into separate paths so each can be optimized and scaled independently instead of sharing one general-purpose model.

low-level-design advanced-object-oriented-design book

6 — Event Sourcing Basics

Persists state as an append-only log of domain events rather than the current snapshot, letting past state be reconstructed by replay.

low-level-design advanced-object-oriented-design book

7 — Plug-in Architectures

Defines a stable extension point contract so third-party or optional modules can be discovered and loaded without modifying the host application.

low-level-design advanced-object-oriented-design book

8 — Extensible Framework Design

Covers the inversion-of-control hooks, template methods, and configuration surfaces that let a framework be extended by consumers without forking it.

low-level-design advanced-object-oriented-design book

1 — Memory Optimization

Examines how object layout, field ordering, and reference graphs drive per-instance memory footprint and garbage collector pressure.

low-level-design performance-oriented-design book

2 — Object Pooling

Reuses a fixed set of expensive-to-construct objects instead of allocating and discarding them, trading extra bookkeeping for reduced allocation churn.

low-level-design performance-oriented-design book

3 — Lazy Initialization

Defers construction of a costly resource until its first actual use, at the cost of added complexity around thread safety and null checks.

low-level-design performance-oriented-design book

4 — Caching Strategies

Compares eviction policies, invalidation triggers, and cache placement so repeated lookups can be served without recomputation or a round trip.

low-level-design performance-oriented-design book

5 — Efficient Collections

Matches collection data structures to their access patterns so lookup, insertion, and iteration costs stay aligned with the workload's actual shape.

low-level-design performance-oriented-design book

6 — Profiling Object-Oriented Applications

Walks through using profilers to locate hot paths and allocation hotspots in object-oriented code before applying any optimization technique.

low-level-design performance-oriented-design book

1 — LLD Interview Framework

Walks through the repeatable ten-step LLD interview sequence, from clarifying requirements through naming trade-offs, that anchors every chapter in this Part.

low-level-design maang-interview-masterclass book

2 — Communicating During LLD Interviews

Covers how to narrate design decisions out loud during an LLD interview so the interviewer can follow the reasoning, not just the diagram.

low-level-design maang-interview-masterclass book

3 — Whiteboard Design Techniques

Covers layout and sequencing techniques for sketching classes, relationships, and flows on a whiteboard (or shared doc) under interview time pressure.

low-level-design maang-interview-masterclass book

4 — Common Interview Mistakes

Catalogs the recurring LLD interview failure modes — jumping to code too early, over-engineering, skipping requirement clarification — and how to avoid them.

low-level-design maang-interview-masterclass book

5 — Time Management in 45–60 Minute Interviews

Breaks a 45–60 minute LLD interview into timed phases so requirement clarification, design, and coding each get a fair share of the clock.

low-level-design maang-interview-masterclass book

6 — Complete Mock Interview Walkthroughs

Presents full end-to-end mock LLD interview transcripts, applying the Chapter 1 framework against representative interview prompts.

low-level-design maang-interview-masterclass book

1 — Appendix A: UML Cheat Sheet

Quick-reference summary of UML notation — class, sequence, and relationship symbols — for fast lookup while sketching an LLD design.

low-level-design appendices book

2 — Appendix B: SOLID & GRASP Cheat Sheet

Quick-reference summary of the five SOLID principles and the GRASP responsibility-assignment patterns, condensed for interview recall.

low-level-design appendices book

3 — Appendix C: Design Pattern Decision Matrix

Cross-references common design problems against candidate GoF patterns so the right pattern can be picked quickly instead of pattern-matched from memory.

low-level-design appendices book

4 — Appendix D: LLD Interview Checklist

A pre-interview and in-interview checklist condensing the Chapter 1 framework into a single pass/fail list to run through before finishing.

low-level-design appendices book

5 — Appendix E: Java Implementation Guidelines

Language-specific guidance for translating an LLD whiteboard design into idiomatic Java — interfaces, access modifiers, and collection choices.

low-level-design appendices book

6 — Appendix F: C# Implementation Guidelines

Language-specific guidance for translating an LLD whiteboard design into idiomatic C# — properties, interfaces, and access modifiers.

low-level-design appendices book

7 — Appendix G: C++ Implementation Guidelines

Language-specific guidance for translating an LLD whiteboard design into idiomatic C++ — ownership semantics, virtual dispatch, and RAII.

low-level-design appendices book

8 — Appendix H: Go Implementation Guidelines

Language-specific guidance for translating an LLD whiteboard design into idiomatic Go — implicit interfaces, composition over inheritance, and goroutine-safe state.

low-level-design appendices book

9 — Appendix I: Python Implementation Guidelines

Language-specific guidance for translating an LLD whiteboard design into idiomatic Python — duck typing, ABCs, and dataclass-based value objects.

low-level-design appendices book

Low-Level Design for MAANG Interviews

A book-shaped table of contents for LLD interview prep: OOP fundamentals through SOLID, design principles, UML, design patterns, dependency management, reliability, concurrency, domain modeling, API design, testing, refactoring, classic interview problems, advanced architecture, and performance — cross-linking Object-Oriented Programming and Patterns instead of duplicating them.

low-level-design book reference maang-prep