Skip to main content

Patterns for Software Design and Architectures

Patterns are named solutions for recurring design problems, such as strategy, observer, decorator, factory and repository, and testing is how you check that a design is really flexible. Code that is hard to test usually has hidden dependencies that the right pattern would expose and invert.

Stage: Design Principles · Part of the Software Design and Architecture roadmap · Last reviewed 19 November 2026

What to learn in Patterns

Patterns interview questions

What is dependency injection and why does it help testing?

Dependency injection supplies a class's collaborators from outside instead of creating them inside. In tests you can pass a fake database or clock, so the unit is isolated and deterministic, and production wiring can swap implementations.

How does the decorator pattern differ from inheritance?

A decorator wraps an object that implements the same interface and adds behaviour at runtime, and decorators can be stacked in different combinations. Inheritance fixes the extra behaviour at compile time and can cause a large class hierarchy.

Where Patterns fits in the Software Design and Architecture roadmap

Patterns belongs to the Design Principles stage (intermediate level), which takes about 30 hours. Write maintainable code.

Back to the full Software Design and Architecture roadmap