Thoughts, notes, and explanations on Python, Data Structures, Algorithms, Machine Learning, and learning how to learn effectively.
This section will grow over time with structured posts and practical insights.
Thoughts, notes, and explanations on Python, Data Structures, Algorithms, Machine Learning, and learning how to learn effectively.
This section will grow over time with structured posts and practical insights.

Advanced LLD Topics — A Deep Dive Who this is for: Anyone who has finished the SOLID principles and the three design-pattern modules (Creational, Structural, Behavioural) and is ready to learn how to use that knowledge well — in real systems, in real interviews, in real production code. What this module builds on: SOLID Principles (Module 2), Creational Patterns (Module 3), Structural Patterns (Module 4), Behavioural Patterns (Module 5). What this module feeds into: Case Studies (Module 9) and Testing (Module 8). The Dependency Injection section here is the foundation for every fake, mock, and stub you’ll write in Module 8. ...

Design Patterns, Part 1: Foundations and Creational Patterns Table of Contents What a Design Pattern Is Why Design Patterns Are Studied Classification of the GoF Catalogue The Template Used for Each Pattern The Problem Space of Creational Patterns Singleton Factory Method Abstract Factory Builder Prototype Comparative Summary of the Five Patterns Key Takeaways Practice Exercises with Solutions Self-Assessment Questions 1. What a Design Pattern Is 1.1 Definition Design pattern. A named, general, reusable solution to a problem that recurs within a particular context of software design. A pattern is a description of communicating objects and classes that are customised to solve a general design problem in that context. ...

Design Patterns — Part 2: Structural Patterns Who this is for: Anyone who has worked through the Creational patterns and is ready to learn how objects fit together — how to combine classes and objects into larger structures that stay flexible and maintainable. Table of Contents Structural Patterns — What and Why Adapter Bridge Composite Decorator Facade Flyweight Proxy Summary of Structural Patterns Practice Exercises with Solutions Self-Assessment Test 1. Structural Patterns Creational patterns answered: “how do we make objects flexibly?” Structural patterns answer: “how do we combine objects into larger structures flexibly?” ...

Design Patterns — Part 3: Behavioral Patterns Who this is for: Anyone who has worked through Creational and Structural patterns and is ready for the final, largest, and arguably most important family — the patterns that govern how objects communicate and divide responsibility. Table of Contents Behavioral Patterns — What and Why Chain of Responsibility Command Interpreter Iterator Mediator Memento Observer State Strategy Template Method Visitor Summary of Behavioral Patterns Practice Exercises with Solutions Self-Assessment Test Final Words — All 23 Patterns at a Glance 1. Behavioral Patterns Creational patterns answered “how do we make objects?” Structural patterns answered “how do we glue objects together?” Behavioral patterns answer: “how do objects talk to each other, and who is responsible for what?” ...

Design Patterns — Practice Workbook Who this is for: Anyone who has worked through the three teaching files — 03_design_patterns_creational.md, 04_design_patterns_structural.md, and 05_design_patterns_behavioral.md — and now wants to prove they actually understand by solving problems independently. Table of Contents Preface — How to Use This Workbook Section 1 — Creational Patterns Practice Problem 1.1 — Application Configuration (Level 1) Problem 1.2 — Document Export Flow (Level 1) Problem 1.3 — Food Delivery Order (Level 2) Problem 1.4 — Game Enemy Spawning (Level 2) Problem 1.5 — Cloud Environment Configurations (Level 3) Section 2 — Structural Patterns Practice Problem 2.1 — Third-Party Payment SDK (Level 1) Problem 2.2 — Coffee Shop Pricing (Level 2) Problem 2.3 — Smart Home Scenes (Level 2) Problem 2.4 — Library Book Database (Level 2) Problem 2.5 — File System with Virtual Files (Level 3) Problem 2.6 — UI Rendering Across Platforms (Level 3) Section 3 — Behavioural Patterns Practice Problem 3.1 — Stock Price Monitor (Level 1) Problem 3.2 — E-commerce Shipping (Level 1) Problem 3.3 — Text Editor Undo/Redo (Level 2) Problem 3.4 — Vending Machine (Level 2) Problem 3.5 — Order Validation Pipeline (Level 2) Problem 3.6 — News Aggregator (Level 3) Problem 3.7 — Chess Engine (Level 3) Section 4 — Combination Problems: Multiple Patterns Together Problem 4.1 — Ride-Sharing App (Level 3) Problem 4.2 — Hotel Booking Platform (Level 3) Problem 4.3 — Notification Service (Level 3) Problem 4.4 — Document Management System (Level 3 — Hardest) Section 5 — Anti-Pattern Traps: When NOT to Use a Pattern Problem 5.1 — A Simple CSV Script Problem 5.2 — TemperatureConverter Problem 5.3 — Internal Bulk-Rename Tool Summary — Pattern Selection Reference Card Preface You’ve read the three teaching files. Each one gave you the pattern: “Here is Observer, here is what it solves, here is the example.” Reading those files makes you familiar with patterns. It does not make you good at using them. ...

