Low-level design and design patterns
How should the code inside an app be organised so it stays easy to change? Each lesson builds the design step by step with class diagrams, complete Java and Python code, comparisons with similar patterns and an exercise to try before you see the answer.
0 of 31 lessons doneRead at your own paceStep-through diagramsNo sign-up
Object-oriented basics
- Chapter 1Classes and objectsOne blueprint, many things built from it.Beginner · Medium priority · 45 min
- Chapter 2EncapsulationHide the insides; offer a few safe buttons.Intermediate · Medium priority · 45 min
- Chapter 3Inheritance vs composition“Is a” vs “has a”, and why to prefer parts.Intermediate · High priority · 45 min
- Chapter 4Interfaces and polymorphismOne plug shape, any appliance.Intermediate · High priority · 50 min
- Chapter 5Class diagramsRead and draw the boxes and arrows of UML.Beginner · Medium priority · 40 min
- Chapter 6SOLID principlesFive rules that keep code easy to change.Intermediate · High priority · 60 min
Patterns for creating objects
Patterns for structure
- Chapter 10AdapterMake two things fit that weren’t designed to.Beginner · High priority · 35 min
- Chapter 11DecoratorAdd extras by wrapping, not by rewriting.Intermediate · High priority · 40 min
- Chapter 12FacadeOne simple front door for a complicated system.Beginner · Medium priority · 35 min
- Chapter 13ProxyA stand-in that guards, delays or caches.Intermediate · Medium priority · 45 min
- Chapter 14CompositeTreat one item and a group of items the same way.Intermediate · Medium priority · 50 min
Patterns for behaviour
- Chapter 15StrategySwap the “how” without touching the rest.Beginner · High priority · 40 min
- Chapter 16ObserverTell everyone who cares when something changes.Intermediate · High priority · 45 min
- Chapter 17CommandTurn a request into an object: queue it, undo it.Intermediate · High priority · 40 min
- Chapter 18StateBehaviour that changes with the current mode.Intermediate · High priority · 45 min
- Chapter 19Template methodA fixed recipe with steps you can fill in.Intermediate · Medium priority · 45 min
- Chapter 20Chain of responsibilityPass a request along until someone handles it.Intermediate · Medium priority · 50 min
Design it yourself
- Chapter 21Design a parking lotSpots, tickets, gates and payments.Intermediate · High priority · 50 min
- Chapter 22Design a vending machineStates, coins and change.Intermediate · High priority · 50 min
- Chapter 23Design an elevator systemRequests, directions and scheduling.Advanced · High priority · 55 min
- Chapter 24Design movie ticket bookingShows, seats and no double-booking.Advanced · High priority · 55 min
More interview problems
- Chapter 25How to approach an LLD interviewA step-by-step method for low-level design interviews: OOD discussion vs machine coding, timings, finding classes, choosing patterns, clean code, tests and concurrency.Intermediate · High priority · 50 min
- Chapter 26LRU cacheDesign an LRU cache with O(1) get and put: a hash map plus a doubly linked list, eviction, thread safety, TTL, and the LinkedHashMap and OrderedDict shortcuts.Intermediate · High priority · 70 min
- Chapter 27Tic-tac-toeDesign tic-tac-toe for a machine-coding round: board, players, turn rules, O(1) win detection with line counters, N×N boards, game state and undo.Beginner · High priority · 50 min
- Chapter 28SplitwiseDesign Splitwise: users, groups, expenses split equally, by exact amounts or by percentage (Strategy), balances in integer cents, and debt simplification.Intermediate · High priority · 50 min
- Chapter 29Library management systemDesign a library management system: books versus copies, members, loans, a hold queue, fines as a strategy, search, and notifications with the Observer pattern.Intermediate · Medium priority · 50 min
- Chapter 30Rate limiter classDesign an in-process rate limiter class: one interface, token bucket and sliding window strategies, per-key limiters, thread safety and an injected clock for tests.Intermediate · High priority · 55 min