Everything
What actually happens on the wire β layers, protocols, tools, and infrastructure a developer needs to understand
ππ§ Mastermind Software Engineer Guide (Personal Edition)
π My Tech Stack
- Backend: Python (Django, FastAPI,tooling:ruff,uv), Rust (actix-web, axum)
- Frontend: Svelte / SvelteKit
- Tools: Linux, Git, Docker
- Patterns & Principles: SOLID, DRY, YAGNI, KISS, naming, architecture, extendibility
ππ’ Foundational Knowledge (Must Always Keep Warm)
β Data Structures & Algorithms (DSA)
- Arrays, Linked Lists, Trees, Graphs
- Sorting, Searching
- Hash Maps, Sets
- Recursion, Dynamic Programming (DP)
- Time & Space Complexity (Big O)
Tip: Revise once per year β but donβt overstress memorization. Deep pattern recognition is more important.
β Core Principles
- SOLID (OOP principles)
- DRY (Donβt Repeat Yourself)
- KISS (Keep It Simple, Stupid)
- YAGNI (You Ainβt Gonna Need It)
ππ LeetCode Patterns for DSA
Mastering these patterns helps you solve most coding interview problems efficiently:
-
Sliding Window
For subarrays/substrings with optimal time (e.g., max sum, longest substring).- Example: Maximum Subarray, Longest Substring Without Repeating Characters
-
Two Pointers
For problems on sorted arrays/linked lists (e.g., pair sum, reverse).- Example: Two Sum II, Remove Duplicates from Sorted Array
-
Fast & Slow Pointers (Cycle Detection)
Detect cycles or find middle in linked lists.- Example: Linked List Cycle, Find Middle of Linked List
-
Merge Intervals
For interval overlap/merge problems.- Example: Merge Intervals, Insert Interval
-
Binary Search
For sorted arrays/search space reduction.- Example: Search in Rotated Sorted Array, Find Minimum in Rotated Sorted Array
-
Backtracking
For permutations, combinations, and subsets.- Example: Subsets, Permutations, Combination Sum
-
Breadth-First Search (BFS)
For shortest path in unweighted graphs/trees.- Example: Binary Tree Level Order Traversal, Word Ladder
-
Depth-First Search (DFS)
For traversals, connected components, and recursion.- Example: Number of Islands, Clone Graph
-
Dynamic Programming (DP)
For optimal substructure/overlapping subproblems.- Example: Climbing Stairs, House Robber, Longest Increasing Subsequence
-
Greedy
For local optimal β global optimal.- Example: Jump Game, Gas Station
-
Heap/Priority Queue
For top K elements, merging sorted lists.- Example: Kth Largest Element, Merge K Sorted Lists
-
Trie
For prefix-based search.- Example: Implement Trie, Word Search II
Tip:
Focus on understanding the pattern, not just the solution.
LeetCode Patterns Reference
ππ Software Design & Architectural Patterns
π Overview
Design and architectural patterns are tried-and-true solutions to common software development problems. They help write clean, maintainable, and scalable code.
π§± 1. Design Patterns
π¨ 1.1 Creational Patterns
-
Singleton
Ensure a class has only one instance and provide a global point of access.classDiagram class Singleton { -instance: Singleton +getInstance(): Singleton } -
Factory Method
Define an interface for creating an object, but let subclasses decide which class to instantiate.classDiagram class Product class ConcreteProduct class Creator { +factoryMethod(): Product } class ConcreteCreator { +factoryMethod(): Product } Creator <|-- ConcreteCreator Product <|-- ConcreteProduct -
Builder
Separate the construction of a complex object from its representation.classDiagram class Director class Builder { +setPart() +getResult() } Director --> Builder -
Prototype
Create new objects by copying an existing object (clone).classDiagram class Prototype { +clone(): Prototype } class ConcretePrototype Prototype <|-- ConcretePrototype
π§© 1.2 Structural Patterns
-
Adapter
Allow incompatible interfaces to work together.classDiagram class Target class Adaptee class Adapter Target <|.. Adapter Adapter --> Adaptee -
Bridge
Separate abstraction from implementation so they can vary independently.classDiagram class Abstraction class Implementor class RefinedAbstraction Abstraction <|-- RefinedAbstraction RefinedAbstraction --> Implementor -
Composite
Treat individual objects and compositions uniformly.classDiagram class Component class Leaf class Composite { +add() } Component <|-- Leaf Component <|-- Composite Composite --> Component -
Decorator
Add responsibilities to objects dynamically.classDiagram class Component class ConcreteComponent class Decorator class ConcreteDecorator Component <|-- ConcreteComponent Component <|-- Decorator Decorator <|-- ConcreteDecorator Decorator --> Component -
Facade
Provide a simplified interface to a complex subsystem.classDiagram class Facade class SubsystemA class SubsystemB Facade --> SubsystemA Facade --> SubsystemB
π§ 1.3 Behavioral Patterns
-
Observer
Define a dependency between objects so that when one changes, others are notified.classDiagram class Subject { +attach() +detach() +notify() } class Observer { +update() } Subject --> Observer -
Command
Encapsulate a request as an object.classDiagram class Command { +execute() } class ConcreteCommand class Invoker class Receiver Command <|-- ConcreteCommand Invoker --> Command ConcreteCommand --> Receiver -
Strategy
Define a family of algorithms, encapsulate them, and make them interchangeable.classDiagram class Context { -strategy: Strategy } class Strategy { +execute() } class ConcreteStrategyA Strategy <|-- ConcreteStrategyA Context --> Strategy
ποΈ 2. Architectural Patterns
-
MVC (Model-View-Controller)
Separates application logic into three interconnected components.graph TD Model --> Controller Controller --> View View --> Model -
MVVM (Model-View-ViewModel)
Enhances MVC with two-way binding between view and view model.graph TD Model --> ViewModel ViewModel --> View View --> ViewModel -
Layered Architecture
Organizes code into layers with specific responsibilities.graph TD UI --> Application Application --> Domain Domain --> Infrastructure -
Client-Server
Divide systems into a server (provider) and client (consumer).graph TD Client -->|Request| Server Server -->|Response| Client -
Microservices
Decompose a system into small, independently deployable services.graph TD ServiceA --> API ServiceB --> API ServiceC --> API API --> Client
β Summary Table
| Category | Patterns |
|---|---|
| Creational | Singleton, Factory Method, Builder, Prototype |
| Structural | Adapter, Composite, Facade, Bridge, Decorator |
| Behavioral | Observer, Command, Strategy |
| Architectural | MVC, MVVM, Layered, Client-Server, Microservices |
ππ UML Diagrams with Mermaid.js
This document showcases the most common UML diagram types using Mermaid.js. Great for visualizing systems directly in GitHub markdown!
π§± 1. Class Diagram
Description:
Class diagrams represent the structure of classes in a system, showing their attributes, methods, and relationships.
classDiagram
class Animal {
+String name
+int age
+makeSound()
}
class Dog {
+String breed
+bark()
}
class Cat {
+scratch()
}
Animal <|-- Dog
Animal <|-- Cat π 2. Use Case Diagram
Description:
Use case diagrams visualize the interactions between users (actors) and the system to achieve goals (use cases).
graph TD
Actor((π€ User)) -->|Uses| System[π₯οΈ System]
System --> UC1(π Use Case 1)
System --> UC2(π Use Case 2)
UC1 -.-> UC2 π 3. Sequence Diagram
Description:
Sequence diagrams show how objects or components interact in a particular sequence of time-ordered messages.
sequenceDiagram
participant User as π€ User
participant WebApp as π WebApp
participant Server as π₯οΈ Server
User->>WebApp: Request Page
WebApp->>Server: Fetch Data
Server-->>WebApp: Return Data
WebApp-->>User: Render Page π 4. Activity Diagram
Description:
Activity diagrams model the flow of control or data between activities, useful for describing workflows and logic.
flowchart TD
Start([π Start]) --> A[π Login]
A --> B{β
Valid?}
B -- Yes --> C[π Show Dashboard]
B -- No --> D[β Show Error]
C --> End([π End])
D --> End π 5. State Diagram
Description:
State diagrams represent the possible states of an object and transitions triggered by events or actions.
stateDiagram-v2
[*] --> Idle
Idle --> Processing : βΆοΈ start()
Processing --> Finished : βοΈ complete()
Finished --> [*] π§© 6. Component Diagram
Description:
Component diagrams model the components of a system and how they interact through interfaces.
graph TB
Client["π§βπ» Client"] -->|uses| API["π API"]
API --> Controller["π§ Controller"]
Controller --> Service["βοΈ Service"]
Service --> Database["(ποΈ Database)"] π 7. Deployment Diagram
Description:
Deployment diagrams show the physical layout of hardware and how software components are deployed on them.
graph TD
subgraph "π§βπ» Client Node"
Browser["π Browser"]
end
subgraph "π₯οΈ Server Node"
WebApp["π§ WebApp"]
DB["(ποΈ Database)"]
end
Browser --> WebApp
WebApp --> DB π§Έ 8. Object Diagram
Description:
Object diagrams depict instances of classes (objects) and their relationships at a specific point in time.
classDiagram
class Person {
+String name
+int age
}
Person : name = "Alice"
Person : age = 30 ππ₯ Next-Level Topics To Master (Architect Mindset)
1οΈβ£ Architectural Styles
- Layered Architecture (Controllers β Services β Repos)
- Hexagonal Architecture (Ports & Adapters, decouple domain)
- CQRS (Command Query Responsibility Segregation)
- Event-Driven Architecture (pub/sub systems, message queues)
2οΈβ£ Domain-Driven Design (DDD)
- Entities β objects with identity (e.g.,
User,Order) - Value Objects β immutable, no ID (
Money,Coordinates) - Aggregates β groups of entities with a root
- Ubiquitous Language β name code after domain terms
3οΈβ£ Advanced State Management (Frontend)
- Finite State Machines β use XState or implement manually
- Statecharts β for complex UIs (multi-step flows)
- Reactive Patterns β data flow graphs, not just stores
4οΈβ£ Testing Patterns
- Given-When-Then (BDD style)
- Test Doubles (Mock, Stub, Fake)
- Property-Based Testing (e.g.,
hypothesisin Python,proptestin Rust)
ππ’ Tools Every Mastermind Should Command
β Git (Version Control)
- Rebase, squash commits
- Feature branch workflows
- Writing meaningful commit messages
- Handling merge conflicts like a pro
β Docker (Containers)
- Writing multi-stage Dockerfiles
- Using
docker-composefor dev envs - Building minimal, production-ready images
- Understanding networks, volumes, healthchecks
β Linux (Dev Environment)
- Bash scripting
grep,awk,sedfor text processing- Managing services with
systemd - Networking basics (
netstat,curl,dig)
β CI/CD (Optional but Highly Recommended)
- Github Actions / Gitlab CI pipelines
- Lint β Test β Build β Deploy sequences
- Using Docker in CI pipelines
ππ Clean API Development Guide (General & REST Focus)
π Goals of Clean API Design
- Consistent β predictable patterns everywhere
- Simple β easy for clients to understand & use
- Versioned β changes don't break old clients
- Secure β protects against common vulnerabilities
- Extensible β easy to add features without breaking old ones
- Well-documented β clear and accurate API docs
π₯ General API Design Principles (Always Apply)
1. Use Meaningful Resource Naming
- Use nouns for resources, verbs for actions.
- Examples:
GET /users POST /users PATCH /users/{id}
2. Use HTTP Methods Correctly
| Method | Use For |
|---|---|
| GET | Retrieve data |
| POST | Create new resource |
| PUT | Replace entire resource |
| PATCH | Update part of resource |
| DELETE | Remove resource |
3. Version Your API (Always!)
- Example:
/api/v1/users /api/v2/users - Use URI versioning or headers, but always version.
4. Use Standard HTTP Status Codes
| Status Code | Meaning |
|---|---|
| 200 OK | Success |
| 201 Created | Resource created |
| 400 Bad Request | Client error |
| 401 Unauthorized | Auth failed |
| 404 Not Found | Resource missing |
| 500 Server Error | Internal fail |
5. Keep Responses Consistent
- Use a common envelope format:
{
"data": { ... },
"error": null
}
https://swagger.io/
ππ£ My Personalized Pattern Map (Cheat Sheet)
| When I do this... | It's called... |
|---|---|
| Pick components/classes based on condition | Factory Pattern |
| Wrap external APIs/components to fit my code | Adapter Pattern |
| Add features without changing base logic | Decorator Pattern |
| Build objects/config step by step | Builder Pattern |
| Split big things into smaller units | Single Responsibility |
| Centralize shared state across many parts | Mediator / Store Pattern |
| Extract repeated logic | DRY Principle |
| Follow naming conventions | Clean Code Naming |
πβ How To Become Confident When Choosing Architecture
- Small Project?
- Use Layered Architecture.
- YAGNI: Donβt over-engineer.
- Medium to Large?
- Use Hexagonal + DDD Lite.
- Aim for framework-independent domain logic.
- Frontend Complex State?
- Model as State Machines.
- Use stores only when 2+ components need shared state.
- Backend Scaling?
- Move to Event-Driven or CQRS if reads/writes differ in volume.
- Always
- Start simple (Layered), then evolve to advanced when complexity forces you.
- Record decisions in ADR docs.
π Recommended Books & Videos (Curated)
Books:
- Clean Code by Robert C. Martin
- Clean Architecture by Robert C. Martin
- Domain-Driven Design Distilled by Vaughn Vernon
- Patterns of Enterprise Application Architecture by Martin Fowler
- Refactoring UI by Adam Wathan
Videos & Playlists:
Python
- James Powell playlist
- sentdex web scraping
- Pandas advanced
- sentdex pandas
- Full django
- Full django (drf)
- refactoring.guru best design pattern explanaition
- roadmap.sh has this & better
IT (networking / databases / http ...)
Backend / System Design
Rust
- All in one video
- from tust book
- From rust to python
- also check the rustlings & 100 exercices
Git
Svelte
- All in one sveltekit
- tailwind css
- also check daisyUI and skeletonUI
Linux
- Mostafa Hamouda redhat (the best)
- also check docker
Algorithms
- Prime's last algo
- Algorithms simple version
- Datastructures simple version
- also do some leetcode, best from neetcode
AI
- we don't do that hereπ₯ Final Tip
Mastermind devs donβt memorize patterns β they name their instincts and record decisions.
Trust your intuition. Level it up by learning the names.
Then, you'll not only code well β you'll design systems that last π₯.
π οΈ Terminal, SaaS, Dev, Desktop, Data, DevOps, Cool Stuff
Terminal
- ranger
- helix
- tmux
- docker / docker-compose / lazydocker
- git / lazygit
- htop
- coreutils (grep / find / jq / sed ...)
- ansible
- fish / starship
- ollama
- certbot
- espanso
SaaS
- Wordpress (cf7 elementor)
- Odoo
- directus
- n8n
- aapanel
- glpi
- moodle / budibase / callcom / nocobase / nocodb
Dev
- python (django, pandas / polars, fastapi, requests, scrapy, sklearn) jupyter
- js (sveltekit / skeletonUi superform, drizzleORM, pwa, capacitor)
- fun with go / rust
- sentry
- Qdrant
Desktop
- kde Plasma / gnome (i3/sway for tiling) - insomnia - vscodium - chromium - dbeaver - inkscape - onlyoffice - flameshot - lmstudioData
- dbt
- dagster
- airflow/prefect
- superset
- grafana
- pg / mongo / sqlite / clickhouse
- great_expectations
- querybook
DevOps
- prometheus / grafana / uptime kuma
- gitlab
- nginx / traefik / caddy
- cockpit
- openstack
- portainer
Cool Stuff
- typst
- automa
- evilimiter
- airgeddon
- PlantUML
- fedora / alpine / k3s / microk8s / k0s
- bookmarklets
π Python Reference
Basics
- OOP (classes)
- generators (yield)
- Decorators (@something)
- Type hint
- List comprehension
- Lambda functions
Code examples
Base Libraries
- inspect
- dis
- toolz
- functools
- random/secret
- operator
- datetime/time
- os/sys
Web
- Django / DRF / Celery
- flask (quart) / fastapi / django / muffin / blacksheep / aiohttp
- requests
- lxml
- json
- bs4
- sockets
- urlib3
- jwt
Useful Libraries
- tabulate
- sqlalchemy
- tinydb
- scrapy
- pyautogui
- opencv2
- pynput
- pyinstaller
- pillow
- networkx
- jwt
- sqlacodegen (generating auto models from a database)
- furl (manipulate URLs)
Functional Programming
- map
- reduce
- filter
- toolz
- functools
- lambda
Functional playlist
Data Science / Analytics
- numpy
- pandas
- matplotlib
- plotly
- scipy
- sklearn
- pytorch
- pandas-profiling (repo)
CLI
- fire