Sefism Software Design and Clean Code Cheat Sheet
The companion to the Software design and clean code roadmap in Java, Python, TypeScript and C# editions: OOP used properly, SOLID, clean code, all 23 Gang of Four patterns, the UML you actually draw, refactoring and code smells, small designs end to end, and code review. Each of its 73 concepts is a line or two with a sketch in your language and the classic mistake to avoid.
10
Sefism · Oct 2026
73
Sefism · Oct 2026
23
Sefism · Oct 2026
4 (Java, Python, TS, C#)
Sefism · Oct 2026
2
Sefism · Oct 2026
Cheat sheet
System Design
Sefism
Reference
Intermediate
Free
What this cheat sheet is
The Software design and clean code cheat sheet is the companion to the Software design and clean code roadmap, for students and early-career engineers who can write working code and now want it to stay easy to change. It covers OOP used properly, SOLID, clean code, all 23 classic design patterns, the UML you actually draw, refactoring and small designs end to end. Revise an idea in a line or two, read the sketch in your language and spot the classic mistake first.
Who it is for
Anyone who has to explain a design decision: a student before an OOP exam or a low level design round, a junior developer writing a pull request description, a reviewer who wants to name a smell instead of writing a paragraph. It assumes you know your language well enough to read a short code sketch.
Editions
There are four editions: Java, Python, TypeScript and C#. Each has the same ten chapters and 73 concepts, and the code sketches follow your language.
Chapter by chapter
- Object-oriented programming properly (8 concepts). Class and object, encapsulation, abstraction, inheritance, polymorphism, interfaces and abstract classes, composition over inheritance, and value objects and immutability.
- SOLID principles (7 concepts). SRP, OCP, LSP, ISP and DIP, each with the smell it prevents, plus dependency injection and DRY, KISS and YAGNI.
- Clean code: names, functions and errors (7 concepts). Meaningful names, small functions, arguments and flags, comments that explain why, guard clauses, error handling and the Law of Demeter.
- Creational patterns (5 concepts). Singleton, Factory Method, Abstract Factory, Builder and Prototype.
- Structural patterns (7 concepts). Adapter, Bridge, Composite, Decorator, Facade, Flyweight and Proxy.
- Behavioural patterns (11 concepts). Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method and Visitor.
- UML and class diagrams you actually need (7 concepts). Class diagrams, a UML notation card, association and multiplicity, aggregation versus composition, generalisation, realisation and dependency, sequence diagrams, and state and use case diagrams.
- Refactoring and code smells (9 concepts). Refactoring, code smells, a smell to refactoring table, Extract Function, Replace Conditional with Polymorphism, primitive obsession, feature envy and shotgun surgery, characterisation tests, and automated IDE refactorings.
- Designing small systems end to end (7 concepts). A method for low level design, finding entities and responsibilities, and the classic practice problems: parking lot, library management, rate limiter and Splitwise-style expense sharing, plus thread safety in a design.
- Code review: giving and taking it (5 concepts). What reviewers look for, approving when a change improves code health, Conventional Comments, small focused pull requests, and receiving feedback.
Rules worth pinning
- Design for the change you can see coming, not every change you can imagine.
- Learn a pattern by the problem it solves; if you cannot name the problem, you do not need the pattern.
- Prefer composition; inherit only for a true is-a that keeps every promise of the parent.
- Write the test before you refactor, run it after every small step, and commit often.
- Keep refactoring and behaviour changes in separate commits so reviewers can trust both.
- Money is an exact decimal or integer minor units, never a floating-point number.
- Collect the review comments you get twice; that list is your personal design curriculum.
How to use it with the roadmap
- After each stage, close the sheet and write the chapter's patterns or principles from memory in your language, then open it and compare.
- Before reaching for a pattern at work, read its entry and ask whether you can name the problem it solves in your code. If not, a plain function is probably better.
- When reviewing, use chapter 8's smell names and chapter 10's Conventional Comments labels. Short, named comments get acted on.
- Before a low level design round or a design discussion, reread chapter 9's method and one case study, then chapter 7's notation card.
How it works on Sefism
Everything on Sefism is free to learn from. The public page at Software design and clean code cheat sheet shows every chapter title, with the first two chapters open in full. Later chapters show their title, a short introduction and how many concepts they hold.
Keeping the sheet uses credits, and it is yours for good after that. Adding the Software design and clean code roadmap to your dashboard also opens this sheet, so if you plan to follow the roadmap you do not need to keep the sheet separately. New members get starting credits when they join, and the first roadmap is free. Create a free account to get started, and if a concept still does not make sense after reading it, ask Tauseef a question.
Related on Sefism
- How to learn low level design and design patterns
- Refactoring.Guru: Design Patterns, for longer explanations of each pattern
- The Programming foundations cheat sheet, if you need a refresher on the basics first
Frequently asked questions
Does it cover all the Gang of Four patterns? Yes, all 23: five creational, seven structural and eleven behavioural, each with a sketch in your language.
Is it useful for a low level design round? Chapter 9 gives a repeatable method and the classic practice problems, and chapter 7 the UML you need to draw them. The roadmap's stage 9 is where you build them.
Which edition should I choose? The language you write most. The concepts are the same in all four.
Ready to start?
Opens on Sefism in a new tab.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
Follow along
New writing, resources and project ideas land here first.