A comprehensive collection of production-grade Low Level Design (LLD) implementations in Java. This repository serves as a reference for clean code, SOLID principles, and common architectural patterns used in building robust, scalable systems.
This repository contains multiple versions and variations of common LLD problems, including simplified "standard" versions and more advanced "coaching" implementations.
| Project | Key Patterns | Documentation |
|---|---|---|
| Amazon Locker System | Strategy, State, Facade | Standard | Advanced |
| Chess Game | Strategy, Template Method, Facade | Detailed Design |
| Coffee Shop | Decorator, Builder, Validator | Detailed Design |
| Elevator System | State Machine, Dispatcher, Singleton | Standard | Advanced |
| LRU Cache | Doubly Linked List + HashMap | Detailed Design |
| Parking Lot | Strategy, Factory, State | Standard | Advanced |
| Rate Limiter | Strategy, Token Bucket, Fixed Window | Detailed Design |
| SplitWise | Strategy, Balance Sheet, Greedy Settlement | Detailed Design |
| Unix FIND | Composite, Chain of Responsibility | Detailed Design |
Across all implementations, the following principles are strictly followed to ensure maintainability and extensibility:
| Principle | Description |
|---|---|
| SOLID | Ensuring single responsibility, open/closed designs, and interface segregation. |
| Strategy Pattern | Used for swappable algorithms (e.g., pricing, allocation, rate limiting). |
| Facade Pattern | Providing simple interfaces to complex subsystems (e.g., LockerSystem, ElevatorController). |
| State Pattern | Managing complex object lifecycles (e.g., Elevator status, Locker availability). |
| Composite Pattern | Building hierarchical structures (e.g., Unix Find filters). |
Each project is located in its own directory and can be explored independently.
Most projects are standard Java or Maven-based. To run a project:
-
Navigate to the directory:
cd <Project_Directory>
-
Run via Maven (if applicable):
mvn compile exec:java -Dexec.mainClass="org.example.Main" -
Or run the
DriverorMainclass directly using your IDE (IntelliJ IDEA, Eclipse, etc.).
- Language: Java 17+
- Build Tool: Maven (where applicable)
- Design Philosophy: Object-Oriented Design (OOD)