SOLID Principles Prerequisite: This material assumes familiarity with Python object-oriented programming, including classes, inheritance, polymorphism, and abstraction. The discussion builds directly on that foundation and extends it toward writing object-oriented code that remains maintainable as a system grows. Table of Contents Why SOLID Exists What SOLID Stands For Single Responsibility Principle (SRP) Open/Closed Principle (OCP) Liskov Substitution Principle (LSP) Interface Segregation Principle (ISP) Dependency Inversion Principle (DIP) How the Five Principles Reinforce Each Other Capstone Example: Applying All Five Together Common Pitfalls and Anti-Patterns When Not to Apply SOLID Summary and Key Takeaways Self-Assessment Questions Practice Exercises with Solutions 1. Why SOLID Exists A learner who has completed a course on object-oriented programming knows how to define classes, establish inheritance hierarchies, and use polymorphism. A natural question follows: if these tools are already available, why does a separate set of principles need to be learned before writing “good” object-oriented code? ...

Object-Oriented Programming in Python — A Deep Dive Who this is for: Anyone who knows basic Python (variables, functions, lists, dicts) and wants to truly understand OOP — not just the syntax, but why it exists, what problems it solves, and how to wield it well in real systems. Table of Contents The World Before OOP — Why Do We Even Need It? Classes and Objects — The Blueprint and the Building The self Parameter — Python’s Most Misunderstood Keyword Attributes — Instance vs Class Attributes Methods — Instance, Class, and Static The Four Pillars of OOP Encapsulation — The Art of Hiding Inheritance — Building on What Exists Polymorphism — Many Forms, One Interface Abstraction — Focusing on What Matters Dunder Methods — Making Your Objects Feel Native Properties — Controlled Attribute Access Multiple Inheritance and the MRO 13A. Mixins as a Pattern — Composable Capabilities Composition vs Inheritance Dataclasses — OOP with Less Boilerplate 15A. ABC vs Protocol — Two Ways to Define an Interface 15B. @classmethod as a Factory — Named Constructors Summary & Key Takeaways Practice Problems 1. The World Before OOP Before we learn what OOP is, let’s understand why humanity invented it. Imagine you’ve been hired to build software for a ride-hailing company (think Uber). You start writing code procedurally — just functions and dictionaries. ...

SOLID Principles: A Complete Deep Dive Prerequisite: Working familiarity with Python object-oriented programming, specifically classes, objects, inheritance, method overriding, polymorphism, and abstract base classes. If any of those terms are unfamiliar, study the OOP document first, because every argument in this document is expressed in that vocabulary. What this document delivers: A rigorous treatment of the five SOLID principles. For each principle you will find its formal statement, a precise interpretation of every term in that statement, the concrete engineering problem it solves, a worked example of the problem and its resolution, the alternative techniques available for the same goal, the costs of applying the principle, and the conditions under which it should not be applied. ...

SOLID Principles: Practice Workbook Prerequisite: 02_solid_principles.md. This workbook assumes the five principles have already been defined and demonstrated. It contains no new theory. Its purpose is to convert conceptual knowledge into diagnostic skill. Table of Contents How to Use This Workbook Vocabulary and the Diagnostic Method Section A: Recognition Drills Section B: Single Responsibility Principle Section C: Open/Closed Principle Section D: Liskov Substitution Principle Section E: Interface Segregation Principle Section F: Dependency Inversion Principle Section G: Combined Violations Section H: Capstone Refactor Self-Review Checklist Summary and Key Takeaways Appendix: Violation Signature Reference 1. How to Use This Workbook 1.1 What this document is for Knowing the definition of the Single Responsibility Principle and being able to detect a Single Responsibility violation in unfamiliar code are two different competencies. The first is declarative knowledge and can be acquired by reading. The second is a diagnostic skill and can only be acquired by repeated exposure to examples, followed by correction. ...