From 114e5b20067b360a55e46601abb3c218ccdca5a4 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 5 Jun 2025 19:56:25 +0000 Subject: [PATCH] Create comprehensive Markdown documentation This commit introduces a new `DOCUMENTATION.md` file to serve as a comprehensive, beginner-friendly guide to the repository. Key changes include: 1. **Created `DOCUMENTATION.md`**: A new central documentation file. 2. **Quick Start Guide**: Added a section to help you navigate the documentation and repository structure. 3. **Design Patterns Documentation**: * General introduction to design patterns. * Categorized into Creational, Structural, and Behavioral patterns. * Listed implemented patterns for each supported language (Javascript, C++, C#, Go, Java, Python) with links to code examples. 4. **OOP Concepts Documentation**: * Explanation of core OOP principles (Abstraction, Encapsulation, Inheritance, Polymorphism). * Listed implemented/explained OOP concepts for each language with links to relevant READMEs. * Included other related concepts like Classes/Objects, Interfaces, Association, Aggregation, and Composition. 5. **Problems and Solutions Documentation**: * Listed all available problem statements from the `problems/` directory. * Provided links to solutions for each problem, organized by language, pointing to their respective READMEs in the `solutions/` directory. 6. **Learning Checklist/Roadmap**: Added a suggested learning path through OOP concepts and design patterns, including estimated times and difficulty indicators. 7. **General Information**: * Added a "Contributing" section with guidelines for new contributions. * Added a "License" section referencing the existing GPLv3 license. 8. **Updated `README.md`**: Added a prominent link in the main `README.md` pointing to the new `DOCUMENTATION.md` file for improved discoverability. This new documentation aims to make the repository more accessible and easier to learn from, especially for you if you are new to software design principles and patterns. --- DOCUMENTATION.md | 758 +++++++++++++++++++++++++++++++++++++++++++++++ README.md | 8 + 2 files changed, 766 insertions(+) create mode 100644 DOCUMENTATION.md diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md new file mode 100644 index 00000000..a5ccfc9d --- /dev/null +++ b/DOCUMENTATION.md @@ -0,0 +1,758 @@ +# Welcome to the Software Design and Engineering Hub! + +This repository is a comprehensive resource for learning about software design patterns, object-oriented programming (OOP) principles, and common software engineering problems with their solutions. Our goal is to provide clear, beginner-friendly explanations and practical examples in various programming languages. + +## Quick Start Guide + +This documentation is designed to help you navigate the repository and learn effectively. Here’s how to get started: + +1. **Understand the Structure:** The repository is organized into three main sections: + * [**Design Patterns**](#design-patterns): Learn about reusable solutions to common software design problems. + * [**Object-Oriented Programming (OOP) Concepts**](#object-oriented-programming-oop-concepts): Grasp the fundamental principles of OOP. + * [**Problems and Solutions**](#problems-and-solutions): Explore common software engineering problems and their example solutions. + +2. **Choose Your Learning Path:** + * If you're new to software design, we recommend starting with the [OOP Concepts](#object-oriented-programming-oop-concepts) section, then moving to [Design Patterns](#design-patterns). + * If you're looking for solutions to specific problems, head to the [Problems and Solutions](#problems-and-solutions) section. + +3. **Navigate by Language:** Most concepts and patterns are demonstrated in multiple programming languages. You can find language-specific examples within each section. + +4. **Use the Learning Aids:** Each topic includes: + * Simplified explanations. + * Links to relevant code examples. + * Estimated time commitments. + * Difficulty indicators. + +## Table of Contents + +* [Design Patterns](#design-patterns) + * [Creational Patterns](#creational-patterns) + * [Structural Patterns](#structural-patterns) + * [Behavioral Patterns](#behavioral-patterns) +* [Object-Oriented Programming (OOP) Concepts](#object-oriented-programming-oop-concepts) + * [Abstraction](#abstraction) + * [Encapsulation](#encapsulation) + * [Inheritance](#inheritance) + * [Polymorphism](#polymorphism) +* [Problems and Solutions](#problems-and-solutions) +* [Learning Checklist/Roadmap](#learning-checklistroadmap) +* [Contributing](#contributing) +* [License](#license) + +Let's start learning! +## Design Patterns + +πŸ“– **Difficulty**: Varies | ⏱️ **Estimated Time**: 2-5 hours per pattern category + +Design patterns are reusable, well-tested solutions to commonly occurring problems within a given context in software design. They are not specific algorithms or code but rather general concepts or templates that can be implemented in various ways depending on the programming language and the specific problem. + +**Why are Design Patterns Important?** + +* **Promote Reusability**: They provide proven solutions, saving time and effort. +* **Improve Code Readability and Maintainability**: Using standard patterns makes code easier to understand for developers familiar with them. +* **Provide a Common Language**: Developers can communicate more efficiently by referring to well-known patterns. +* **Offer Well-Tested Solutions**: Patterns have often been used and refined over time, leading to more robust applications. + +This section is organized into the three main categories of design patterns: + +* [Creational Patterns](#creational-patterns) +* [Structural Patterns](#structural-patterns) +* [Behavioral Patterns](#behavioral-patterns) + +--- + +### Creational Patterns + +Creational patterns deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. The basic form of object creation could result in design problems or added complexity to the design. Creational design patterns solve this problem by somehow controlling this object creation. + +#### Javascript +* **Abstract Factory**: Provides an interface for creating families of related or dependent objects without specifying their concrete classes. ([View Code](design-patterns/Javascript/Creational%20Pattern/AbstractFactory%20Design%20Pattern/)) +* **Builder**: Separates the construction of a complex object from its representation, allowing the same construction process to create various representations. ([View Code](design-patterns/Javascript/Creational%20Pattern/Builder%20Design%20Pattern/)) +* **Factory Method**: Defines an interface for creating an object, but lets subclasses alter the type of objects that will be created. ([View Code](design-patterns/Javascript/Creational%20Pattern/Factory%20Design%20Pattern/)) +* **Prototype**: Specifies the kinds of objects to create using a prototypical instance, and creates new objects by copying this prototype. ([View Code](design-patterns/Javascript/Creational%20Pattern/Prototype%20Design%20Pattern/)) +* **Singleton**: Ensures a class only has one instance, and provides a global point of access to it. ([View Code](design-patterns/Javascript/Creational%20Pattern/Singleton%20Design%20Pattern/)) + +#### C++ +* **Builder**: Separates the construction of a complex object from its representation. ([View Code](design-patterns/cpp/builder/)) +* **Factory Method**: Defines an interface for creating an object, but lets subclasses decide which class to instantiate. ([View Code](design-patterns/cpp/factory/)) +* **Prototype**: Creates new objects by copying an existing object, known as the prototype. ([View Code](design-patterns/cpp/prototype/)) +* **Singleton**: Ensures a class has only one instance and provides a global point of access to it. ([View Code](design-patterns/cpp/singleton/)) + +#### C# +* **Builder**: Separates the construction of a complex object from its representation. ([View Code](design-patterns/csharp/builder/)) +* **Factory Method**: Defines an interface for creating an object, but lets subclasses alter the type of objects that will be created. ([View Code](design-patterns/csharp/factory/)) +* **Singleton**: Ensures a class only has one instance, and provides a global point of access to it. ([View Code](design-patterns/csharp/singleton/)) + +#### Go +* **Builder**: Separates the construction of a complex object from its representation. ([View Code](design-patterns/golang/builder/)) +* **Factory Method**: Defines an interface for creating an object, but lets subclasses decide which class to instantiate. ([View Code](design-patterns/golang/factory/)) +* **Singleton**: Ensures a class has only one instance and provides a global point of access to it. ([View Code](design-patterns/golang/singleton/)) +* **Prototype**: Creates new objects by copying an existing object. ([View Code](design-patterns/golang/prototype/)) + + +#### Java +* **Abstract Factory**: Provides an interface for creating families of related or dependent objects without specifying their concrete classes. ([View Code](design-patterns/java/abstractfactory/shoefactory/) and [View Code](design-patterns/java/abstractfactory/)) +* **Builder**: Separates the construction of a complex object from its representation. ([View Code](design-patterns/java/builder/)) +* **Factory Method**: Defines an interface for creating an object, but lets subclasses alter the type of objects that will be created. ([View Code](design-patterns/java/factory/subscription/) and [View Code](design-patterns/java/factory/)) +* **Prototype**: Specifies the kinds of objects to create using a prototypical instance. ([View Code](design-patterns/java/prototype/)) +* **Singleton**: Ensures a class only has one instance, and provides a global point of access to it. ([View Code](design-patterns/java/singleton/)) + +#### Python +* **Abstract Factory**: Provides an interface for creating families of related or dependent objects. ([View Code](design-patterns/python/abstractfactory/)) +* **Builder**: Separates object construction from its representation. ([View Code](design-patterns/python/builder/)) +* **Factory Method**: Defines an interface for creating objects, but lets subclasses decide which class to instantiate. ([View Code](design-patterns/python/factory/)) +* **Prototype**: Creates new objects by copying an existing object. ([View Code](design-patterns/python/prototype/)) +* **Singleton**: Ensures a class has only one instance and provides a global access point. ([View Code](design-patterns/python/singleton/)) + +--- + +### Structural Patterns + +Structural patterns are concerned with how classes and objects can be composed to form larger structures. They simplify the structure by identifying relationships between them. + +#### Javascript +* **Adapter**: Allows objects with incompatible interfaces to collaborate. ([View Code](design-patterns/Javascript/Structural%20Pattern/Adapter%20Design%20Pattern/)) +* **Bridge**: Decouples an abstraction from its implementation so that the two can vary independently. ([View Code](design-patterns/Javascript/Structural%20Pattern/Bridge%20Design%20Pattern/)) +* **Composite**: Composes objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly. ([View Code](design-patterns/Javascript/Structural%20Pattern/Composite%20Design%20Pattern/)) +* **Decorator**: Attaches additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality. ([View Code](design-patterns/Javascript/Structural%20Pattern/Decorator%20Design%20Pattern/)) +* **Facade**: Provides a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use. ([View Code](design-patterns/Javascript/Structural%20Pattern/Facade%20Design%20Pattern/)) +* **Flyweight**: Uses sharing to support large numbers of fine-grained objects efficiently. ([View Code](design-patterns/Javascript/Structural%20Pattern/Flyweight%20Design%20Pattern/)) +* **Proxy**: Provides a surrogate or placeholder for another object to control access to it. ([View Code](design-patterns/Javascript/Structural%20Pattern/Proxy%20Design%20Pattern/)) + +#### C++ +* **Adapter**: Allows objects with incompatible interfaces to work together. ([View Code](design-patterns/cpp/adapter/)) +* **Bridge**: Decouples an abstraction from its implementation. ([View Code](design-patterns/cpp/bridge/)) +* **Composite**: Composes objects into tree structures. ([View Code](design-patterns/cpp/composite/)) +* **Decorator**: Adds new functionality to an object dynamically. ([View Code](design-patterns/cpp/decorator/)) +* **Facade**: Provides a simplified interface to a complex subsystem. ([View Code](design-patterns/cpp/facade/)) +* **Flyweight**: Minimizes memory usage by sharing common parts of state between multiple objects. ([View Code](design-patterns/cpp/flyweight/)) +* **Proxy**: Provides a placeholder for another object to control access to it. ([View Code](design-patterns/cpp/proxy/)) + +#### C# +* **Adapter**: Allows objects with incompatible interfaces to collaborate. ([View Code](design-patterns/csharp/adapter/)) +* **Bridge**: Decouples an abstraction from its implementation. ([View Code](design-patterns/csharp/bridge/)) +* **Composite**: Composes objects into tree structures. ([View Code](design-patterns/csharp/composite/)) +* **Decorator**: Attaches additional responsibilities to an object dynamically. ([View Code](design-patterns/csharp/decorator/)) +* **Facade**: Provides a unified interface to a set of interfaces in a subsystem. ([View Code](design-patterns/csharp/facade/)) +* **Flyweight**: Uses sharing to support large numbers of fine-grained objects efficiently. ([View Code](design-patterns/csharp/flyweight/)) +* **Proxy**: Provides a surrogate or placeholder for another object to control access to it. ([View Code](design-patterns/csharp/proxy/)) + +#### Go +* **Adapter**: Allows objects with incompatible interfaces to work together. ([View Code](design-patterns/golang/adapter/)) +* **Bridge**: Decouples an abstraction from its implementation. ([View Code](design-patterns/golang/bridge/)) +* **Composite**: Composes objects into tree structures. ([View Code](design-patterns/golang/composite/)) +* **Decorator**: Adds new functionality to an object dynamically. ([View Code](design-patterns/golang/decorator/)) +* **Facade**: Provides a simplified interface to a complex subsystem. ([View Code](design-patterns/golang/facade/)) +* **Flyweight**: Minimizes memory usage by sharing common parts of state. ([View Code](design-patterns/golang/flyweight/)) +* **Proxy**: Provides a placeholder for another object to control access to it. ([View Code](design-patterns/golang/proxy/)) + +#### Java +* **Adapter**: Allows objects with incompatible interfaces to collaborate. ([View Code](design-patterns/java/adapter/)) +* **Bridge**: Decouples an abstraction from its implementation so that the two can vary independently. ([View Code](design-patterns/java/bridge/)) +* **Composite**: Composes objects into tree structures to represent part-whole hierarchies. ([View Code](design-patterns/java/composite/filesystem/) and [View Code](design-patterns/java/composite/organization/)) +* **Decorator**: Attaches additional responsibilities to an object dynamically. ([View Code](design-patterns/java/decorator/coffee/) and [View Code](design-patterns/java/decorator/)) +* **Facade**: Provides a unified interface to a set of interfaces in a subsystem. ([View Code](design-patterns/java/facade/)) +* **Flyweight**: Uses sharing to support large numbers of fine-grained objects efficiently. ([View Code](design-patterns/java/flyweight/)) +* **Proxy**: Provides a surrogate or placeholder for another object to control access to it. ([View Code](design-patterns/java/proxy/)) + +#### Python +* **Adapter**: Allows objects with incompatible interfaces to collaborate. ([View Code](design-patterns/python/adapter/)) +* **Bridge**: Decouples an abstraction from its implementation. ([View Code](design-patterns/python/bridge/)) +* **Composite**: Composes objects into tree structures. ([View Code](design-patterns/python/composite/filesystem/) and [View Code](design-patterns/python/composite/organization/)) +* **Decorator**: Adds new functionality to an object dynamically. ([View Code](design-patterns/python/decorator/)) +* **Facade**: Provides a simplified interface to a complex subsystem. ([View Code](design-patterns/python/facade/)) +* **Flyweight**: Minimizes memory usage by sharing common data among multiple objects. ([View Code](design-patterns/python/flyweight/)) +* **Proxy**: Provides a placeholder for another object to control access to it. ([View Code](design-patterns/python/proxy/)) + +--- + +### Behavioral Patterns + +Behavioral patterns are concerned with algorithms and the assignment of responsibilities between objects. They describe not just patterns of objects or classes but also the patterns of communication between them. + +#### Javascript +* **Chain of Responsibility**: Avoids coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. ([View Code](design-patterns/Javascript/Behavioral%20Pattern/Chain%20of%20Responsibilites/)) +* **Command**: Encapsulates a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations. ([View Code](design-patterns/Javascript/Behavioral%20Pattern/Command%20Design%20Pattern/)) +* **Iterator**: Provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation. ([View Code](design-patterns/Javascript/Behavioral%20Pattern/Iterator%20Design%20Pattern/)) +* **Mediator**: Defines an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly. ([View Code](design-patterns/Javascript/Behavioral%20Pattern/Mediator%20Design%20Pattern/)) +* **Memento**: Without violating encapsulation, captures and externalizes an object's internal state so that the object can be restored to this state later. ([View Code](design-patterns/Javascript/Behavioral%20Pattern/Memento%20Design%20Pattern/)) +* **Observer**: Defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. ([View Code](design-patterns/Javascript/Behavioral%20Pattern/Observer%20Design%20Pattern/)) +* **State**: Allows an object to alter its behavior when its internal state changes. The object will appear to change its class. ([View Code](design-patterns/Javascript/Behavioral%20Pattern/State%20Design%20Pattern/)) +* **Strategy**: Defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it. ([View Code](design-patterns/Javascript/Behavioral%20Pattern/Strategy%20Design%20Pattern/)) +* **Template Method**: Defines the skeleton of an algorithm in an operation, deferring some steps to subclasses. ([View Code](design-patterns/Javascript/Behavioral%20Pattern/Template%20Design%20Pattern/)) +* **Visitor**: Represents an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates. ([View Code](design-patterns/Javascript/Behavioral%20Pattern/Visitor%20Design%20Pattern/)) + +#### C++ +* **Chain of Responsibility**: Passes a request along a chain of handlers. ([View Code](design-patterns/cpp/chainofresponsibility/)) +* **Iterator**: Provides a way to access elements of a collection sequentially. ([View Code](design-patterns/cpp/iterator/)) +* **Mediator**: Defines an object that centralizes communication between other objects. ([View Code](design-patterns/cpp/mediator/)) +* **Memento**: Captures and restores an object's internal state. ([View Code](design-patterns/cpp/memento/)) +* **Observer**: Allows objects to subscribe and receive updates when another object's state changes. ([View Code](design-patterns/cpp/observer/)) +* **State**: Allows an object to alter its behavior when its internal state changes. ([View Code](design-patterns/cpp/state/)) +* **Strategy**: Defines a family of algorithms, encapsulates each one, and makes them interchangeable. ([View Code](design-patterns/cpp/strategy/)) +* **Template Method**: Defines the skeleton of an algorithm in a method, deferring some steps to subclasses. ([View Code](design-patterns/cpp/templatemethod/)) + +#### C# +* **Chain of Responsibility**: Avoids coupling the sender of a request to its receiver by giving multiple objects a chance to handle the request. ([View Code](design-patterns/csharp/chainofresponsibility/)) +* **Iterator**: Provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation. ([View Code](design-patterns/csharp/iterator/)) +* **Mediator**: Defines an object that encapsulates how a set of objects interact. ([View Code](design-patterns/csharp/mediator/)) +* **Memento**: Without violating encapsulation, captures and externalizes an object's internal state. ([View Code](design-patterns/csharp/memento/)) +* **Observer**: Defines a one-to-many dependency between objects. ([View Code](design-patterns/csharp/observer/)) +* **State**: Allows an object to alter its behavior when its internal state changes. ([View Code](design-patterns/csharp/state/)) +* **Strategy**: Defines a family of algorithms, encapsulates each one, and makes them interchangeable. ([View Code](design-patterns/csharp/strategy/)) +* **Template Method**: Defines the skeleton of an algorithm in an operation, deferring some steps to subclasses. ([View Code](design-patterns/csharp/templatemethod/)) + +#### Go +* **Chain of Responsibility**: Passes a request along a chain of handlers. ([View Code](design-patterns/golang/chainofresponsibility/)) +* **Iterator**: Provides a way to access elements of a collection sequentially. ([View Code](design-patterns/golang/iterator/)) +* **Mediator**: Defines an object that centralizes communication. ([View Code](design-patterns/golang/mediator/)) +* **Memento**: Captures and restores an object's internal state. ([View Code](design-patterns/golang/memento/)) +* **Observer**: Allows objects to subscribe to state changes. ([View Code](design-patterns/golang/observer/)) +* **State**: Allows an object to alter its behavior when its internal state changes. ([View Code](design-patterns/golang/state/)) +* **Strategy**: Defines a family of algorithms and makes them interchangeable. ([View Code](design-patterns/golang/strategy/)) +* **Template Method**: Defines an algorithm skeleton in a method, deferring steps to subclasses. ([View Code](design-patterns/golang/templatemethod/)) + +#### Java +* **Chain of Responsibility**: Avoids coupling the sender of a request to its receiver by giving multiple objects a chance to handle the request. ([View Code](design-patterns/java/chainofresponsibility/)) +* **Command**: Encapsulates a request as an object. ([View Code](design-patterns/java/command/)) +* **Iterator**: Provides a way to access the elements of an aggregate object sequentially. ([View Code](design-patterns/java/iterator/books/) and [View Code](design-patterns/java/iterator/)) +* **Mediator**: Defines an object that encapsulates how a set of objects interact. ([View Code](design-patterns/java/mediator/)) +* **Memento**: Captures and externalizes an object's internal state so it can be restored later. ([View Code](design-patterns/java/memento/)) +* **Observer**: Defines a one-to-many dependency between objects. ([View Code](design-patterns/java/observer/)) +* **State**: Allows an object to alter its behavior when its internal state changes. ([View Code](design-patterns/java/state/)) +* **Strategy**: Defines a family of algorithms, encapsulates each one, and makes them interchangeable. ([View Code](design-patterns/java/strategy/)) +* **Template Method**: Defines the skeleton of an algorithm in an operation, deferring some steps to subclasses. ([View Code](design-patterns/java/templatemethod/)) +* **Visitor**: Represents an operation to be performed on elements of an object structure. ([View Code](design-patterns/java/visitor/)) + +#### Python +* **Chain of Responsibility**: Passes a request along a chain of handlers. ([View Code](design-patterns/python/chainofresponsibility/)) +* **Command**: Encapsulates a request as an object. ([View Code](design-patterns/python/command/)) +* **Iterator**: Provides sequential access to elements of a collection. ([View Code](design-patterns/python/iterator/)) +* **Mediator**: Defines an object that centralizes communication between objects. ([View Code](design-patterns/python/mediator/)) +* **Memento**: Captures and restores an object's internal state. ([View Code](design-patterns/python/memento/)) +* **Observer**: Allows objects to subscribe to state changes in another object. ([View Code](design-patterns/python/observer/)) +* **State**: Allows an object to change its behavior when its internal state changes. ([View Code](design-patterns/python/state/)) +* **Strategy**: Defines a family of algorithms and makes them interchangeable. ([View Code](design-patterns/python/strategy/)) +* **Template Method**: Defines an algorithm's skeleton in a method, deferring steps to subclasses. ([View Code](design-patterns/python/templatemethod/)) +* **Visitor**: Represents an operation to be performed on elements of an object structure. ([View Code](design-patterns/python/visitor/)) + +--- +## Object-Oriented Programming (OOP) Concepts + +πŸ’‘ **Difficulty**: Beginner to Intermediate | ⏱️ **Estimated Time**: 1-2 hours per concept + +Object-Oriented Programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data in the form of fields (often known as attributes or properties) and code in the form of procedures (often known as methods). A key feature of objects is that an object's own procedures can access and often modify the data fields of itself. + +**Core Principles of OOP:** + +* **Abstraction**: Hiding complex implementation details and showing only the essential features of the object. +* **Encapsulation**: Bundling data (attributes) and methods that operate on the data into a single unit or class. It restricts direct access to some of an object's components. +* **Inheritance**: A mechanism where a new class (subclass or derived class) inherits properties and behavior (methods) from an existing class (superclass or base class). This promotes code reuse. +* **Polymorphism**: The ability of an object to take on many forms. It allows methods to do different things based on the object it is acting upon, even if they share the same name. + +This section provides explanations and examples for these core OOP principles in various programming languages. Each concept has a `README.md` within its respective language directory that provides more detailed explanations and code examples. + +--- + +### Abstraction + +Abstraction means displaying only essential information and hiding the details. It helps to manage complexity by focusing on what an object does instead of how it does it. + +* **C++**: ([View Readme](oop/cpp/abstraction/README.md)) - Learn how C++ achieves abstraction through abstract classes and access specifiers. +* **C#**: ([View Readme](oop/csharp/abstraction/README.md)) - Explore abstraction using abstract classes, interfaces, and access modifiers in C#. +* **Go**: ([View Readme](oop/golang/abstraction/README.md)) - Understand how Go implements abstraction using interfaces. +* **Java**: ([View Readme](oop/java/abstraction/README.md)) - Discover abstraction in Java through abstract classes and interfaces. +* **Python**: ([View Readme](oop/python/abstraction/README.md)) - See abstraction in Python using abstract base classes (ABCs) and duck typing. + +--- + +### Encapsulation + +Encapsulation is the bundling of data (attributes) and the methods that operate on that data into a single unit called a class. It restricts direct access to some of an object's components, which is a means of preventing unintended interference and misuse of the methods and data. + +* **C++**: ([View Readme](oop/cpp/encapsulation/README.md)) - Understand encapsulation in C++ using access specifiers (public, private, protected). +* **C#**: ([View Readme](oop/csharp/encapsulation/README.md)) - Learn about encapsulation in C# through properties and access modifiers. +* **Go**: ([View Readme](oop/golang/encapsulation/README.md)) - Discover how Go achieves encapsulation through exported and unexported identifiers (using capitalization). +* **Java**: ([View Readme](oop/java/encapsulation/README.md)) - Explore encapsulation in Java using access modifiers (public, private, protected, default) and getter/setter methods. +* **Python**: ([View Readme](oop/python/encapsulation/README.md)) - See how Python implements encapsulation using name mangling (private members) and properties. + +--- + +### Inheritance + +Inheritance is a fundamental OOP concept where a new class (derived or child class) acquires the properties and behaviors (methods) of an existing class (base or parent class). This promotes code reusability and establishes a relationship between classes. + +* **C++**: ([View Readme](oop/cpp/inheritance/README.md)) - Learn about different types of inheritance (single, multiple, multilevel, hierarchical, hybrid) in C++. +* **C#**: ([View Readme](oop/csharp/inheritance/README.md)) - Explore inheritance in C#, including single inheritance and interface implementation. +* **Go**: ([View Readme](oop/golang/inheritance/README.md)) - Understand how Go achieves similar results to inheritance through embedding (composition). +* **Java**: ([View Readme](oop/java/inheritance/README.md)) - Discover inheritance in Java, including single and multilevel inheritance, and the use of the `extends` keyword. +* **Python**: ([View Readme](oop/python/inheritance/README.md)) - See how Python supports various forms of inheritance, including multiple inheritance. + +--- + +### Polymorphism + +Polymorphism (from Greek, meaning "many forms") allows objects of different classes to respond to the same message (method call) in different ways. This is typically achieved through method overriding (runtime polymorphism) and method overloading (compile-time polymorphism, where supported). + +* **C++**: ([View Readme](oop/cpp/polymorphism/README.md)) - Explore runtime polymorphism using virtual functions and compile-time polymorphism through function overloading and templates. +* **C#**: ([View Readme](oop/csharp/polymorphism/README.md)) - Learn about runtime polymorphism with virtual and override keywords, and compile-time polymorphism via method overloading. +* **Go**: ([View Readme](oop/golang/polymorphism/README.md)) - Understand how Go achieves polymorphism through interfaces. +* **Java**: ([View Readme](oop/java/polymorphism/README.md)) - Discover runtime polymorphism using method overriding and compile-time polymorphism through method overloading. +* **Python**: ([View Readme](oop/python/polymorphism/README.md)) - See polymorphism in Python through duck typing and method overriding. + +--- + +**Other Related OOP Concepts:** + +While the four principles above are core, this repository also touches upon other related concepts like: + +* **Classes and Objects**: The fundamental building blocks. + * C++: ([View Readme](oop/cpp/classesandobjects/README.md)) + * C#: ([View Readme](oop/csharp/classesandobjects/README.md)) + * Go: ([View Readme](oop/golang/classesandobjects/README.md)) (Structs and methods) + * Java: ([View Readme](oop/java/classesandobjects/README.md)) + * Python: ([View Readme](oop/python/classesandobjects/README.md)) +* **Interfaces**: Defining a contract for classes. + * C++: ([View Readme](oop/cpp/interfaces/README.md)) (Achieved through abstract classes with pure virtual functions) + * C#: ([View Readme](oop/csharp/interfaces/README.md)) + * Go: ([View Readme](oop/golang/interfaces/README.md)) + * Java: ([View Readme](oop/java/interfaces/README.md)) + * Python: ([View Readme](oop/python/interfaces/README.md)) (Often using Abstract Base Classes - ABCs) +* **Association**: A relationship where one object uses or interacts with another. + * C++: ([View Readme](oop/cpp/association/README.md)) + * C#: ([View Readme](oop/csharp/association/README.md)) + * Go: ([View Readme](oop/golang/association/README.md)) + * Java: ([View Readme](oop/java/association/README.md)) + * Python: ([View Readme](oop/python/association/README.md)) +* **Aggregation**: A specialized form of association representing a "has-a" relationship, where the lifetime of the contained class is independent of the container class. + * C++: ([View Readme](oop/cpp/aggregation/README.md)) + * C#: ([View Readme](oop/csharp/aggregation/README.md)) + * Go: ([View Readme](oop/golang/aggregation/README.md)) + * Java: ([View Readme](oop/java/aggregation/README.md)) + * Python: ([View Readme](oop/python/aggregation/README.md)) +* **Composition**: A strong type of association where the contained class is part of the container class, and its lifetime is dependent on the container. + * C++: ([View Readme](oop/cpp/composition/README.md)) + * C#: ([View Readme](oop/csharp/composition/README.md)) + * Go: ([View Readme](oop/golang/composition/README.md)) + * Java: ([View Readme](oop/java/composition/README.md)) + * Python: ([View Readme](oop/python/composition/README.md)) + +--- +## Problems and Solutions + +🧩 **Difficulty**: Intermediate to Advanced | ⏱️ **Estimated Time**: 2-6 hours per problem + +This section presents a collection of common software engineering and system design problems. For each problem, we provide: + +* A detailed problem statement (`.md` file in the `problems/` directory). +* Example solutions implemented in various programming languages (found in the `solutions/` directory, organized by language and then by problem name). + +These are excellent for practicing your design skills and understanding how to apply OOP principles and design patterns to real-world scenarios. Each solution usually has its own `README.md` explaining the approach taken. + +**General Approach to Using This Section:** + +1. **Pick a Problem**: Browse the list of [Available Problem Statements](#available-problem-statements) and choose one that interests you. +2. **Understand the Requirements**: Read the problem statement carefully. Try to design a solution on your own first. +3. **Review the Solution(s)**: Explore the provided solutions in your preferred language(s). + * Pay attention to the classes, relationships, and patterns used. + * Compare it with your own approach. +4. **Learn and Iterate**: Understand the trade-offs made in the provided solution. + +--- + +### Available Problem Statements + +* [Airline Management System](problems/airline-management-system.md) +* [ATM](problems/atm.md) +* [Car Rental System](problems/car-rental-system.md) +* [Chess Game](problems/chess-game.md) +* [Coffee Vending Machine](problems/coffee-vending-machine.md) +* [Concert Ticket Booking System](problems/concert-ticket-booking-system.md) +* [Course Registration System](problems/course-registration-system.md) +* [Cricinfo](problems/cricinfo.md) +* [Digital Wallet Service](problems/digital-wallet-service.md) +* [Elevator System](problems/elevator-system.md) +* [Food Delivery Service](problems/food-delivery-service.md) +* [Hotel Management System](problems/hotel-management-system.md) +* [Library Management System](problems/library-management-system.md) +* [LinkedIn](problems/linkedin.md) +* [Logging Framework](problems/logging-framework.md) +* [LRU Cache](problems/lru-cache.md) +* [Movie Ticket Booking System](problems/movie-ticket-booking-system.md) +* [Music Streaming Service](problems/music-streaming-service.md) +* [Online Auction System](problems/online-auction-system.md) +* [Online Shopping Service](problems/online-shopping-service.md) +* [Online Stock Brokerage System](problems/online-stock-brokerage-system.md) +* [Parking Lot](problems/parking-lot.md) +* [Pub-Sub System](problems/pub-sub-system.md) +* [Restaurant Management System](problems/restaurant-management-system.md) +* [Ride-Sharing Service](problems/ride-sharing-service.md) +* [Snake and Ladder Game](problems/snake-and-ladder.md) +* [Social Networking Service](problems/social-networking-service.md) +* [Splitwise](problems/splitwise.md) +* [Stack Overflow](problems/stack-overflow.md) +* [Task Management System](problems/task-management-system.md) +* [Tic-Tac-Toe](problems/tic-tac-toe.md) +* [Traffic Signal System](problems/traffic-signal.md) +* [Vending Machine](problems/vending-machine.md) + +--- + +### Solutions by Language + +#### C++ + +* **Airline Management System**: ([View Solution](solutions/cpp/airlinemanagementsystem/README.md)) +* **ATM**: ([View Solution](solutions/cpp/atm/README.md)) +* **Car Rental System**: ([View Solution](solutions/cpp/carrentalsystem/README.md)) +* **Chess Game**: ([View Solution](solutions/cpp/chessgame/README.md)) +* **Coffee Vending Machine**: ([View Solution](solutions/cpp/coffeevendingmachine/README.md)) +* **Concert Ticket Booking System**: ([View Solution](solutions/cpp/concertticketbookingsystem/README.md)) +* **Course Registration System**: ([View Solution](solutions/cpp/courseregistrationsystem/README.md)) +* **Cricinfo**: ([View Solution](solutions/cpp/cricinfo/README.md)) +* **Digital Wallet Service**: ([View Solution](solutions/cpp/digitalwalletservice/README.md)) +* **Elevator System**: ([View Solution](solutions/cpp/elevatorsystem/README.md)) +* **Food Delivery Service**: ([View Solution](solutions/cpp/fooddeliveryservice/README.md)) +* **Hotel Management System**: ([View Solution](solutions/cpp/hotelmanagementsystem/README.md)) +* **Library Management System**: ([View Solution](solutions/cpp/librarymanagementsystem/README.md)) +* **LinkedIn**: ([View Solution](solutions/cpp/linkedin/README.md)) +* **Logging Framework**: ([View Solution](solutions/cpp/loggingframework/README.md)) +* **LRU Cache**: ([View Solution](solutions/cpp/lrucache/README.md)) +* **Movie Ticket Booking System**: ([View Solution](solutions/cpp/movieticketbookingsystem/README.md)) +* **Music Streaming Service**: ([View Solution](solutions/cpp/musicstreamingservice/README.md)) +* **Online Auction System**: ([View Solution](solutions/cpp/onlineauctionsystem/README.md)) +* **Online Shopping Service**: ([View Solution](solutions/cpp/onlineshoppingservice/README.md)) +* **Online Stock Brokerage System**: ([View Solution](solutions/cpp/onlinestockbrokeragesystem/README.md)) +* **Parking Lot**: ([View Solution](solutions/cpp/parkinglot/README.md)) +* **Pub-Sub System**: ([View Solution](solutions/cpp/pubsubsystem/README.md)) +* **Restaurant Management System**: ([View Solution](solutions/cpp/restaurantmanagementsystem/README.md)) +* **Ride-Sharing Service**: ([View Solution](solutions/cpp/ridesharingservice/README.md)) +* **Snake and Ladder Game**: ([View Solution](solutions/cpp/snakeandladdergame/README.md)) +* **Social Networking Service**: ([View Solution](solutions/cpp/socialnetworkingservice/README.md)) +* **Splitwise**: ([View Solution](solutions/cpp/splitwise/README.md)) +* **Stack Overflow**: ([View Solution](solutions/cpp/stackoverflow/README.md)) +* **Task Management System**: ([View Solution](solutions/cpp/taskmanagementsystem/README.md)) +* **Tic-Tac-Toe**: ([View Solution](solutions/cpp/tictactoe/README.md)) +* **Traffic Signal System**: ([View Solution](solutions/cpp/trafficsignalsystem/README.md)) +* **Vending Machine**: ([View Solution](solutions/cpp/vendingmachine/README.md)) +* **Voting System**: ([View Solution](solutions/cpp/votingsystem/README.md)) + +#### C# + +* **Airline Management System**: ([View Solution](solutions/csharp/airlinemanagementsystem/README.md)) +* **ATM**: ([View Solution](solutions/csharp/atm/README.md)) +* **Car Rental System**: ([View Solution](solutions/csharp/carrentalsystem/README.md)) +* **Chess Game**: ([View Solution](solutions/csharp/chessgame/README.md)) +* **Coffee Vending Machine**: ([View Solution](solutions/csharp/coffeevendingmachine/README.md)) +* **Concert Ticket Booking System**: ([View Solution](solutions/csharp/concertticketbookingsystem/README.md)) +* **Course Registration System**: ([View Solution](solutions/csharp/courseregistrationsystem/README.md)) +* **Cricinfo**: ([View Solution](solutions/csharp/cricinfo/README.md)) +* **Digital Wallet Service**: ([View Solution](solutions/csharp/digitalwalletservice/README.md)) +* **Elevator System**: ([View Solution](solutions/csharp/elevatorsystem/README.md)) +* **Food Delivery Service**: ([View Solution](solutions/csharp/fooddeliveryservice/README.md)) +* **Hotel Management System**: ([View Solution](solutions/csharp/hotelmanagementsystem/README.md)) +* **Library Management System**: ([View Solution](solutions/csharp/librarymanagementsystem/README.md)) +* **LinkedIn**: ([View Solution](solutions/csharp/linkedIn/README.md)) +* **Logging Framework**: ([View Solution](solutions/csharp/loggingframework/README.md)) +* **LRU Cache**: ([View Solution](solutions/csharp/lrucache/README.md)) +* **Movie Ticket Booking System**: ([View Solution](solutions/csharp/movieticketbookingsystem/README.md)) +* **Music Streaming Service**: ([View Solution](solutions/csharp/musicstreamingservice/README.md)) +* **Online Auction System**: ([View Solution](solutions/csharp/onlineauctionsystem/README.md)) +* **Online Shopping Service**: ([View Solution](solutions/csharp/onlineshoppingservice/README.md)) +* **Online Stock Brokerage System**: ([View Solution](solutions/csharp/onlinestockbrokeragesystem/README.md)) +* **Parking Lot**: ([View Solution](solutions/csharp/parkinglot/README.md)) +* **Pub-Sub System**: ([View Solution](solutions/csharp/pubsubsystem/README.md)) +* **Restaurant Management System**: ([View Solution](solutions/csharp/restaurantmanagementsystem/README.md)) +* **Ride-Sharing Service**: ([View Solution](solutions/csharp/ridesharingservice/README.md)) +* **Snake and Ladder Game**: ([View Solution](solutions/csharp/snakeandladdergame/README.md)) +* **Social Networking Service**: ([View Solution](solutions/csharp/socialnetworkingservice/README.md)) +* **Splitwise**: ([View Solution](solutions/csharp/splitwise/README.md)) +* **Stack Overflow**: ([View Solution](solutions/csharp/stackoverflow/README.md)) +* **Task Management System**: ([View Solution](solutions/csharp/taskmanagementsystem/README.md)) +* **Tic-Tac-Toe**: ([View Solution](solutions/csharp/tictactoe/README.md)) +* **Traffic Signal System**: ([View Solution](solutions/csharp/trafficsignalsystem/README.md)) +* **Vending Machine**: ([View Solution](solutions/csharp/vendingmachine/README.md)) +* **Voting System**: ([View Solution](solutions/csharp/votingsystem/README.md)) + +#### Go + +* **Airline Management System**: ([View Solution](solutions/golang/airlinemanagementsystem/README.md)) +* **ATM**: ([View Solution](solutions/golang/atm/README.md)) +* **Car Rental System**: ([View Solution](solutions/golang/carrentalsystem/README.md)) +* **Chess Game**: ([View Solution](solutions/golang/chessgame/README.md)) +* **Coffee Vending Machine**: ([View Solution](solutions/golang/coffeevendingmachine/README.md)) +* **Concert Ticket Booking System**: ([View Solution](solutions/golang/concertticketbookingsystem/README.md)) +* **Course Registration System**: ([View Solution](solutions/golang/courseregistrationsystem/README.md)) +* **Cricinfo**: ([View Solution](solutions/golang/cricinfo/README.md)) +* **Digital Wallet Service**: ([View Solution](solutions/golang/digitalwalletservice/README.md)) +* **Elevator System**: ([View Solution](solutions/golang/elevatorsystem/README.md)) +* **Food Delivery Service**: ([View Solution](solutions/golang/fooddeliveryservice/README.md)) +* **Hotel Management System**: ([View Solution](solutions/golang/hotelmanagementsystem/README.md)) +* **Library Management System**: ([View Solution](solutions/golang/librarymanagementsystem/README.md)) +* **LinkedIn**: ([View Solution](solutions/golang/linkedin/README.md)) +* **Logging Framework**: ([View Solution](solutions/golang/loggingframework/README.md)) +* **LRU Cache**: ([View Solution](solutions/golang/lrucache/README.md)) +* **Movie Ticket Booking System**: ([View Solution](solutions/golang/movieticketbookingsystem/README.md)) +* **Music Streaming Service**: ([View Solution](solutions/golang/musicstreamingservice/README.md)) +* **Online Auction System**: ([View Solution](solutions/golang/onlineauctionsystem/README.md)) +* **Online Shopping Service**: ([View Solution](solutions/golang/onlineshoppingservice/README.md)) +* **Online Stock Brokerage System**: ([View Solution](solutions/golang/onlinestockbrokeragesystem/README.md)) +* **Parking Lot**: ([View Solution](solutions/golang/parkinglot/README.md)) +* **Pub-Sub System**: ([View Solution](solutions/golang/pubsubsystem/README.md)) +* **Restaurant Management System**: ([View Solution](solutions/golang/restaurantmanagementsystem/README.md)) +* **Ride-Sharing Service**: ([View Solution](solutions/golang/ridesharingservice/README.md)) +* **Snake and Ladder Game**: ([View Solution](solutions/golang/snakeandladdergame/README.md)) +* **Social Networking Service**: ([View Solution](solutions/golang/socialnetworkingservice/README.md)) +* **Splitwise**: ([View Solution](solutions/golang/splitwise/README.md)) +* **Stack Overflow**: ([View Solution](solutions/golang/stackOverFlow/README.md)) +* **Task Management System**: ([View Solution](solutions/golang/taskmanagementsystem/README.md)) +* **Tic-Tac-Toe**: ([View Solution](solutions/golang/tictactoe/README.md)) +* **Traffic Signal System**: ([View Solution](solutions/golang/trafficsignalsystem/README.md)) +* **Vending Machine**: ([View Solution](solutions/golang/vendingmachine/README.md)) +* **Voting System**: ([View Solution](solutions/golang/votingsystem/README.md)) + +#### Java + +* **Airline Management System**: ([View Solution](solutions/java/src/airlinemanagementsystem/README.md)) +* **ATM**: ([View Solution](solutions/java/src/atm/README.md)) +* **Car Rental System**: ([View Solution](solutions/java/src/carrentalsystem/README.md)) +* **Chess Game**: ([View Solution](solutions/java/src/chessgame/README.md)) +* **Coffee Vending Machine**: ([View Solution](solutions/java/src/coffeevendingmachine/README.md)) +* **Concert Ticket Booking System**: ([View Solution](solutions/java/src/concertticketbookingsystem/README.md)) +* **Course Registration System**: ([View Solution](solutions/java/src/courseregistrationsystem/README.md)) +* **Cricinfo**: ([View Solution](solutions/java/src/cricinfo/README.md)) +* **Digital Wallet Service**: ([View Solution](solutions/java/src/digitalwalletservice/README.md)) +* **Elevator System**: ([View Solution](solutions/java/src/elevatorsystem/README.md)) +* **File Directory System (Composite/Strategy/Chain of Resp.)**: ([View Solution](solutions/java/src/filedirectory/README.md)) +* **Food Delivery Service**: ([View Solution](solutions/java/src/fooddeliveryservice/README.md)) +* **Hotel Management System**: ([View Solution](solutions/java/src/hotelmanagementsystem/README.md)) +* **Library Management System**: ([View Solution](solutions/java/src/librarymanagementsystem/README.md)) +* **LinkedIn**: ([View Solution](solutions/java/src/linkedin/README.md)) +* **Logging Framework**: ([View Solution](solutions/java/src/loggingframework/README.md)) +* **LRU Cache**: ([View Solution](solutions/java/src/lrucache/README.md)) +* **Movie Ticket Booking System**: ([View Solution](solutions/java/src/movieticketbookingsystem/README.md)) +* **Music Streaming Service**: ([View Solution](solutions/java/src/musicstreamingservice/README.md)) +* **Online Auction System**: ([View Solution](solutions/java/src/onlineauctionsystem/README.md)) +* **Online Learning Platform**: ([View Solution](solutions/java/src/onlinelearningplatform/README.md)) +* **Online Shopping Service**: ([View Solution](solutions/java/src/onlineshoppingservice/README.md)) +* **Online Stock Brokerage System**: ([View Solution](solutions/java/src/onlinestockbrokeragesystem/README.md)) +* **Parking Lot**: ([View Solution](solutions/java/src/parkinglot/README.md)) +* **Pub-Sub System**: ([View Solution](solutions/java/src/pubsubsystem/README.md)) +* **Restaurant Management System**: ([View Solution](solutions/java/src/restaurantmanagementsystem/README.md)) +* **Ride-Sharing Service**: ([View Solution](solutions/java/src/ridesharingservice/README.md)) +* **Snake and Ladder Game**: ([View Solution](solutions/java/src/snakeandladdergame/README.md)) +* **Social Networking Service**: ([View Solution](solutions/java/src/socialnetworkingservice/README.md)) +* **Splitwise**: ([View Solution](solutions/java/src/splitwise/README.md)) +* **Stack Overflow**: ([View Solution](solutions/java/src/stackoverflow/README.md)) +* **Task Management System**: ([View Solution](solutions/java/src/taskmanagementsystem/README.md)) +* **Tic-Tac-Toe**: ([View Solution](solutions/java/src/tictactoe/README.md)) +* **Traffic Signal System**: ([View Solution](solutions/java/src/trafficsignalsystem/README.md)) +* **Vending Machine**: ([View Solution](solutions/java/src/vendingmachine/README.md)) +* **Voting System**: ([View Solution](solutions/java/src/votingsystem/README.md)) + +#### Python + +* **Airline Management System**: ([View Solution](solutions/python/airlinemanagementsystem/README.md)) +* **ATM**: ([View Solution](solutions/python/atm/README.md)) +* **Car Rental System**: ([View Solution](solutions/python/carrentalsystem/README.md)) +* **Chess Game**: ([View Solution](solutions/python/chessgame/README.md)) +* **Coffee Vending Machine**: ([View Solution](solutions/python/coffeevendingmachine/README.md)) +* **Concert Ticket Booking System**: ([View Solution](solutions/python/concertticketbookingsystem/README.md)) +* **Course Registration System**: ([View Solution](solutions/python/courseregistrationsystem/README.md)) +* **Cricinfo**: ([View Solution](solutions/python/cricinfo/README.md)) +* **Digital Wallet Service**: ([View Solution](solutions/python/digitalwalletservice/README.md)) +* **Elevator System**: ([View Solution](solutions/python/elevatorsystem/README.md)) +* **Food Delivery Service**: ([View Solution](solutions/python/fooddeliveryservice/README.md)) +* **Hotel Management System**: ([View Solution](solutions/python/hotelmanagement/README.md)) (Note: directory is `hotelmanagement`) +* **Library Management System**: ([View Solution](solutions/python/librarymanagementsystem/README.md)) +* **LinkedIn**: ([View Solution](solutions/python/linkedin/README.md)) +* **Logging Framework**: ([View Solution](solutions/python/loggingframework/README.md)) +* **LRU Cache**: ([View Solution](solutions/python/lrucache/README.md)) +* **Movie Ticket Booking System**: ([View Solution](solutions/python/movieticketbookingsystem/README.md)) +* **Music Streaming Service**: ([View Solution](solutions/python/musicstreamingservice/README.md)) +* **Online Auction System**: ([View Solution](solutions/python/onlineauctionsystem/README.md)) +* **Online Shopping Service**: ([View Solution](solutions/python/onlineshopping/README.md)) (Note: directory is `onlineshopping`) +* **Online Stock Brokerage System**: ([View Solution](solutions/python/onlinestockbrokeragesystem/README.md)) +* **Parking Lot**: ([View Solution](solutions/python/parkinglot/README.md)) +* **Pub-Sub System**: ([View Solution](solutions/python/pubsubsystem/README.md)) +* **Restaurant Management System**: ([View Solution](solutions/python/restaurantmanagementsystem/README.md)) +* **Ride-Sharing Service**: ([View Solution](solutions/python/ridesharingservice/README.md)) +* **Snake and Ladder Game**: ([View Solution](solutions/python/snakeandladdergame/README.md)) +* **Social Networking Service**: ([View Solution](solutions/python/socialnetworkingservice/README.md)) +* **Splitwise**: ([View Solution](solutions/python/splitwise/README.md)) +* **Stack Overflow**: ([View Solution](solutions/python/stackoverflow/README.md)) +* **Task Management System**: ([View Solution](solutions/python/taskmanagementsystem/README.md)) +* **Tic-Tac-Toe**: ([View Solution](solutions/python/tictactoe/README.md)) +* **Traffic Signal System**: ([View Solution](solutions/python/trafficsignalsystem/README.md)) +* **Vending Machine**: ([View Solution](solutions/python/vendingmachine/README.md)) +* **Voting System**: ([View Solution](solutions/python/votingsystem/README.md)) + +--- +## Learning Checklist/Roadmap + +πŸ—ΊοΈ **Start Your Journey Here!** + +This roadmap is designed to guide you through the concepts and patterns in this repository in a logical sequence. Feel free to jump around if you're already familiar with certain topics, but following this path can be helpful for a structured learning experience. + +**Phase 1: Foundations - Object-Oriented Programming (OOP)** + +*Estimated Time: 4-8 hours* + +1. [ ] **Understanding Core OOP Principles**: + * [ ] **Classes and Objects**: The very basics. What are they? (Choose your language and find the `classesandobjects` README in the `oop/` directory) + * *Difficulty: Beginner* + * [ ] **Encapsulation**: Bundling data and methods. ([View OOP Concepts](#encapsulation)) + * *Difficulty: Beginner* + * [ ] **Abstraction**: Hiding complexity, showing essentials. ([View OOP Concepts](#abstraction)) + * *Difficulty: Beginner* + * [ ] **Inheritance**: Deriving classes from others. ([View OOP Concepts](#inheritance)) + * *Difficulty: Beginner-Intermediate* + * [ ] **Polymorphism**: Objects taking many forms. ([View OOP Concepts](#polymorphism)) + * *Difficulty: Intermediate* +2. [ ] **Understanding Relationships and Structures**: + * [ ] **Association**: How objects interact. ([View OOP Concepts](#association)) + * *Difficulty: Beginner* + * [ ] **Aggregation**: "Has-a" relationship (independent lifecycles). ([View OOP Concepts](#aggregation)) + * *Difficulty: Beginner-Intermediate* + * [ ] **Composition**: Strong "has-a" relationship (dependent lifecycles). ([View OOP Concepts](#composition)) + * *Difficulty: Beginner-Intermediate* + * [ ] **Interfaces**: Defining contracts. (Especially important in statically-typed languages, good to understand for all). ([View OOP Concepts](#interfaces)) + * *Difficulty: Intermediate* + +**Phase 2: Introduction to Design Patterns - Creational Patterns** + +*Estimated Time: 5-10 hours (1-2 hours per pattern)* + +*Focus: How objects are created.* + +1. [ ] **Singleton Pattern**: Ensuring a single instance. ([View Creational Patterns](#singleton)) + * *Difficulty: Beginner* +2. [ ] **Factory Method Pattern**: Deferring instantiation to subclasses. ([View Creational Patterns](#factory-method)) + * *Difficulty: Beginner-Intermediate* +3. [ ] **Abstract Factory Pattern**: Creating families of related objects. ([View Creational Patterns](#abstract-factory)) + * *Difficulty: Intermediate* +4. [ ] **Builder Pattern**: Constructing complex objects step by step. ([View Creational Patterns](#builder)) + * *Difficulty: Intermediate* +5. [ ] **Prototype Pattern**: Cloning objects from a prototype. ([View Creational Patterns](#prototype)) + * *Difficulty: Intermediate* + +**Phase 3: Structuring Your Code - Structural Patterns** + +*Estimated Time: 6-12 hours (1-2 hours per pattern)* + +*Focus: How classes and objects are composed to form larger structures.* + +1. [ ] **Adapter Pattern**: Making incompatible interfaces work together. ([View Structural Patterns](#adapter)) + * *Difficulty: Beginner-Intermediate* +2. [ ] **Decorator Pattern**: Adding responsibilities to objects dynamically. ([View Structural Patterns](#decorator)) + * *Difficulty: Intermediate* +3. [ ] **Facade Pattern**: Simplifying a complex subsystem with a single interface. ([View Structural Patterns](#facade)) + * *Difficulty: Beginner-Intermediate* +4. [ ] **Composite Pattern**: Treating individual objects and compositions uniformly. ([View Structural Patterns](#composite)) + * *Difficulty: Intermediate* +5. [ ] **Bridge Pattern**: Decoupling abstraction from implementation. ([View Structural Patterns](#bridge)) + * *Difficulty: Intermediate-Advanced* +6. [ ] **Proxy Pattern**: Providing a surrogate or placeholder for another object. ([View Structural Patterns](#proxy)) + * *Difficulty: Intermediate* +7. [ ] **Flyweight Pattern**: Efficiently supporting large numbers of fine-grained objects. ([View Structural Patterns](#flyweight)) + * *Difficulty: Advanced* + +**Phase 4: Managing Behavior - Behavioral Patterns** + +*Estimated Time: 8-15 hours (1-2 hours per pattern)* + +*Focus: How objects interact and distribute responsibility.* + +1. [ ] **Strategy Pattern**: Defining a family of algorithms and making them interchangeable. ([View Behavioral Patterns](#strategy)) + * *Difficulty: Intermediate* +2. [ ] **Observer Pattern**: Notifying multiple objects about state changes. ([View Behavioral Patterns](#observer)) + * *Difficulty: Intermediate* +3. [ ] **Command Pattern**: Encapsulating a request as an object. ([View Behavioral Patterns](#command)) + * *Difficulty: Intermediate* +4. [ ] **Template Method Pattern**: Defining an algorithm's skeleton, deferring steps to subclasses. ([View Behavioral Patterns](#template-method)) + * *Difficulty: Intermediate* +5. [ ] **Iterator Pattern**: Accessing elements of a collection sequentially. ([View Behavioral Patterns](#iterator)) + * *Difficulty: Beginner-Intermediate* +6. [ ] **State Pattern**: Allowing an object to change behavior when its state changes. ([View Behavioral Patterns](#state)) + * *Difficulty: Intermediate-Advanced* +7. [ ] **Chain of Responsibility Pattern**: Passing a request along a chain of handlers. ([View Behavioral Patterns](#chain-of-responsibility)) + * *Difficulty: Intermediate* +8. [ ] **Mediator Pattern**: Centralizing complex communications between objects. ([View Behavioral Patterns](#mediator)) + * *Difficulty: Intermediate-Advanced* +9. [ ] **Memento Pattern**: Capturing and restoring an object's internal state. ([View Behavioral Patterns](#memento)) + * *Difficulty: Intermediate* +10. [ ] **Visitor Pattern**: Adding new operations to classes without modifying them. ([View Behavioral Patterns](#visitor)) + * *Difficulty: Advanced* + +**Phase 5: Applying Your Knowledge - Problems and Solutions** + +*Estimated Time: Varies greatly* + +* [ ] Select problems from the [Problems and Solutions](#problems-and-solutions) section. + * Try to solve them on your own first. + * Then, review the provided solutions, paying attention to the OOP principles and design patterns used. + * *Difficulty: Intermediate to Advanced* + +**Tips for Learning:** + +* **Hands-on Practice**: Don't just read! Try to implement the patterns and concepts yourself in your preferred language. +* **Relate to Real-World Examples**: Think about how these patterns could apply to software you use or develop. +* **Don't Memorize, Understand**: Focus on the *why* and *when* of using a pattern, not just its structure. +* **Start Simple**: If a pattern seems too complex, review the foundational OOP concepts it builds upon. +* **Contribute**: Explaining concepts to others (e.g., by contributing to this repo) is a great way to solidify your understanding. + +This roadmap is a suggestion. Happy learning! + +--- +## Contributing + +🀝 **We Welcome Contributions!** + +This repository is a community effort, and we encourage you to contribute! Whether it's adding new design patterns, OOP examples, problem solutions, fixing typos, or improving explanations, your help is valuable. + +**How to Contribute:** + +1. **Fork the Repository**: Start by forking this repository to your own GitHub account. +2. **Create a New Branch**: Create a descriptive branch for your changes (e.g., `feature/add-observer-python` or `fix/typo-in-readme`). +3. **Make Your Changes**: + * Ensure your code follows the existing style and structure for the respective language. + * If adding a new pattern or concept, please include a clear `README.md` in its directory with: + * A simple explanation of the concept/pattern. + * The problem it solves. + * Its structure or components. + * A simple, runnable code example. + * If adding a new problem solution, ensure it's placed in the correct language and problem-named directory under `solutions/`. Include a `README.md` explaining your approach. +4. **Test Your Code**: If applicable, make sure your code examples run correctly. +5. **Write Clear Commit Messages**: Follow standard commit message conventions. +6. **Submit a Pull Request**: Push your changes to your fork and submit a pull request to the main repository. + * Clearly describe the changes you've made in the pull request description. + * Link to any relevant issues if applicable. + +**What to Contribute:** + +* Implementations of design patterns not yet covered. +* Examples of OOP concepts in different languages. +* Solutions to new or existing problems in the `problems/` directory. +* Improvements to existing explanations or code examples. +* Bug fixes or typo corrections. +* Documentation enhancements. + +We appreciate your effort in making this a better resource for everyone! + +## License + +This repository and its contents are licensed under the GNU General Public License v3.0. + +You can view the full license text here: [LICENSE](LICENSE) + +In summary, the GPLv3 allows you to: +* Freely use, study, and share the software. +* Modify the software and share your modifications. + +It also requires that: +* If you distribute copies or modified versions, you must do so under the same license (GPLv3). +* You must make the source code available when you distribute the software. + +Please review the full license text for detailed terms and conditions. + +--- diff --git a/README.md b/README.md index 58d0e395..41763998 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,14 @@ This repository contains resources to learn Low Level Design (LLD) / Object Orie πŸ‘‰ For a better and more comprehensive experience, checkout the [LLD page at AlgoMaster.io](https://algomaster.io/learn/lld) +## πŸ“– Comprehensive Documentation + +For a structured learning path, detailed explanations of concepts, design patterns, problem statements, and solutions, please see our new comprehensive documentation: + +**➑️ [View Full Documentation (DOCUMENTATION.md)](DOCUMENTATION.md)** + +This new documentation aims to provide a beginner-friendly, systematic guide to all the content in this repository. + ## πŸ“Œ Fundamental Concepts - [Basics OOP Concepts](https://blog.algomaster.io/p/basic-oop-concepts-explained-with-code)