Low-Level Design cheat sheet
- The LLD Interview Framework: How design and machine-coding rounds are run and scored, and a repeatable approach.
- OOP Fundamentals in Java: Encapsulation, abstraction, inheritance, polymorphism — and interfaces, equality and immutability.
- Class Relationships & UML: Association, aggregation, composition, dependency and inheritance — and drawing them.
- SOLID Principles: Five principles with violations, fixes and the trade-offs of over-applying them.
- Core Design Principles: Encapsulate what varies, program to interfaces, composition over inheritance, DRY, KISS, YAGNI and more.
- Singleton: One instance, thread-safe initialisation, and why it is often an anti-pattern.
- Factory Method & Abstract Factory: Decoupling creation from use: simple factory, factory method and families of products.
- Builder: Constructing complex, valid, immutable objects step by step.
- Prototype: Creating objects by cloning, deep vs shallow copies and prototype registries.
- Adapter: Making incompatible interfaces work together — object vs class adapters.
- Decorator: Adding behaviour by wrapping, without subclass explosions.
- Facade: A simple front door to a complex subsystem.
- Proxy: Controlling access: lazy, protection, remote, caching and logging proxies.
- Composite: Treating trees of objects and single objects uniformly.
- Bridge: Splitting two dimensions of variation into independent hierarchies.
- Flyweight: Sharing intrinsic state to support huge numbers of small objects.
- Strategy: Interchangeable algorithms behind one interface.
- Observer: Publish–subscribe inside a process, and its pitfalls.
- State: Behaviour that changes with internal state — the backbone of many machine-coding problems.
- Command: Requests as objects: queues, undo/redo, macros and audit logs.
- Chain of Responsibility: Passing a request along a chain of handlers.
- Template Method: A fixed algorithm skeleton with overridable steps.
- Iterator: Traversing collections without exposing their internals.
- Mediator: Replacing a web of object-to-object calls with a hub.
- Memento: Snapshots for undo without breaking encapsulation.
- Visitor: Adding operations to a stable class hierarchy via double dispatch.
- Concurrency for LLD: Race conditions, locks, atomics, concurrent collections and producer–consumer in Java.
- Writing Interview-Grade Code: Modelling, validation, exceptions, immutability, testability and common anti-patterns.
- Code Smells & Refactoring: Recognising smells and removing them with small, safe, named refactorings — with a verified worked example.
- Schema Design for LLD: Mapping classes to tables, invariants as constraints, indexes from queries, and concurrency in SQL.
- Machine-Coding Walkthrough: Snake & Ladder: A minute-by-minute 90-minute round: scoping, design, code by minute 40, tests and extensions.
- Design a Parking Lot: Spots, vehicles, tickets, pricing strategies and concurrent allocation.
- Design a Vending Machine: The State pattern end to end: coins, selection, dispensing and refunds.
- Design an Elevator System: Requests, scheduling strategies, and a controller for multiple cars.
- Design Tic-Tac-Toe: Board, players, O(1) win detection and an extensible game loop.
- Design an LRU Cache: HashMap + doubly linked list, generic and thread-safe.
- Design a Logging Framework: Levels, appenders, formatters and async logging.
- Design a Library Management System: Catalog, members, loans, reservations and fines.
- Design an In-Memory File System: Composite tree, path resolution, cycle-safe moves, visitors and locking.
- Design a Key-Value Store with Transactions: Nested transactions, optimistic concurrency, versions, tombstones and TTL.
- Design Splitwise: Expenses, split strategies, balances and debt simplification.
- Design a Movie Ticket Booking System: Shows, seat locking with expiry, and payments.
- Design Chess: Pieces, move validation, special moves and game state.
- Design a Rate Limiter (LLD): Pluggable algorithms, per-key buckets and thread safety.
- Design an ATM: State machine, cash dispensing chain and bank integration.
- Design a Pub-Sub Message Broker: Topics, subscribers, offsets, and concurrent delivery.
- Design a Job Scheduler: Time-ordered queue, a dispatcher that sleeps until due, fixed rate vs delay, retries and cancellation.
- Design a Notification Service: Channels, templates, preferences, quiet hours, priority, dedup, failover and dead letters.
- Design a Cab Booking System: Spatial index, atomic driver claims, ride lifecycle and surge pricing.
- Design a Food Delivery System: Single-restaurant cart, coupons, order state machine, limited stock and partners.
- Design a Hotel Booking System: Half-open date ranges, O(log n) availability, per-room locks and per-night pricing.
- Design a Digital Wallet: Double-entry ledger, idempotent transfers, ordered locking, limits and refunds.
- Choosing & Comparing Patterns: Problem-to-pattern mapping and the comparisons interviewers ask about.
- LLD Cheat Sheet: Principles, patterns, concurrency tools and case-study one-liners on one page.