Learn · Syllabus
Everything you will learn
1 · Foundations
Clean Code16 lessons⏱ 158 minEvery other module assumes you can write code a teammate understands in one read. Start here.
Lesson 1Beginner8 min · 5 steps · 1 exercise
What clean code is, and why it pays
Messy code is not slower to write. It is slower to change, and you change code every day.
- What 'clean' really means
- Why mess slows a team down over time
- The boy scout rule
- How this section is organised
Lesson 2Beginner10 min · 6 steps · 2 exercises
Names and small functions
Rename until the code reads like a sentence, then split what does too much.
- A name should say what and why, not how
- Why booleans and magic numbers hurt
- One function, one level of abstraction
- How to split without making a maze
Lesson 3Beginner9 min · 5 steps · 1 exercise
Function parameters
Fewer, clearer inputs make a function easy to call and hard to call wrong.
- Why many parameters hurt
- Flag (boolean) parameters
- Parameter objects
- Named and default arguments
Lesson 4Beginner10 min · 5 steps · 1 exercise
Side effects and pure functions
A function should do what its name says, and nothing hidden.
- What a side effect is
- Pure functions and why they are easy
- Command-query separation
- Push effects to the edges
Lesson 5Beginner10 min · 5 steps · 1 exercise
Comments and error handling
Write comments that explain why, and handle failure without burying the logic.
- Which comments help and which lie
- Why returning null or -1 for errors is a trap
- Exceptions for the unexpected, values for the expected
- Failing early with guard clauses
Lesson 6Beginner7 min · 5 steps · 1 exercise
Formatting and layout
Shape the file so the eye finds things fast. Then let a tool keep it that way.
- The newspaper rule
- Keep related lines close
- One style for the whole team
- Automate it with formatters and linters
Lesson 7Intermediate10 min · 6 steps · 1 exercise
Null, edges and third-party code
Stop null from spreading, and keep libraries you do not own at the edge.
- Why returning null hurts
- Better options: empty values, Optional, nullable types
- Wrap third-party code
- Learning tests
Lesson 8Intermediate10 min · 5 steps · 1 exercise
Objects, data and 'tell, don't ask'
Let objects do the work with their own data instead of pulling the data out.
- Objects hide data and show behaviour
- Data structures show data and have no behaviour
- Tell, don't ask
- The Law of Demeter: talk to friends only
Lesson 9Intermediate10 min · 6 steps · 1 exercise
Small, focused classes
A class should have one reason to change, and its parts should belong together.
- The God class
- Single responsibility in plain words
- Cohesion: do the methods use the same fields?
- How to split a big class
Lesson 10Beginner9 min · 5 steps · 1 exercise
DRY, KISS and YAGNI
Three short rules that stop most over- and under-engineering.
- DRY: one source of truth for each rule
- When duplication is fine
- KISS: the simplest thing that works
- YAGNI: do not build for imagined futures
Lesson 11Beginner11 min · 6 steps · 1 exercise
Clean unit tests
Tests are code too. Make them short, clear and fast, or nobody will trust them.
- Arrange, act, assert
- One behaviour per test, named as a sentence
- F.I.R.S.T.
- Fakes versus mocks
Lesson 12Intermediate11 min · 6 steps · 1 exercise
Test-driven development
Write a small failing test, make it pass, clean up. Repeat every few minutes.
- Red, green, refactor
- Why the test comes first
- Baby steps and triangulation
- When TDD helps and when it does not
Lesson 13Intermediate12 min · 6 steps · 1 exercise
Code smells: the catalogue
Learn the common warning signs so you can spot them in a review in seconds.
- Long method and large class
- Feature envy and data clumps
- Primitive obsession
- Shotgun surgery and divergent change
- Each smell and its usual fix
Lesson 14Intermediate10 min · 5 steps · 1 exercise
Refactor safely
Change the shape of code in tiny steps with tests watching, never both at once.
- What refactoring is and is not
- Characterisation tests for code with no tests
- Small steps and constant green
- Two hats: change behaviour or change structure
Lesson 15Advanced12 min · 6 steps · 1 exercise
Working with legacy code
Old code without tests is changed safely by adding tests at the seams first.
- What legacy code really means
- Characterization tests
- Seams: where you can cut in
- Sprout and wrap
- The strangler approach
Lesson 16Intermediate9 min · 5 steps · 1 exercise
Code reviews and team habits
Clean code is a team result: small pull requests, kind reviews, shared rules.
- Small pull requests
- What to look for in a review
- Giving and receiving comments
- Team conventions and definitions of done
2 · Languages
Java19 lessons⏱ 204 minJava and the JVM sit under Kotlin and Spring. Know the language they are built on.
Lesson 1Beginner10 min · 5 steps · 1 exercise
Values, references and strings
What a variable really holds, and why == surprises people.
- Primitives hold a value, objects are reached by reference
- What assignment and method calls copy
- == versus equals
- Why String is immutable
Lesson 2Beginner12 min · 5 steps · 1 exercise
Classes, interfaces and polymorphism
How Java models behaviour, and why 'program to an interface' is not a slogan.
- Classes, fields, constructors and encapsulation
- Interfaces as contracts
- Polymorphism: one call, many behaviours
- Abstract classes and composition
Lesson 3Beginner10 min · 5 steps · 1 exercise
Records and immutability
Replace a page of boilerplate with one line, and see why immutable data is safer.
- What a record generates for you
- Why shared mutable state causes bugs
- Validating in a compact constructor
- When a record is the wrong choice
Lesson 4Intermediate10 min · 5 steps · 1 exercise
equals, hashCode and collections
Why a HashSet loses your object, and the contract that prevents it.
- Identity versus equality
- The equals and hashCode contract
- How HashMap finds a key
- Choosing List, Set or Map
Lesson 5Beginner11 min · 6 steps · 1 exercise
Choosing the right collection
List, Set, Map, Deque: what each is fast at, and which implementation to pick.
- The main interfaces
- ArrayList versus LinkedList
- HashMap, LinkedHashMap, TreeMap
- Immutable collections and Deque
Lesson 6Beginner10 min · 5 steps · 1 exercise
Dates and times with java.time
Instant, LocalDate, ZonedDateTime and Duration, and the time-zone bugs they prevent.
- Instant: a point on the timeline
- Local dates and times
- Zones and daylight saving
- Durations, periods and testing with Clock
Lesson 7Beginner9 min · 6 steps · 1 exercise
Files, I/O and resources
Read and write files safely, and always close what you open.
- Path and Files
- try-with-resources
- Streaming large files
- Character encodings
Lesson 8Intermediate12 min · 5 steps · 1 exercise
Generics
Write code once for many types, and let the compiler check it.
- Type parameters on classes and methods
- Why List<Dog> is not a List<Animal>
- Wildcards: extends to read, super to write
- Type erasure
Lesson 9Beginner10 min · 5 steps · 1 exercise
Exceptions
Failing clearly, cleaning up always, and never swallowing an error.
- Checked and unchecked exceptions
- try, catch, finally
- try-with-resources
- Your own exceptions, and what not to do
Lesson 10Intermediate10 min · 5 steps · 1 exercise
Lambdas and functional interfaces
Passing behaviour as a value, the idea behind streams and most modern APIs.
- A lambda is a short anonymous function
- Functional interfaces: Function, Predicate, Supplier, Consumer
- Method references
- Captured variables must be effectively final
Lesson 11Beginner10 min · 5 steps · 1 exercise
Streams and Optional
Describe what you want from a collection, and make absence explicit.
- Filter, map and collect as a pipeline
- Why streams are lazy
- Optional as a return type, not a field
- When a plain loop is still better
Lesson 12Intermediate12 min · 5 steps · 1 exercise
Sealed types and pattern matching
Model a closed set of cases and let the compiler check you handled all of them.
- Sealed interfaces: a fixed list of subtypes
- Pattern matching for instanceof
- switch that returns a value and checks every case
- Record patterns
Lesson 13Beginner10 min · 5 steps · 1 exercise
Packages, builds and dependencies
Maven or Gradle, dependency scopes, and how a project is organised.
- Packages and visibility
- Maven and Gradle basics
- Dependency scopes and versions
- Reproducible builds
Lesson 14Beginner11 min · 6 steps · 1 exercise
Testing Java with JUnit, AssertJ and Mockito
Write fast, readable unit tests and use mocks only at the edges.
- JUnit 5 basics
- Readable assertions with AssertJ
- Parameterised tests
- Mockito, used sparingly
Lesson 15Intermediate10 min · 5 steps · 1 exercise
Annotations and reflection
How frameworks read your code, and what that costs.
- What an annotation is
- Retention and targets
- Reflection in plain words
- Why frameworks move to compile time
Lesson 16Intermediate12 min · 5 steps · 1 exercise
Threads and shared state
What goes wrong when two threads touch the same data, and the tools that fix it.
- Threads and executors
- Race conditions
- synchronized, volatile and atomics
- Deadlock
Lesson 17Advanced12 min · 5 steps · 1 exercise
CompletableFuture and virtual threads
Two ways to wait for slow things without wasting threads.
- Why platform threads are expensive
- Composing with CompletableFuture
- Virtual threads: blocking code that scales
- When each one fits
Lesson 18Advanced12 min · 5 steps · 1 exercise
The JVM: memory and garbage collection
Where objects live, how they are freed, and how to read the symptoms.
- Bytecode, the JIT and warm-up
- Stack and heap
- How garbage collection decides
- Leaks in a garbage-collected language
Lesson 19Advanced11 min · 5 steps · 1 exercise
Measuring Java performance
Profile before you optimise: JFR, JMH and reading a flame graph.
- Why guessing fails
- Java Flight Recorder
- Flame graphs
- Micro-benchmarks with JMH
Kotlin18 lessons⏱ 194 minKotlin is Java with the sharp edges removed. You will build Spring services with it, and it also runs on Android and, with Multiplatform, on iOS.
Lesson 1Beginner10 min · 5 steps · 1 exercise
Kotlin for a Java developer
The first hour: variables, functions and expressions, and what you can stop typing.
- val and var, with type inference
- Functions: defaults, named arguments, expression bodies
- if, when and try are expressions
- String templates
Lesson 2Beginner10 min · 6 steps · 1 exercise
Null safety and data classes
Make the type system carry the null checks, and copy values instead of changing them.
- String versus String? in the type
- Safe call, Elvis and why to avoid !!
- Data classes and copy()
- Smart casts after a null check
Lesson 3Beginner10 min · 5 steps · 1 exercise
Classes, properties and objects
A class in one line, properties in place of getters, and object where Java uses static.
- The primary constructor
- Properties, getters and setters
- object and companion object
- Visibility and final by default
Lesson 4Intermediate10 min · 5 steps · 1 exercise
Higher-order functions and lambdas
Functions that take functions: the idea behind most of the Kotlin standard library.
- Function types such as (Int) -> Boolean
- Lambda syntax and it
- The trailing lambda
- inline, and why it matters
Lesson 5Intermediate12 min · 5 steps · 1 exercise
Collections
Read-only versus mutable, the operations you will use every day, and when to go lazy.
- List, Set, Map: read-only and mutable
- map, filter, groupBy, associate, fold
- Why chaining creates intermediate lists
- Sequences
Lesson 6Intermediate12 min · 5 steps · 1 exercise
Extensions and scope functions
Add a function to a type you do not own, and choose between let, apply, also, run and with.
- Extension functions and properties
- How they are resolved
- let, apply, also, run, with
- When they hurt readability
Lesson 7Intermediate10 min · 5 steps · 1 exercise
Sealed classes and when
Model every possible state and let the compiler tell you when you missed one.
- Why enums and booleans run out of room
- Sealed interface with data per case
- Exhaustive when without else
- A UI state example
Lesson 8Intermediate10 min · 5 steps · 1 exercise
Error handling the Kotlin way
Exceptions, require and check, Result, and sealed results for expected failures.
- No checked exceptions
- require, check and error
- runCatching and Result
- Sealed classes for business outcomes
Lesson 9Advanced12 min · 5 steps · 1 exercise
Generics, in, out and reified
The same ideas as Java's wildcards, declared once and readable.
- Type parameters and constraints
- out: a producer
- in: a consumer
- reified: keeping the type at runtime
Lesson 10Intermediate10 min · 5 steps · 1 exercise
Delegation with by
Reuse behaviour without inheritance, and properties that compute, observe or load lazily.
- Class delegation: composition without boilerplate
- lazy
- observable and other property delegates
- Writing your own delegate
Lesson 11Advanced10 min · 5 steps · 1 exercise
Lambdas with receivers and DSLs
How Gradle scripts, Ktor routes and HTML builders read like a language.
- Function types with receivers
- Building a small DSL
- @DslMarker for safety
- Where DSLs help and where they hurt
Lesson 12Intermediate12 min · 5 steps · 1 exercise
Coroutines: structured concurrency
Write async code that reads top to bottom, and cannot leak work.
- suspend functions in plain words
- launch versus async
- Scopes: why work has a parent
- Cancellation and where it goes wrong
Lesson 13Advanced12 min · 5 steps · 1 exercise
Flow
A stream of values over time, built on coroutines.
- A cold flow and its collector
- Operators: map, filter, debounce, flatMapLatest
- StateFlow and SharedFlow
- Collecting safely on Android
Lesson 14Advanced12 min · 5 steps · 1 exercise
Coroutines: cancellation, errors and dispatchers
What happens when work must stop or fails, and which thread it runs on.
- Cancellation is cooperative
- How exceptions travel
- supervisorScope
- Dispatchers and withContext
Lesson 15Advanced11 min · 5 steps · 1 exercise
Shared state, Mutex and channels
Coordinate coroutines safely: confine state, lock briefly, or pass messages.
- Races between coroutines
- Mutex and atomic types
- StateFlow for observable state
- Channels for producer and consumer
Lesson 16Intermediate11 min · 5 steps · 1 exercise
Testing Kotlin: JUnit, MockK and coroutine tests
Test suspending code with virtual time, and fake dependencies cleanly.
- Readable test names
- runTest and virtual time
- Testing Flows with Turbine
- MockK and fakes
Lesson 17Intermediate9 min · 6 steps · 1 exercise
kotlinx.serialization and JSON
Turn objects into JSON and back, safely and without reflection.
- @Serializable classes
- Configuring Json
- Defaults, optional and unknown fields
- Polymorphism with sealed classes
Lesson 18Advanced11 min · 5 steps · 1 exercise
Kotlin Multiplatform
Share business logic between Android, iOS, server and web, and keep UI native where it matters.
- What KMP shares
- Source sets: common and platform
- expect and actual
- Libraries: Ktor, SQLDelight, coroutines
Under the hood9 lessons⏱ 92 minWhen you know what really happens below your code (memory, threads, locks, the main thread loop), bugs stop being mysteries and you choose the right tool without guessing.
Lesson 1Beginner9 min · 6 steps · 1 exercise
From your code to the CPU
What happens between writing Kotlin and the processor doing the work.
- Source code, bytecode, machine code
- The JIT compiler
- The CPU: registers, cache, RAM
- Why memory speed matters
Lesson 2Beginner9 min · 6 steps · 1 exercise
Stack, heap and garbage collection
Where your variables and objects really live, and who cleans them up.
- The stack: one per thread
- The heap: shared objects
- References
- How garbage collection works
Lesson 3Beginner9 min · 6 steps · 1 exercise
What a thread really is
Threads, cores and the operating system scheduler, without jargon.
- A thread is a worker with its own stack
- Cores and the scheduler
- Context switches
- Why threads are expensive
Lesson 4Intermediate11 min · 6 steps · 1 exercise
From count++ to the atomic CPU instruction
Why count++ loses updates, and how one special instruction fixes it.
- count++ is three steps
- The race
- Compare-and-swap
- How the CPU makes it atomic
Lesson 5Intermediate11 min · 6 steps · 1 exercise
What synchronized really does
Locks, waiting threads, and the forgotten problem: visibility.
- When one atomic is not enough
- How a lock is built
- Visibility: stale values in caches
- volatile and happens-before
Lesson 6Intermediate10 min · 6 steps · 1 exercise
Event loops: the main thread is a loop
One thread, one queue: the idea behind Android's Looper, the browser and Node.js. Android is the example here.
- One thread draws the UI
- Looper and MessageQueue
- Handler.post
- Frames and freezes
Lesson 7Advanced12 min · 7 steps · 1 exercise
Deep dive: LiveData.postValue, top to bottom
One real function, followed from Kotlin down to the CPU.
- The one-slot mailbox
- Why the lock is there
- The trip to the main thread
- The modern Kotlin way
Lesson 8Advanced11 min · 6 steps · 1 exercise
How coroutines really work
suspend functions become state machines; dispatchers put them back on threads.
- Suspend is not magic
- The state machine
- Continuations
- Dispatchers
Lesson 9Intermediate10 min · 6 steps · 1 exercise
How a HashMap works inside
Buckets, hash codes, collisions and resizing, and why equals and hashCode must agree.
- An array of buckets
- From key to bucket
- Collisions
- Resizing, and the equals/hashCode contract
Rust14 lessons⏱ 156 minRust gives C-level speed with memory safety and no garbage collector. It powers modern infrastructure, CLIs, WebAssembly and the fast core of many AI and Python tools.
Lesson 1Beginner9 min · 6 steps · 1 exercise
Why Rust, and where it fits
Memory safety without a garbage collector, and the jobs Rust is best at.
- The problem Rust solves
- Safety checked at compile time
- Where Rust is used
- When not to use it
Lesson 2Beginner11 min · 6 steps · 1 exercise
Rust basics for Kotlin developers
Variables, mutability, types, functions, control flow and expressions.
- let and let mut
- Scalar and compound types
- Functions and expressions
- if, match, loop, for
Lesson 3Beginner12 min · 6 steps · 1 exercise
Ownership and moves
Every value has one owner; when the owner goes out of scope, the value is freed.
- The three ownership rules
- Moves
- Clone and Copy
- Drop: freeing without a GC
Lesson 4Intermediate12 min · 6 steps · 1 exercise
Borrowing and references
Use a value without taking it: shared &T or exclusive &mut T, never both at once.
- References instead of moves
- Shared and mutable borrows
- The borrowing rule
- Slices
Lesson 5Intermediate11 min · 6 steps · 1 exercise
Lifetimes without fear
How Rust knows a reference never outlives its data, and when you need to write 'a.
- Dangling references
- Lifetime elision
- Annotating lifetimes
- Owned data to avoid lifetime puzzles
Lesson 6Beginner11 min · 6 steps · 1 exercise
Structs, enums and pattern matching
Model data with structs and enums, and handle every case with match.
- Structs and impl blocks
- Enums with data
- Option instead of null
- Exhaustive match
Lesson 7Intermediate11 min · 6 steps · 1 exercise
Error handling with Result and ?
Recoverable errors as values, the ? operator, and thiserror and anyhow.
- Result<T, E>
- The ? operator
- Custom error types
- panic! is for bugs
Lesson 8Intermediate12 min · 6 steps · 1 exercise
Traits and generics
Shared behaviour with traits, generic functions, and static versus dynamic dispatch.
- Traits as interfaces
- Generics with trait bounds
- impl Trait and dyn Trait
- Standard traits
Lesson 9Intermediate11 min · 6 steps · 1 exercise
Collections, iterators and closures
Vec, HashMap and lazy iterator chains that compile to tight loops.
- Vec, HashMap, HashSet
- Iterator chains
- Closures and capture
- iter, iter_mut, into_iter
Lesson 10Advanced11 min · 6 steps · 1 exercise
Smart pointers: Box, Rc, Arc, RefCell and Mutex
Heap allocation, shared ownership and interior mutability, single- and multi-threaded.
- Box for the heap
- Rc and Arc for shared ownership
- RefCell for interior mutability
- Mutex and RwLock across threads
Lesson 11Advanced11 min · 6 steps · 1 exercise
Fearless concurrency
Threads, channels, Send and Sync, and data parallelism with rayon.
- Threads and scoped threads
- Message passing with channels
- Send and Sync
- Data parallelism with rayon
Lesson 12Advanced12 min · 6 steps · 1 exercise
Async Rust with Tokio
Futures, async/await, the Tokio runtime, and running many I/O tasks at once.
- Futures are lazy
- The Tokio runtime
- Concurrency with join and spawn
- Timeouts and cancellation
Lesson 13Advanced12 min · 6 steps · 1 exercise
A web service with axum and sqlx
Routing, shared state, JSON, a database pool and compile-time checked SQL.
- axum routes and handlers
- Shared state
- JSON with serde
- sqlx and a connection pool
Lesson 14Intermediate10 min · 6 steps · 1 exercise
Testing, tooling and unsafe
cargo test, clippy, benchmarks, documentation tests, and what unsafe really means.
- Unit and integration tests
- Doc tests
- clippy, fmt and benchmarks
- unsafe in perspective
3 · Patterns and architecture
Design Patterns21 lessons⏱ 197 minPatterns are names for solutions you will meet again. Learn the few that matter and when not to use them.
Lesson 1Intermediate10 min · 5 steps · 1 exercise
Strategy: replace the if-else ladder
Swap behaviour by passing it in, so new cases need no edits to old code.
- The smell: a growing when/if on a type
- Strategy as an interface and as a function
- The Open/Closed principle in practice
- When a plain if is still the right answer
Lesson 2Intermediate10 min · 5 steps · 1 exercise
Factory and Builder
Control how objects get created, so callers stop knowing the details.
- Why new scattered everywhere hurts
- A factory that picks the right type
- Builder versus Kotlin named arguments
- When a constructor is enough
Lesson 3Intermediate10 min · 6 steps · 1 exercise
Abstract Factory and Prototype
Create families of related objects together, or copy a configured object instead of building it again.
- Families of objects
- Abstract Factory
- Prototype: copy, then adjust
- When plain functions are enough
Lesson 4Intermediate10 min · 5 steps · 1 exercise
Singleton, and why injection replaced it
One instance is fine. Global access to it is the problem.
- What Singleton promises
- Hidden dependencies and untestable code
- One instance through dependency injection
- Kotlin object: when it is fine
Lesson 5Intermediate10 min · 5 steps · 1 exercise
Adapter and Facade
One translates an interface you cannot change. The other hides a crowd behind one door.
- Adapter: fit a foreign interface to yours
- Facade: one simple entry to a subsystem
- How they differ
- Their role in clean architecture
Lesson 6Intermediate9 min · 5 steps · 1 exercise
Bridge
Split two independent dimensions so they can grow without multiplying classes.
- Class explosion
- Abstraction and implementation
- Composition over inheritance
- Spotting two axes
Lesson 7Intermediate10 min · 5 steps · 1 exercise
Decorator: wrap, don't subclass
Add logging, caching or retries around an object by wrapping it.
- The subclass explosion problem
- Wrapping behind the same interface
- Stacking decorators in order
- Where Spring and React already do this
Lesson 8Intermediate10 min · 5 steps · 1 exercise
Proxy: a stand-in with the same face
Control access to an object without the caller noticing.
- What a proxy is
- Lazy, protection, remote and caching proxies
- How Spring builds proxies for you
- The self-call trap
Lesson 9Intermediate8 min · 5 steps · 1 exercise
Composite: trees of the same thing
Let a single item and a group of items answer the same questions.
- Part-whole hierarchies
- Leaf and composite share an interface
- Recursion does the work
- UI trees, file systems, price rules
Lesson 10Advanced8 min · 5 steps · 1 exercise
Flyweight
Share the identical part of many small objects to save memory.
- Intrinsic and extrinsic state
- Sharing immutable parts
- Caches and interning
- When memory really matters
Lesson 11Intermediate10 min · 5 steps · 1 exercise
Observer: tell everyone who cares
One thing changes, many things react, and the source does not know who they are.
- The problem of hard-wired notifications
- Subject, observers and subscribe
- Where you already use it: events, Flow, listeners
- Leaks and ordering
Lesson 12Intermediate10 min · 5 steps · 1 exercise
Command: a request as an object
Wrap what to do in a value, so you can queue it, log it, retry it or undo it.
- An action as data
- Undo and redo
- Queues, retries and audit logs
- Commands in CQRS and use cases
Lesson 13Intermediate10 min · 5 steps · 1 exercise
State: a lifecycle without the if-jungle
When behaviour depends on a stage, give each stage its own type.
- Status fields and scattered conditions
- One type per state
- Legal transitions in one place
- Sealed classes as a state machine
Lesson 14Intermediate8 min · 5 steps · 1 exercise
Template Method
The order of steps is fixed. Some of the steps are left to subclasses, or to functions you pass in.
- An algorithm skeleton with open steps
- Hooks
- Template Method versus Strategy
- The modern form: pass a function
Lesson 15Intermediate10 min · 5 steps · 1 exercise
Chain of Responsibility
A request walks through handlers. Each one acts, passes it on, or stops it.
- A pipeline of handlers
- Pass on or short-circuit
- Middleware and filters
- Order matters
Lesson 16Beginner8 min · 5 steps · 1 exercise
Iterator
Walk through a collection without knowing how it is stored.
- The problem of exposing internals
- Iterator and Iterable
- Lazy sequences
- Iterators in your language
Lesson 17Intermediate9 min · 5 steps · 1 exercise
Mediator
Let a central object coordinate many parts instead of them all talking to each other.
- The web of dependencies
- A coordinator in the middle
- Mediator versus Observer
- Risks: the god mediator
Lesson 18Intermediate8 min · 5 steps · 1 exercise
Memento
Save and restore an object's state without exposing its internals: undo, drafts and snapshots.
- Undo needs snapshots
- Originator, memento, caretaker
- Immutable state makes it easy
- Memory limits
Lesson 19Advanced10 min · 5 steps · 1 exercise
Visitor
Add new operations to a fixed set of types without editing each type, and its modern replacement.
- Operations across a type hierarchy
- Double dispatch
- Sealed types with when
- Choosing between them
Lesson 20Intermediate9 min · 5 steps · 1 exercise
Patterns in functional style
Many classic patterns become a function, a lambda or a higher-order function.
- Strategy as a lambda
- Decorator as function composition
- Command as a value
- Template Method as a parameter
Lesson 21Intermediate10 min · 5 steps · 1 exercise
Anti-patterns and pattern overuse
God objects, anaemic models, service locators and pattern fever: how to spot and fix them.
- God object
- Anaemic domain model
- Service locator and hidden dependencies
- Pattern fever
Clean Architecture17 lessons⏱ 173 minThis is the shape of the Ayvoren site and of the code you will lead at work: rules in the middle, details at the edge.
Lesson 1Beginner9 min · 5 steps · 1 exercise
What software architecture is
The decisions that are expensive to change later, and how to keep them cheap.
- Architecture versus design
- Why the goal is cheap change
- Keeping options open
- What an architect actually does
Lesson 2Beginner10 min · 5 steps · 1 exercise
Coupling and cohesion
Things inside a module should belong together. Modules should know little about each other.
- Coupling: how much one part knows about another
- Cohesion: how much a part belongs together
- Kinds of coupling
- How to measure it in a review
Lesson 3Intermediate12 min · 5 steps · 1 exercise
SOLID in one example
Five principles, shown by fixing one class that does too much.
- Single responsibility as 'one reason to change'
- Open for extension, closed for edits
- Substitution, interface segregation, inversion
- When SOLID is too much
Lesson 4Beginner9 min · 5 steps · 1 exercise
Layered architecture and its limits
The classic controller, service, repository stack: useful, and where it breaks.
- The three classic layers
- What each layer may call
- Where layers go wrong
- Why the dependency rule improves on it
Lesson 5Intermediate12 min · 6 steps · 1 exercise
The dependency rule
Point every import inward so the business rules never know about the database or the framework.
- The four rings and what lives in each
- Ports and adapters, in plain words
- How to test a use case with no database
- How a linter can enforce the rule
Lesson 6Intermediate11 min · 6 steps · 1 exercise
Entities and use cases
The two inner rings: business objects with rules, and the stories that use them.
- Entities: rules that would exist without software
- Use cases: one user goal each
- Input and output models
- What does not belong inside
Lesson 7Intermediate11 min · 6 steps · 1 exercise
Ports and adapters in depth
Hexagonal architecture: driving adapters call in, driven adapters are called out.
- The hexagon picture
- Driving (primary) ports and adapters
- Driven (secondary) ports and adapters
- Swapping adapters for tests and for change
Lesson 8Intermediate10 min · 5 steps · 1 exercise
Crossing boundaries with mappers
Keep database rows, API payloads and domain objects separate, and map between them.
- Why one class for everything leaks
- Entity, DTO and domain model roles
- Mapping at the edge
- The cost, and when to share
Lesson 9Intermediate12 min · 6 steps · 1 exercise
Value objects, entities and aggregates
Domain-driven design's building blocks, in plain words.
- Value objects: defined by their value
- Entities: defined by their identity
- Aggregates: a consistency boundary
- Rules for aggregate size and references
Lesson 10Advanced11 min · 6 steps · 1 exercise
Bounded contexts and shared language
The same word means different things in different parts of a business. Let it.
- Ubiquitous language
- Why one big model fails
- Bounded contexts
- Context maps and anti-corruption layers
Lesson 11Intermediate10 min · 5 steps · 1 exercise
Domain events
Announce that something important happened, and let other parts react.
- What a domain event is
- Decoupling side effects
- In-process versus across services
- The outbox pattern
Lesson 12Beginner8 min · 5 steps · 1 exercise
Package by feature, screaming architecture
Let the folder tree say what the app does, not which framework it uses.
- Package by layer versus by feature
- Screaming architecture
- Visibility: keep internals internal
- Mixing both
Lesson 13Advanced11 min · 5 steps · 1 exercise
The modular monolith
One deployable app, split into strong modules. Often the best first architecture.
- Monolith, microservices, and the middle
- What makes a module strong
- Communication between modules
- When to split a module out
Lesson 14Advanced10 min · 5 steps · 1 exercise
CQRS: separate reads from writes
Use one model to change data and another, simpler one to read it.
- Why one model struggles with both
- Commands and queries
- Read models
- When CQRS is worth it
Lesson 15Intermediate10 min · 5 steps · 1 exercise
Testing each ring
Fast tests for the core, a few slower ones for the adapters, very few end to end.
- The test pyramid
- Unit tests for entities and use cases
- Integration tests for adapters
- A few end-to-end tests
Lesson 16Intermediate9 min · 5 steps · 1 exercise
Guarding the architecture automatically
Turn your diagrams into tests that fail when someone breaks a boundary.
- Why architecture erodes
- Fitness functions
- ArchUnit, Konsist, ESLint rules
- Other things worth measuring
Lesson 17Beginner8 min · 5 steps · 1 exercise
Architecture decision records
Write down why you chose, so the next person does not undo it by accident.
- What an ADR is
- The short template
- Talking about trade-offs
- Superseding a decision
4 · Backend
Databases in depth13 lessons⏱ 141 minMost systems are a database with code around it. Architects who read query plans and model data well prevent the worst outages.
Lesson 1Beginner9 min · 5 steps · 1 exercise
The relational model
Tables, rows, keys and relationships: the ideas under every SQL database.
- Tables and rows
- Primary and foreign keys
- One-to-many and many-to-many
- Constraints protect data
Lesson 2Beginner11 min · 6 steps · 1 exercise
SQL queries: select, join and group
Ask questions of your data with SELECT, WHERE, JOIN, GROUP BY and ORDER BY.
- SELECT and WHERE
- Joins
- GROUP BY and aggregates
- Order of execution
Lesson 3Intermediate11 min · 5 steps · 1 exercise
Window functions and CTEs
Rankings, running totals and readable multi-step queries.
- Common table expressions
- Window functions
- Ranking and running totals
- Upserts
Lesson 4Intermediate11 min · 6 steps · 1 exercise
Modelling data for an application
Normalise first, denormalise on purpose, and model from access patterns.
- Normal forms in plain words
- When to denormalise
- IDs, time and money
- Soft deletes and history
Lesson 5Intermediate12 min · 6 steps · 1 exercise
How indexes really work
B-trees, composite index order, covering indexes and the cost of every index.
- Full scans versus index lookups
- The B-tree
- Composite indexes and column order
- Partial, covering and the write cost
Lesson 6Intermediate12 min · 6 steps · 1 exercise
Reading query plans with EXPLAIN
See what the database actually does, and fix slow queries with evidence.
- EXPLAIN versus EXPLAIN ANALYZE
- Scan types
- Join algorithms
- Estimates versus reality
Lesson 7Intermediate11 min · 6 steps · 1 exercise
Transactions and isolation levels
What a transaction promises, and the strange bugs when two of them run at the same time.
- ACID in plain words
- Dirty reads and lost updates
- Isolation levels
- Optimistic versus pessimistic locking
Lesson 8Advanced12 min · 6 steps · 1 exercise
Concurrency: MVCC, locks and deadlocks
How many transactions run at once, and how to avoid lost updates and deadlocks.
- MVCC: readers do not block writers
- Row locks and SELECT FOR UPDATE
- Deadlocks
- Queues with SKIP LOCKED
Lesson 9Intermediate10 min · 6 steps · 1 exercise
Connections and pooling
Why connections are expensive, how to size pools, and when to add PgBouncer.
- The cost of a connection
- Application pools
- Sizing a pool
- PgBouncer and serverless
Lesson 10Intermediate10 min · 5 steps · 1 exercise
PostgreSQL superpowers
JSONB, full-text search, partial and expression indexes, and extensions before adding new systems.
- JSONB for flexible fields
- Full-text search
- Expression indexes
- Extensions: pgvector, PostGIS, pg_cron
Lesson 11Advanced11 min · 6 steps · 1 exercise
Big tables: partitioning, vacuum and archiving
Keep a table with billions of rows fast and maintainable.
- Why big tables slow down
- Partitioning by time
- Vacuum and bloat
- Archiving and retention
Lesson 12Intermediate10 min · 6 steps · 1 exercise
Backups, recovery and disaster drills
RPO, RTO, point-in-time recovery, and restores you have actually tested.
- RPO and RTO
- Snapshots and point-in-time recovery
- Replicas are not backups
- Restore drills
Lesson 13Advanced11 min · 6 steps · 1 exercise
Modelling for NoSQL
Design key-value and document databases from access patterns, single-table design, and when to choose them.
- Start from access patterns
- Partition keys and hot partitions
- Document modelling
- When NoSQL fits
Networking for architects12 lessons⏱ 126 minEvery distributed system is computers sending bytes to each other. Know the road before you design the traffic.
Lesson 1Beginner9 min · 5 steps · 1 exercise
How the internet works: layers
A network is a stack of simple jobs. Learn the stack and every tool makes sense.
- Why networks are built in layers
- The four layers of TCP/IP
- Encapsulation: envelopes in envelopes
- Which layer each tool works at
Lesson 2Beginner11 min · 5 steps · 1 exercise
IP addresses, subnets and NAT
IPv4, IPv6, CIDR blocks, private ranges and how your home shares one address.
- IPv4 and IPv6
- CIDR: what /24 means
- Private address ranges
- NAT and why servers behind it are unreachable
Lesson 3Intermediate11 min · 5 steps · 1 exercise
DNS in depth
Resolvers, record types, TTLs, and why 'it's always DNS'.
- The resolution chain
- Record types: A, AAAA, CNAME, MX, TXT
- TTL and caching
- DNS for load balancing and failover
Lesson 4Beginner10 min · 5 steps · 1 exercise
Addresses, ports, TCP and UDP
How a message finds one program on one machine among billions.
- IP addresses and ports
- Packets and routing
- TCP: ordered and reliable
- UDP: fast and unguaranteed
Lesson 5Intermediate11 min · 6 steps · 1 exercise
TCP connections in depth
Handshakes, slow start, keep-alive, and why the first request is the slowest.
- The three-way handshake
- Flow and congestion control
- Connection reuse and pools
- Head-of-line blocking
Lesson 6Beginner12 min · 5 steps · 1 exercise
HTTP in depth
Requests, responses, status codes, and what changed from HTTP/1.1 to HTTP/3.
- Method, path, headers, body
- Status code families
- Stateless requests and cookies
- HTTP/1.1, HTTP/2 and HTTP/3
Lesson 7Intermediate12 min · 6 steps · 1 exercise
HTTP caching, cookies and CORS
Headers that make the web fast, keep users logged in, and keep sites apart.
- Cache-Control and ETag
- Cookies and their flags
- The same-origin policy
- CORS without the confusion
Lesson 8Intermediate10 min · 5 steps · 1 exercise
HTTPS and TLS
What the padlock really guarantees, and what it does not.
- Why plain HTTP is readable by anyone on the path
- Certificates and trust
- The TLS handshake in plain words
- What HTTPS does not protect
Lesson 9Beginner9 min · 5 steps · 1 exercise
Proxies and reverse proxies
Who stands between client and server, and what they can do there.
- Forward proxy versus reverse proxy
- What a reverse proxy does
- TLS termination
- Real client IPs and headers
Lesson 10Intermediate11 min · 5 steps · 1 exercise
Cloud networks: VPCs, subnets and firewalls
How to lay out a private network in AWS, GCP or Azure.
- The VPC
- Public and private subnets
- Security groups and network ACLs
- Reaching the internet and other networks
Lesson 11Beginner10 min · 5 steps · 1 exercise
Network debugging tools
ping, traceroute, dig, curl, ss and Wireshark: what each one tells you.
- Reachability: ping and traceroute
- Names: dig and nslookup
- HTTP: curl -v
- Sockets and packets: ss, tcpdump, Wireshark
Lesson 12Intermediate10 min · 5 steps · 1 exercise
Network performance for the web
Fewer round trips, fewer bytes, closer servers.
- Round trips dominate
- Compression and modern formats
- Preconnect, preload and HTTP/2
- Measuring real users
Spring Boot18 lessons⏱ 200 minSpring is the outer ring that serves your core over HTTP. Learn how it wires things so you keep it there.
Lesson 1Intermediate12 min · 5 steps · 1 exercise
Injection, layers and transactions
Constructor injection, controller to service to repository, and where @Transactional belongs.
- What the container does for you
- Why constructor injection beats field injection
- What each layer is allowed to do
- Where the transaction boundary goes
Lesson 2Intermediate10 min · 5 steps · 1 exercise
How auto-configuration decides
Why adding one dependency gives you a working database connection, and how to see and override it.
- Starters: dependencies as features
- Conditional beans
- Your bean always wins
- Reading the conditions report
Lesson 3Intermediate10 min · 5 steps · 1 exercise
Configuration and profiles
One build, many environments, and no secret in the code.
- Where properties come from and which wins
- Type-safe @ConfigurationProperties
- Profiles for dev, test and production
- Secrets belong outside the repository
Lesson 4Intermediate12 min · 6 steps · 1 exercise
Designing a REST API
Resources, status codes, DTOs and pagination that clients can rely on.
- Resources and methods
- The right status code for each outcome
- DTOs: never expose entities
- Pagination and stable contracts
Lesson 5Intermediate10 min · 5 steps · 1 exercise
Validation and error responses
Reject bad input early and return errors every client can read.
- Bean Validation at the controller
- One global exception handler
- ProblemDetail, the standard error body
- Do not leak stack traces
Lesson 6Intermediate12 min · 5 steps · 1 exercise
Spring Data JPA
Entities, repositories and queries, and what happens between your code and the database.
- An entity and its identity
- Repositories and derived queries
- The persistence context
- Relationships and fetch types
Lesson 7Advanced12 min · 5 steps · 1 exercise
The N+1 query problem
See how one list screen fires 101 queries, and how to make it fire 1.
- How lazy loading hides queries
- Reading the SQL log
- Fetch join and entity graphs
- Projections when you need only a few columns
Lesson 8Advanced12 min · 5 steps · 1 exercise
Transactions in depth
Rollback rules, propagation and read-only, and the mistakes that silently disable them.
- What rolls back and what does not
- Propagation: joining or starting a transaction
- Read-only and isolation
- Three ways the annotation is ignored
Lesson 9Intermediate10 min · 6 steps · 1 exercise
Database migrations with Flyway
Version your schema like code, and change it without downtime.
- Why not ddl-auto
- Versioned migrations
- Expand and contract
- Testing migrations
Lesson 10Intermediate12 min · 5 steps · 1 exercise
Testing a Spring Boot application
Fast tests for rules, sliced tests for the web and data layers, and a few full tests with a real database.
- Unit tests with no Spring
- Slices: @WebMvcTest and @DataJpaTest
- @SpringBootTest for the whole thing
- Testcontainers for a real database
Lesson 11Intermediate10 min · 6 steps · 1 exercise
Caching in Spring
@Cacheable, eviction, TTLs and Redis, without serving stale or wrong data.
- @Cacheable, @CachePut, @CacheEvict
- Choosing keys
- Local cache or Redis
- TTL and invalidation
Lesson 12Advanced12 min · 5 steps · 1 exercise
Calling other services safely
Timeouts, retries and circuit breakers, so a slow dependency does not become your outage.
- RestClient and declarative clients
- Timeouts: always
- Retries with backoff, only when safe
- Circuit breakers and fallbacks
Lesson 13Advanced11 min · 6 steps · 1 exercise
Reactive Spring with WebFlux
Non-blocking web apps with Mono and Flux, and when virtual threads are the simpler choice.
- Blocking versus non-blocking
- Mono and Flux
- WebClient and backpressure
- WebFlux or virtual threads?
Lesson 14Intermediate10 min · 5 steps · 1 exercise
Scheduled jobs and async work
@Scheduled, @Async, and safe background jobs when you run several instances.
- @Scheduled with cron and rates
- @Async and executors
- Jobs on several instances
- Making jobs safe to rerun
Lesson 15Advanced12 min · 6 steps · 1 exercise
Messaging with Kafka in Spring
Publish events, consume them safely, and handle failures with retries and dead-letter topics.
- KafkaTemplate and @KafkaListener
- Keys, partitions and ordering
- At-least-once and idempotent consumers
- Retries, dead letters and the outbox
Lesson 16Intermediate10 min · 5 steps · 1 exercise
Actuator and observability
Health, metrics, logs and traces: how you find out what is wrong before the users do.
- Health and probes
- Metrics with Micrometer
- Structured logs and correlation ids
- Traces across services
Lesson 17Intermediate11 min · 6 steps · 1 exercise
Packaging and deploying Spring Boot
Containers, layered images, health probes, graceful shutdown and native images.
- Executable jars and layered images
- Configuration from the environment
- Health probes and graceful shutdown
- GraalVM native images
Lesson 18Advanced12 min · 5 steps · 1 exercise
Spring Security
The filter chain, authentication, authorization, and securing an API without fighting the framework.
- The security filter chain
- Authentication versus authorization
- Stateless APIs with tokens
- Method security
5 · System design
System design: foundations5 lessons⏱ 50 minBefore scaling anything, know what one request costs and how to measure it.
Lesson 1Beginner10 min · 5 steps · 1 exercise
How to approach any design problem
A simple order of questions that works for interviews and for real projects.
- Start with requirements, not boxes
- Functional versus non-functional
- The six steps
- Talking about trade-offs
Lesson 2Beginner10 min · 5 steps · 1 exercise
The journey of one request
Follow a page load hop by hop and see where the time goes.
- DNS: turning a name into an address
- Why a connection costs round trips
- Browser, server, database and back
- Where the waiting really happens
Lesson 3Beginner10 min · 5 steps · 1 exercise
Latency and throughput
Two numbers describe any system: how long one request takes, and how many it handles.
- Latency versus throughput
- Why averages hide pain
- Percentiles: p50, p95, p99
- What happens at saturation
Lesson 4Intermediate10 min · 5 steps · 1 exercise
Availability, SLOs and error budgets
How much downtime is acceptable, and how to decide it with numbers.
- What 99.9% really means
- SLI, SLO and SLA
- Error budgets
- Availability of chained parts
Lesson 5Intermediate10 min · 5 steps · 1 exercise
Back-of-the-envelope estimates
Turn a vague product idea into rough numbers in two minutes.
- Why rough numbers are enough
- Users to requests per second
- Storage per year
- Peak versus average
Scaling out6 lessons⏱ 62 minOne server runs out. These are the standard moves, in the order you reach for them.
Lesson 1Beginner10 min · 5 steps · 1 exercise
Bigger machine or more machines
Vertical and horizontal scaling, and the load balancer that makes the second possible.
- Scaling up and its ceiling
- Scaling out and its cost
- What a load balancer does
- Health checks
Lesson 2Intermediate11 min · 5 steps · 1 exercise
Load balancing in depth
How a load balancer chooses a server, notices failures, and where it sits.
- Layer 4 versus layer 7
- Round robin, least connections, hashing
- Health checks
- Avoiding a single point of failure
Lesson 3Intermediate10 min · 5 steps · 1 exercise
Stateless services
Why a server that remembers nothing is the one you can copy.
- What state on a server means
- The sticky session trap
- Moving state to a shared store
- Why it makes deploys easy
Lesson 4Intermediate12 min · 5 steps · 1 exercise
Caching
Answer from memory instead of asking again, and know when the memory is wrong.
- What to cache and where
- Cache-aside in four steps
- Expiry and invalidation
- Stampedes
Lesson 5Beginner8 min · 5 steps · 1 exercise
Content delivery networks
Serve files from a place near each user.
- Why distance costs time
- Edge servers
- What belongs on a CDN
- Cache headers and versioned files
Lesson 6Intermediate11 min · 5 steps · 1 exercise
Rate limiting
Protect a system from too many requests, whether from a bug, a crawler or an attack.
- Why limit
- Fixed window, sliding window, token bucket
- Where to put the limiter
- What to tell the client
Data at scale6 lessons⏱ 66 minServers are easy to copy. Data is not. Most hard design questions live here.
Lesson 1Intermediate12 min · 5 steps · 1 exercise
Choosing data stores for a system
One system, several stores: pick each one by the questions you will ask it.
- Indexes, in one sentence
- One store per kind of question
- SQL or NoSQL
- A decision table by access pattern
Lesson 2Advanced12 min · 6 steps · 1 exercise
Idempotency keys and distributed locks
When one database transaction cannot cover the whole job: safe retries and locks across machines.
- Why one transaction is not enough
- Idempotency keys that store the first answer
- Distributed locks are leases
- Fencing tokens
Lesson 3Intermediate10 min · 5 steps · 1 exercise
Replication
Copies of the database for safety and for read capacity, and the lag that comes with them.
- Leader and followers
- Scaling reads
- Replication lag
- Failover
Lesson 4Advanced12 min · 5 steps · 1 exercise
Sharding and consistent hashing
Split the data across machines, and move as little as possible when you add one.
- Why sharding is a last resort
- Choosing a shard key
- The problem with modulo
- Consistent hashing
Lesson 5Advanced10 min · 5 steps · 1 exercise
CAP and consistency
When machines cannot talk to each other, you must choose what to give up.
- What a partition is
- Consistency versus availability
- Strong and eventual consistency
- Choosing per feature
Lesson 6Intermediate10 min · 5 steps · 1 exercise
Files, object storage and search
Where to keep photos and videos, and how to make text searchable.
- Why files do not belong in the database
- Object storage and pre-signed URLs
- Full-text search with an index
- Keeping the search index in sync
Messaging4 lessons⏱ 45 minNot everything has to happen while the user waits. Queues are how systems breathe.
Lesson 1Intermediate11 min · 5 steps · 1 exercise
REST, gRPC and GraphQL
Three ways for services and clients to ask each other things, and when each fits.
- REST: resources and HTTP verbs
- gRPC: fast typed calls between services
- GraphQL: the client chooses the fields
- Versioning and pagination
Lesson 2Intermediate12 min · 5 steps · 1 exercise
Message queues
Hand work to a queue so a slow or broken part does not stop the rest.
- Synchronous versus asynchronous
- Producers, queues and consumers
- At-least-once and idempotency
- Backpressure and dead letters
Lesson 3Advanced12 min · 5 steps · 1 exercise
Pub/sub and event streams
One event, many readers, and a log you can replay.
- Queue versus pub/sub
- Kafka's log, partitions and offsets
- Consumer groups
- Ordering and replay
Lesson 4Intermediate10 min · 5 steps · 1 exercise
Real-time updates: polling, SSE, WebSockets
Send news to the user the moment it happens.
- Polling and long polling
- Server-sent events
- WebSockets
- Scaling many open connections
Reliability4 lessons⏱ 44 minEverything fails eventually. Reliable systems are the ones designed for it.
Lesson 1Intermediate11 min · 5 steps · 1 exercise
Timeouts, retries and backoff
Never wait forever, retry carefully, and do not turn a hiccup into a storm.
- Why every call needs a timeout
- Which errors to retry
- Exponential backoff with jitter
- Idempotency keys
Lesson 2Intermediate11 min · 5 steps · 1 exercise
Circuit breakers, bulkheads and graceful degradation
Stop calling what is broken, and keep failures in their own compartment.
- The circuit breaker states
- Bulkheads: separate pools
- Fallbacks and degraded modes
- Load shedding
Lesson 3Advanced11 min · 5 steps · 1 exercise
Redundancy, failover and disaster recovery
Keep a spare for everything that matters, and practise switching to it.
- Single points of failure
- Zones and regions
- Active-passive versus active-active
- RPO, RTO and backups you have tested
Lesson 4Intermediate11 min · 6 steps · 1 exercise
Observability: logs, metrics and traces
See what your system is doing in production, and find the cause fast.
- Logs, metrics, traces: what each is for
- The four golden signals
- Alerts that matter
- On-call and blameless postmortems
Distributed services4 lessons⏱ 44 minWhen one system becomes many, new problems appear: finding each other, agreeing, and failing halfway.
Lesson 1Intermediate11 min · 5 steps · 1 exercise
Microservices: when and why
Independent services buy team speed, and cost a lot of complexity.
- What a microservice is
- What you gain
- What you pay
- Signs you are ready
Lesson 2Intermediate10 min · 5 steps · 1 exercise
API gateways, service discovery and service mesh
How clients find services, and how services find each other.
- The API gateway
- Backend for frontend
- Service discovery
- What a service mesh adds
Lesson 3Advanced12 min · 5 steps · 1 exercise
Sagas: transactions across services
When one database transaction is impossible, use a chain of steps that can be undone.
- Why two-phase commit is avoided
- Saga steps and compensations
- Choreography versus orchestration
- Designing for 'pending' states
Lesson 4Advanced11 min · 5 steps · 1 exercise
Consensus and leader election
How a group of machines agrees on one answer, even when some fail.
- Why agreement is hard
- Leaders and followers
- Quorums and majorities
- Raft in plain words, and where it is used
Case studies5 lessons⏱ 70 minPut every chapter together on real products, the way interviews and real projects do.
Lesson 1Intermediate14 min · 6 steps · 1 exercise
Design a URL shortener
Short codes, very fast redirects, and billions of rows.
- Requirements and numbers
- Generating short codes
- Storage and the read path
- Analytics without slowing redirects
Lesson 2Advanced15 min · 6 steps · 1 exercise
Design a news feed
Show each user the latest posts from people they follow, fast.
- Pull versus push (fan-out)
- The celebrity problem
- Feed storage and ranking
- Pagination and caching
Lesson 3Advanced15 min · 6 steps · 1 exercise
Design a chat app
Deliver messages in order, in real time, across devices, even after being offline.
- Connections and presence
- Message flow and storage
- Ordering and delivery receipts
- Group chats
Lesson 4Advanced14 min · 6 steps · 1 exercise
Design video upload and streaming
Accept huge uploads, convert them, and play smoothly on any connection.
- Resumable direct uploads
- A transcoding pipeline
- Adaptive bitrate streaming
- CDN and cost
Lesson 5Intermediate12 min · 5 steps · 1 exercise
Design a notification system
Send email, SMS and push reliably, without spamming anyone.
- One API for every channel
- Queues per channel
- Preferences, limits and templates
- Retries and deduplication
Architecture styles11 lessons⏱ 116 minAn architect's first job is choosing the shape of a system and explaining why. This is the menu, with the trade-offs.
Lesson 1Intermediate11 min · 5 steps · 1 exercise
Architecture styles: a map
Layered, modular monolith, hexagonal, microkernel, event-driven, microservices, serverless: what each is good at.
- Style versus pattern
- Monolithic and distributed styles
- What each style optimises
- There is no best style
Lesson 2Intermediate10 min · 6 steps · 1 exercise
Hexagonal, onion and clean compared
Three drawings of the same idea, and the small differences that matter in practice.
- The shared idea: dependencies point inward
- Hexagonal: ports and adapters
- Onion: rings of domain and services
- Clean: use cases as the centre of the app
Lesson 3Intermediate9 min · 5 steps · 1 exercise
Vertical slice architecture
Organise by feature from request to database, and keep each slice independent.
- Layers spread a feature across folders
- A slice per use case
- Sharing without coupling
- Slices inside a hexagon
Lesson 4Intermediate9 min · 5 steps · 1 exercise
Microkernel (plugin) architecture
A small core plus plugins: how IDEs, browsers and rule engines stay extensible.
- Core and plugins
- Plugin contracts and registries
- Isolation and versioning
- Where it fits
Lesson 5Advanced12 min · 6 steps · 1 exercise
Event-driven architecture
Choreography and orchestration, event types, and how to keep an event-driven system understandable.
- Events, commands and notifications
- Choreography
- Orchestration
- Tracing and contracts
Lesson 6Advanced11 min · 6 steps · 1 exercise
Event sourcing
Store what happened, not just the current state, and derive views from the events.
- State versus history
- Events as the source of truth
- Projections and snapshots
- When it is worth it
Lesson 7Intermediate10 min · 6 steps · 1 exercise
Serverless architecture
Functions and managed services, cold starts, limits, and costs at different scales.
- Functions as a service
- Managed building blocks
- Cold starts and limits
- When the bill flips
Lesson 8Advanced11 min · 6 steps · 1 exercise
Multi-tenant SaaS architecture
One product, many customers: isolation models, noisy neighbours and per-tenant data.
- Tenant, user and account
- Silo, pool and bridge models
- Isolating data safely
- Noisy neighbours and limits
Lesson 9Advanced11 min · 6 steps · 1 exercise
Migrating legacy: strangler fig and anti-corruption layers
Replace an old system piece by piece, without a big-bang rewrite.
- Why big rewrites fail
- Strangler fig
- Anti-corruption layer
- Data migration and cut-over
Lesson 10Beginner10 min · 5 steps · 1 exercise
Drawing architecture with the C4 model
Context, containers, components and code: diagrams people actually understand.
- Why boxes and arrows confuse
- The four levels
- Diagrams as code
- Keeping diagrams alive
Lesson 11Advanced12 min · 6 steps · 1 exercise
Quality attributes and choosing a style
Turn vague wishes into measurable scenarios, then compare styles on the trade-offs.
- Functional versus quality requirements
- Quality attribute scenarios
- Trade-off analysis
- Writing the decision down
6 · Security
Security for architects14 lessons⏱ 157 minAn architect is responsible for what happens when someone uses the system on purpose in the wrong way.
Lesson 1Beginner10 min · 5 steps · 1 exercise
The security mindset and threat modelling
Think like someone trying to misuse your system, before they do.
- Confidentiality, integrity, availability
- Attack surface
- Threat modelling with STRIDE
- Defense in depth
Lesson 2Beginner11 min · 5 steps · 1 exercise
The OWASP Top 10 tour
The ten most common web application risks, and the one defense for each.
- What OWASP is
- The current top risks
- The defense for each
- Using it in reviews
Lesson 3Intermediate12 min · 5 steps · 1 exercise
Injection
When data is treated as code, an attacker writes your query for you.
- How SQL injection works
- Parameterised queries
- Why escaping by hand fails
- Least privilege for the database user
Lesson 4Intermediate12 min · 5 steps · 1 exercise
XSS and CSRF
Two attacks that make a victim's own browser work for the attacker.
- Cross-site scripting
- Escaping output by default
- Cross-site request forgery
- SameSite cookies and tokens
Lesson 5Intermediate12 min · 5 steps · 1 exercise
Authentication
Proving who someone is, without ever storing their password.
- Hashing passwords with a slow, salted algorithm
- Sessions versus tokens
- Where to keep a token
- Multi-factor authentication
Lesson 6Advanced13 min · 6 steps · 1 exercise
OAuth 2, OpenID Connect and JWT
Log in with another provider and call APIs on a user's behalf, safely.
- OAuth is about access, OIDC about identity
- The authorization code flow with PKCE
- Access tokens, refresh tokens, ID tokens
- Validating a JWT
Lesson 7Advanced11 min · 6 steps · 1 exercise
Zero trust: passkeys and service identity
Trust no network by default: phishing-proof logins for people, and real identities for services and pipelines.
- Why a trusted network is a weak wall
- Passkeys for people
- mTLS for services
- No static keys in pipelines
Lesson 8Advanced12 min · 5 steps · 1 exercise
Authorization and secrets
Being logged in is not the same as being allowed. And keys do not belong in code.
- Authentication versus authorization
- Broken access control and IDOR
- Least privilege
- Managing secrets
Lesson 9Intermediate11 min · 6 steps · 1 exercise
Cryptography for developers
Hashing, encryption and signatures: which one, when, and never your own.
- Hashing versus encryption
- Symmetric and asymmetric keys
- Signatures and MACs
- Key management and randomness
Lesson 10Intermediate12 min · 6 steps · 1 exercise
Securing APIs
Validate everything, expose only what is needed, and assume the client is hostile.
- Validate input on the server
- Mass assignment and over-exposure
- Rate limits and resource limits
- SSRF and safe outgoing calls
Lesson 11Intermediate10 min · 5 steps · 1 exercise
Dependencies and the software supply chain
Most of your code is someone else's. Keep it known, updated and trusted.
- Why dependencies are a risk
- Scanning and updating
- Lock files and pinned versions
- Protecting the build pipeline
Lesson 12Advanced11 min · 5 steps · 1 exercise
Cloud and infrastructure security
Identities, permissions, networks and encryption for systems in the cloud.
- IAM and least privilege
- Workload identities instead of keys
- Encryption at rest and in transit
- Containers and Kubernetes basics
Lesson 13Intermediate10 min · 5 steps · 1 exercise
Detection and incident response
Notice attacks, respond calmly, and learn without blame.
- What to log for security
- What never to log
- Detection and alerts
- The incident response steps
Lesson 14Beginner10 min · 5 steps · 1 exercise
Privacy by design and GDPR basics
Collect less, protect what you keep, and let people control their data.
- Personal data and why it matters
- Data minimisation
- User rights: access, deletion, export
- Retention and pseudonymisation
7 · Delivery and cloud
Testing strategy12 lessons⏱ 121 minFast delivery is only safe with tests people trust. Architects decide where confidence comes from and what it costs.
Lesson 1Beginner9 min · 6 steps · 1 exercise
What a test strategy is for
Tests buy confidence to change code. Decide where that confidence comes from, based on risk.
- Tests as a safety net for change
- Risk decides what to test
- Fast feedback
- Writing the strategy down
Lesson 2Beginner10 min · 6 steps · 1 exercise
The test pyramid, trophy and honeycomb
How many tests at each level, and why the right shape depends on the architecture.
- Levels of tests
- The pyramid
- The trophy and the honeycomb
- Choosing your shape
Lesson 3Intermediate10 min · 6 steps · 1 exercise
Test doubles: fakes, stubs, mocks and spies
Replace slow or external parts in tests, and choose the right kind of double.
- Why replace dependencies
- Dummy, stub, spy, mock, fake
- Over-mocking
- Fakes behind ports
Lesson 4Intermediate11 min · 6 steps · 1 exercise
Integration tests with real dependencies
Test adapters against real databases, queues and services in containers.
- What integration tests prove
- Testcontainers
- Speed and isolation
- Testing external HTTP services
Lesson 5Advanced11 min · 6 steps · 1 exercise
Contract testing between services
Catch breaking API changes before deploy, without a full end-to-end environment.
- The integration problem in microservices
- Consumer-driven contracts
- Pact in practice
- Schemas and compatibility
Lesson 6Intermediate10 min · 6 steps · 1 exercise
End-to-end tests that stay useful
A few critical journeys through the real UI, stable selectors, and no sleeps.
- What only E2E tests catch
- Choosing journeys
- Stable, readable tests
- Where to run them
Lesson 7Intermediate9 min · 6 steps · 1 exercise
Test data: builders, fixtures and isolation
Readable test data, no shared state, and safe copies of production data.
- Data that hides intent
- Test data builders
- Isolation between tests
- Production data in tests
Lesson 8Intermediate10 min · 6 steps · 1 exercise
Flaky tests: causes and cures
Why tests fail randomly, how to find the cause, and how to keep the suite trusted.
- The cost of flakiness
- Common causes
- Finding the cause
- A quarantine policy
Lesson 9Advanced10 min · 6 steps · 1 exercise
Property-based testing and fuzzing
Let the computer generate thousands of inputs and find the edge cases you did not think of.
- Examples miss edge cases
- Properties instead of examples
- Shrinking
- Fuzzing parsers and APIs
Lesson 10Intermediate11 min · 6 steps · 1 exercise
Performance and load testing
Load, stress, spike and soak tests with clear goals, and how to read the results.
- Types of performance tests
- Goals from SLOs
- Writing a load test
- Reading results
Lesson 11Advanced9 min · 6 steps · 1 exercise
Coverage and mutation testing
What coverage does and does not tell you, and how mutation testing measures test strength.
- Line and branch coverage
- Coverage as a floor, not a goal
- Mutation testing
- Using it wisely
Lesson 12Advanced11 min · 6 steps · 1 exercise
Testing in production, safely
Canaries, synthetic checks, feature flags and chaos experiments: confidence where it really counts.
- Why pre-production is never enough
- Automated canary analysis as a test
- Synthetic monitoring
- Chaos engineering
DevOps and cloud13 lessons⏱ 139 minAn architecture is only as good as the way it is built, shipped and run. Architects design the delivery path too.
Lesson 1Beginner9 min · 6 steps · 1 exercise
DevOps and the four key metrics
What DevOps really means, and how to measure delivery with the DORA metrics.
- Dev and Ops as one flow
- The four DORA metrics
- Speed and stability together
- Small batches
Lesson 2Beginner10 min · 6 steps · 1 exercise
Branching, trunk-based development and feature flags
Integrate every day, hide unfinished work behind flags, and keep main releasable.
- Long-lived branches hurt
- Trunk-based development
- Feature flags
- Pull requests that flow
Lesson 3Beginner9 min · 5 steps · 1 exercise
The twelve-factor app
Configuration, logs, processes and disposability: rules that make apps easy to deploy anywhere.
- Config in the environment
- Stateless processes
- Logs as event streams
- Fast start, graceful stop
Lesson 4Beginner11 min · 6 steps · 1 exercise
Containers with Docker
Images, layers, multi-stage builds and small, safe containers.
- Containers versus virtual machines
- Images and layers
- A good Dockerfile
- Security basics
Lesson 5Beginner11 min · 6 steps · 1 exercise
Continuous integration pipelines
Every push is built, tested and checked automatically, fast enough that people wait for it.
- What CI checks
- A pipeline in GitHub Actions
- Fast feedback
- Build once, promote the artifact
Lesson 6Intermediate11 min · 6 steps · 1 exercise
Continuous delivery and GitOps
Environments, promotion, approvals and Git as the source of truth for what runs.
- Continuous delivery versus deployment
- Environments and promotion
- GitOps
- Rollbacks
Lesson 7Intermediate10 min · 5 steps · 1 exercise
Progressive delivery: rolling, blue-green, canary
Ship often without breaking production: release to a few servers or users first, and keep a fast way back.
- Why deploys cause most incidents
- Rolling and blue-green
- Canary releases
- Database changes during a rollout
Lesson 8Intermediate12 min · 6 steps · 1 exercise
Kubernetes basics
Pods, Deployments, Services and Ingress: what each object does and why.
- Why an orchestrator
- Pods and Deployments
- Services and Ingress
- Declarative desired state
Lesson 9Advanced12 min · 6 steps · 1 exercise
Kubernetes in production
Requests and limits, autoscaling, disruption budgets, config and secrets.
- Requests and limits
- Autoscaling
- Rollouts without downtime
- Config, secrets and namespaces
Lesson 10Intermediate12 min · 6 steps · 1 exercise
Infrastructure as code with Terraform
Describe networks, databases and permissions in code, review them, and apply them safely.
- Clicking in consoles does not scale
- Declarative infrastructure
- Plan, review, apply
- State, modules and drift
Lesson 11Intermediate12 min · 6 steps · 1 exercise
Cloud building blocks
Compute, storage, databases, messaging, identity and networking: the services you design with.
- Regions and availability zones
- Compute options
- Storage and databases
- Identity and managed services
Lesson 12Intermediate10 min · 5 steps · 1 exercise
Cloud costs and FinOps
See where the money goes, design for cost, and make cost a shared responsibility.
- Why cloud bills surprise
- Visibility: tags and budgets
- The big savings
- Cost as an architecture quality
Lesson 13Advanced10 min · 5 steps · 1 exercise
Platform engineering and golden paths
Give teams a paved road to build, ship and run services, so each team does not reinvent DevOps.
- Cognitive load on product teams
- Internal developer platforms
- Golden paths and templates
- Platform as a product
8 · Front end
React19 lessons⏱ 200 minReact is the UI model behind the web and React Native. Get state right and everything else follows.
Lesson 1Beginner10 min · 5 steps · 1 exercise
Components and props
A screen is built from small functions that return what to show.
- A component is a function that returns UI
- JSX is JavaScript with tags
- Props go down, never up
- Splitting a screen into components
Lesson 2Beginner10 min · 6 steps · 1 exercise
React with TypeScript
Type props, state, events and hooks so mistakes show up in the editor, not in production.
- Typing props
- State and events
- Union types for UI states
- Typing custom hooks and children
Lesson 3Beginner10 min · 5 steps · 1 exercise
State and rendering
What makes the screen change, and what really happens when you call a setter.
- useState gives a component memory
- Setting state asks for a new render
- State is a snapshot
- Never change state in place
Lesson 4Beginner8 min · 5 steps · 1 exercise
Lists and keys
Showing many items, and the small prop that decides whether React keeps or rebuilds them.
- Rendering a list with map
- What a key is for
- Why the index is a risky key
- Using a key to reset a component
Lesson 5Intermediate10 min · 5 steps · 1 exercise
Derive state, do not sync it
Cut the bugs that come from copying state into more state with useEffect.
- What counts as state and what does not
- Why syncing with useEffect is fragile
- Computing values during render
- When useMemo is actually needed
Lesson 6Intermediate12 min · 5 steps · 1 exercise
Effects
Running code that touches the world outside React, and cleaning up after it.
- What an effect is for
- The dependency array
- Cleanup
- When you do not need an effect
Lesson 7Intermediate10 min · 5 steps · 1 exercise
Custom hooks
Pull logic out of components so it can be reused and tested on its own.
- What a custom hook is and is not
- Extracting a hook from a component
- Returning a clear small API
- Rules of hooks, in one sentence
Lesson 8Intermediate10 min · 5 steps · 1 exercise
Composition over props
Stop adding boolean props. Pass children and let callers compose.
- Why a component grows twenty props
- children and slots
- Compound components
- Lifting state only as high as needed
Lesson 9Intermediate10 min · 5 steps · 1 exercise
Context and shared state
Getting a value to distant components, without passing it through every level.
- Prop drilling
- Context: provide once, read anywhere below
- The re-render cost
- When to use a store or a query library
Lesson 10Intermediate10 min · 5 steps · 1 exercise
Forms
Reading what the user types, checking it, and sending it.
- Controlled inputs
- Validation and error messages
- Submitting with an action
- Pending and optimistic states
Lesson 11Intermediate11 min · 6 steps · 1 exercise
Accessible React
Semantic HTML, labels, keyboard and focus, so everyone can use your app.
- Semantic elements first
- Labels and names
- Keyboard and focus
- Testing accessibility
Lesson 12Beginner10 min · 5 steps · 1 exercise
Styling React apps
CSS Modules, Tailwind, design tokens and dark mode, with styles that scale.
- Options: CSS, Modules, Tailwind, CSS-in-JS
- Design tokens
- Dark mode and themes
- Responsive layouts
Lesson 13Intermediate11 min · 6 steps · 1 exercise
Server state with TanStack Query
Caching, loading states, refetching and mutations without hand-written effects.
- Server state is not UI state
- useQuery and cache keys
- Mutations and invalidation
- Optimistic updates
Lesson 14Intermediate10 min · 5 steps · 1 exercise
Client state: when to use a store
useState, context, reducers, Zustand or Redux Toolkit: pick by need, not fashion.
- Kinds of state
- useReducer for complex local state
- Small stores with Zustand
- When Redux Toolkit fits
Lesson 15Advanced12 min · 5 steps · 1 exercise
Performance
Why a React app gets slow, how to find out, and the few fixes that matter.
- A render is not a DOM update
- Measure with the Profiler
- memo, useMemo, useCallback
- What the React Compiler does
Lesson 16Advanced12 min · 5 steps · 1 exercise
Loading, errors and transitions
What the user sees while waiting, when something breaks, and during a slow update.
- Error boundaries
- Suspense and fallbacks
- Transitions keep the UI responsive
- Designing the three states
Lesson 17Advanced12 min · 5 steps · 1 exercise
Server components and actions
Which code runs on the server, which runs in the browser, and why it matters.
- Server components: no JavaScript sent
- Client components for interactivity
- Passing data across the border
- Server actions
Lesson 18Intermediate12 min · 6 steps · 1 exercise
Next.js App Router
Routes from folders, layouts, Server Components, server actions and caching.
- Folders are routes
- Layouts and loading states
- Data on the server
- Server Actions and caching
Lesson 19Intermediate10 min · 5 steps · 1 exercise
Testing components
Test what the user sees and does, not how the component is built.
- Test behaviour, not implementation
- Find elements the way a user does
- Simulating real interaction
- What to mock
React Native16 lessons⏱ 169 minThe phone is where React meets limited memory and a main thread you must not block.
Lesson 1Beginner10 min · 5 steps · 1 exercise
Core components and layout
The few building blocks of every screen, and how flexbox places them.
- View, Text, Image, Pressable, ScrollView
- No HTML: text must be inside Text
- Flexbox: direction, justify, align
- flex: 1
Lesson 2Beginner10 min · 5 steps · 1 exercise
Styling for real devices
Notches, keyboards, dark mode and two platforms that do not look the same.
- StyleSheet and no cascade
- Safe areas
- The keyboard covering inputs
- Platform differences and dark mode
Lesson 3Intermediate10 min · 5 steps · 1 exercise
Navigation
Moving between screens the way phone users expect.
- Stacks and tabs
- Passing params
- Screens stay mounted
- Deep links
Lesson 4Intermediate10 min · 5 steps · 1 exercise
Fast lists
Why ScrollView plus map falls over, and what FlatList does about it.
- How list virtualisation works
- keyExtractor and why keys matter
- Stable renderItem and memoised rows
- When to give a fixed item height
Lesson 5Intermediate10 min · 5 steps · 1 exercise
Text input and forms
Typing on a phone is harder than on a desktop. Make it as easy as possible.
- TextInput and the right keyboard
- Autofill and return key
- Validation that helps
- Not blocking the user
Lesson 6Intermediate10 min · 5 steps · 1 exercise
Accessibility and languages on mobile
Screen readers, dynamic type, right-to-left layouts and translations.
- accessibilityLabel and roles
- Dynamic type and touch targets
- Translations with i18n
- Right-to-left and formats
Lesson 7Intermediate10 min · 5 steps · 1 exercise
Server data with a cache
Stop hand-writing loading states. Let a query cache own server data.
- Server state versus UI state
- Query keys and stale time
- Mutations and cache invalidation
- Offline and flaky networks
Lesson 8Intermediate10 min · 5 steps · 1 exercise
Storage and security on the device
Where to keep preferences, data and secrets, and what an attacker can read.
- Preferences, structured data, secrets
- Why AsyncStorage is not for tokens
- Keychain and Keystore
- Nothing secret in the bundle
Lesson 9Advanced11 min · 5 steps · 1 exercise
Offline-first and sync
Keep the app useful without network, queue changes, and resolve conflicts.
- Detecting connectivity
- Local database as the source of truth
- Queueing writes
- Conflicts
Lesson 10Intermediate10 min · 5 steps · 1 exercise
Push notifications
Permissions, tokens, sending through a server, and handling taps.
- How push works
- Asking for permission well
- Tokens and your server
- Handling taps and deep links
Lesson 11Advanced12 min · 5 steps · 1 exercise
Animations and gestures
Motion that stays smooth because it does not depend on the JavaScript thread.
- Why animations stutter
- Shared values and animated styles
- Springs and timing
- Gestures that follow the finger
Lesson 12Advanced12 min · 5 steps · 1 exercise
Keep the JS thread free
Why animations stutter, and how to move work off the thread that handles taps.
- JS thread versus UI thread
- What blocks the JS thread
- Running animations on the UI thread
- Deferring heavy work
Lesson 13Advanced10 min · 5 steps · 1 exercise
Profiling React Native performance
Find dropped frames, slow startup and memory leaks with the right tools.
- Frames: JS and UI threads
- React DevTools profiler
- Startup time and bundle size
- Memory leaks
Lesson 14Advanced12 min · 5 steps · 1 exercise
The New Architecture
How JavaScript talks to native code now, and why the old bridge was replaced.
- The old bridge and its cost
- JSI: direct calls
- Fabric and TurboModules
- Hermes
Lesson 15Intermediate10 min · 5 steps · 1 exercise
Expo and native code
What Expo does for you, and what to do when you need something native.
- Expo is the recommended start
- Development builds
- Config plugins
- Writing a native module
Lesson 16Advanced12 min · 5 steps · 1 exercise
Testing and releasing
From 'works on my phone' to an app in two stores that you can fix quickly.
- Unit, component and end-to-end tests
- Builds and signing
- Store review and staged rollout
- Over-the-air updates and monitoring
9 · Leading as an architect
The architect's job13 lessons⏱ 132 minTechnical knowledge gets you to the table. Deciding, writing, explaining and bringing people with you is the job itself.
Lesson 1Beginner9 min · 6 steps · 1 exercise
What an architect actually does
The kinds of architects, the work week, and the difference between designing and deciding.
- Architect roles
- Decide, explain, guide
- Staying hands-on
- Success is other people shipping well
Lesson 2Intermediate10 min · 6 steps · 1 exercise
Thinking in trade-offs
Every decision gives something up. Name it, and spend effort on the decisions that are hard to reverse.
- 'It depends' — on what?
- One-way and two-way doors
- Second-order effects
- Deciding with incomplete information
Lesson 3Intermediate11 min · 6 steps · 1 exercise
Writing design docs and RFCs
A short written proposal that gets reviewed before code is written.
- Why write before building
- A design doc template
- Alternatives considered
- Running the review
Lesson 4Intermediate10 min · 6 steps · 1 exercise
Explaining architecture to anyone
Adapt the message to engineers, product, executives and customers, in writing and on a whiteboard.
- Know your audience
- Bottom line first
- Diagrams and stories
- Presenting a recommendation
Lesson 5Intermediate10 min · 6 steps · 1 exercise
Working with product and the business
Turn requests into requirements, find the real problem, and say no with options.
- Requests versus needs
- Discovering requirements
- Saying no with options
- Being a partner, not a gate
Lesson 6Intermediate10 min · 6 steps · 1 exercise
Estimates, uncertainty and roadmaps
Give honest ranges, reduce uncertainty early, and plan in slices.
- Why estimates go wrong
- Ranges and confidence
- Spikes and slicing
- Technical roadmaps
Lesson 7Intermediate10 min · 6 steps · 1 exercise
Managing technical debt
Make debt visible, measure its cost, and pay it down continuously.
- Kinds of technical debt
- Making it visible
- Prioritising by cost
- Paying it down continuously
Lesson 8Intermediate10 min · 6 steps · 1 exercise
Choosing technology: radar, build or buy
Evaluate tools with criteria, keep a tech radar, and decide whether to build, buy or adopt open source.
- Hype versus fit
- Evaluation criteria
- Tech radar
- Build, buy or open source
Lesson 9Intermediate10 min · 6 steps · 1 exercise
Leading without authority
Mentoring, reviews, and building agreement when you are not the manager.
- Influence comes from trust
- Reviews that teach
- Mentoring and pairing
- Disagree and commit
Lesson 10Advanced10 min · 6 steps · 1 exercise
Lightweight architecture governance
Principles, guardrails and automated checks instead of review boards that slow everyone down.
- The review board problem
- Principles and guardrails
- Automated governance
- Architecture advice process
Lesson 11Advanced11 min · 6 steps · 1 exercise
Conway's law and team design
Systems mirror the teams that build them: design teams and architecture together.
- Conway's law
- The inverse Conway manoeuvre
- Team Topologies
- Cognitive load
Lesson 12Beginner9 min · 6 steps · 1 exercise
Growing as an architect
Build your practice: learning habits, a decision journal, a portfolio, and the staff-plus path.
- Breadth and depth
- A decision journal
- Learning in public
- Next steps on the path
Lesson 13Advanced12 min · 6 steps · 6 exercises
Capstone: design, build and defend one system
One small booking service that uses the whole path: scenarios, diagrams, decisions, code, tests, delivery and a design doc.
- The brief and its numbers
- Diagrams and decisions first
- A thin slice, built and tested
- Shipping it and defending it
10 · AI Engineer: foundations
Python for engineers13 lessons⏱ 144 minAI tooling is written in Python. You already know Kotlin and TypeScript, so this is a translation, not a restart.
Lesson 1Beginner12 min · 5 steps · 1 exercise
Python, for someone who knows Kotlin
Map what you know to Python: types, data classes, environments and tests.
- Type hints and what checks them
- dataclass versus Kotlin data class
- Virtual environments with uv
- Testing with pytest
Lesson 2Beginner12 min · 6 steps · 1 exercise
Python syntax in one sitting
Indentation, lists, dicts, tuples, slicing, comprehensions and f-strings, mapped to Kotlin.
- Indentation instead of braces
- Lists, dicts, tuples and sets
- Slicing and unpacking
- Comprehensions and f-strings
Lesson 3Beginner11 min · 6 steps · 1 exercise
Functions, closures and decorators
Keyword arguments, *args and **kwargs, and the decorators that AI frameworks use everywhere.
- Keyword and default arguments
- *args and **kwargs
- Closures
- Decorators like @tool and @retry
Lesson 4Intermediate11 min · 6 steps · 1 exercise
Generators, iterators and context managers
yield for streams of tokens and big files, and with for resources that must be closed.
- Iterators and for loops
- Generators with yield
- Streaming tokens
- Context managers with with
Lesson 5Intermediate10 min · 6 steps · 1 exercise
Typing in depth: generics, Protocols and checkers
Make Python feel like Kotlin: precise types, structural interfaces, and a checker in CI.
- Modern type syntax
- Generics and TypeVar
- Protocols: interfaces without inheritance
- mypy or pyright in CI
Lesson 6Intermediate10 min · 6 steps · 1 exercise
Errors, retries and logging
Exceptions, custom errors, retries with back-off for model APIs, and structured logs.
- Exceptions and custom errors
- Retries with back-off
- Logging that helps
- Never swallow errors
Lesson 7Beginner11 min · 5 steps · 1 exercise
Pydantic and async Python
Validate data at the border and call many services at once.
- Pydantic models as typed, validated data
- async and await in Python
- httpx for HTTP calls
- Running calls in parallel with gather
Lesson 8Intermediate11 min · 6 steps · 1 exercise
Serving a model with FastAPI
Typed HTTP endpoints, validation, streaming responses and dependency injection.
- FastAPI basics
- Validation with Pydantic
- Streaming responses
- Dependencies and settings
Lesson 9Beginner12 min · 5 steps · 1 exercise
NumPy and pandas in one sitting
Arrays and tables: the two data tools every AI notebook uses.
- NumPy arrays and vectorised maths
- Shapes and broadcasting
- pandas DataFrames
- Filtering, grouping and joining
Lesson 10Intermediate11 min · 6 steps · 1 exercise
Testing Python and LLM code with pytest
Fixtures, parametrize, fakes for model calls, and snapshot-style checks.
- pytest basics
- Fixtures
- Parametrize
- Testing code that calls a model
Lesson 11Intermediate10 min · 5 steps · 1 exercise
From notebook to real project
Turn an experiment into code you can test, run and ship.
- Why notebooks rot
- A src layout with pyproject.toml
- Config and secrets from the environment
- A small command-line entry point
Lesson 12Advanced11 min · 6 steps · 1 exercise
Making Python fast
The GIL, processes, vectorisation, profiling, and when to reach for Rust.
- Why Python can be slow
- Profile first
- Vectorise, then parallelise
- Native extensions with Rust
Lesson 13Advanced12 min · 6 steps · 1 exercise
Rust for Python and AI
Speed up Python with PyO3, run models with candle, tokenise fast, and ship to WebAssembly.
- Why AI tools use Rust
- Python extensions with PyO3 and maturin
- Inference and tokenizers in Rust
- WebAssembly and edge
Math and ML foundations5 lessons⏱ 57 minBefore LLMs, learn the loop every model shares: data in, a guess out, a number that says how wrong it was.
Lesson 1Beginner12 min · 5 steps · 1 exercise
Train, test, and honest metrics
What training means, why you hold data back, and why accuracy can lie.
- A model as a function with adjustable numbers
- Train, validation and test sets
- Overfitting in plain words
- Precision and recall
Lesson 2Beginner12 min · 6 steps · 1 exercise
Linear regression and gradient descent
The simplest model, and the training method behind every neural network.
- A line that predicts a number
- Loss: measuring how wrong
- Gradient descent: step downhill
- Learning rate
Lesson 3Intermediate11 min · 6 steps · 1 exercise
Classification, trees and ensembles
Predict a category, and why random forests and boosting win on tables.
- Logistic regression for yes or no
- Decision trees
- Random forests and gradient boosting
- scikit-learn's fit and predict
Lesson 4Intermediate12 min · 6 steps · 1 exercise
Neural networks in plain words
Layers of simple units that learn their own features.
- Neurons and layers
- Activation functions
- Backpropagation
- Why depth and data matter
Lesson 5Intermediate10 min · 5 steps · 1 exercise
Data and features decide the result
Better data beats a fancier model almost every time.
- Garbage in, garbage out
- Leakage: the silent cheat
- Imbalanced classes
- Splitting by time and by user
Deep learning and how LLMs work4 lessons⏱ 44 minYou will use LLMs better once you know they predict tokens and nothing else.
Lesson 1Beginner12 min · 5 steps · 1 exercise
Tokens, context and prediction
What actually goes in and comes out of a language model.
- Tokens, not words
- The context window
- Next-token prediction and sampling
- Why models state wrong things confidently
Lesson 2Intermediate12 min · 5 steps · 1 exercise
Embeddings and attention
How a transformer turns tokens into meaning and decides what to look at.
- Token embeddings
- Attention: each token looks at the others
- Transformer layers
- Why context length costs compute
Lesson 3Intermediate10 min · 5 steps · 1 exercise
How a chat model is trained
Pre-training, instruction tuning and preference training, and what each gives you.
- Pre-training on huge text
- Instruction tuning
- Learning from human and AI feedback
- Knowledge cutoff
Lesson 4Beginner10 min · 5 steps · 1 exercise
Choosing a model
Quality, speed, cost and context: how to pick the right model for each job.
- Model families and sizes
- Price per million tokens
- Latency and context window
- Measuring instead of guessing
11 · AI Engineer: building
LLM APIs and prompt engineering5 lessons⏱ 56 minNow you call a model from code. The skill is writing a clear request and getting output your program can use.
Lesson 1Intermediate12 min · 5 steps · 1 exercise
Your first API call and a clear prompt
Messages in, message out, and how to ask so the answer is usable.
- The messages request shape
- System prompt versus user message
- Writing a prompt like a brief
- Getting structured output
Lesson 2Beginner12 min · 6 steps · 1 exercise
Prompting techniques that work
Examples, structure and clear criteria: the habits that make prompts reliable.
- Context and the goal first
- Few-shot examples
- XML tags to separate parts
- Asking for reasoning when it helps
Lesson 3Intermediate11 min · 6 steps · 1 exercise
Structured outputs and validation
Get JSON that always matches your schema, and handle the cases where the answer is no.
- Why free text breaks pipelines
- JSON schema output
- Validating with Pydantic
- Designing for 'unknown'
Lesson 4Beginner10 min · 6 steps · 1 exercise
Streaming, images and documents
Show text as it arrives, and send pictures and PDFs to the model.
- Streaming responses
- Images as input
- PDFs and long documents
- Token costs of media
Lesson 5Intermediate11 min · 6 steps · 1 exercise
Cost: tokens, caching and batching
Pay for what you need: count tokens, cache repeated prefixes, batch what can wait.
- Where the cost comes from
- Prompt caching
- Batch processing
- Smaller models and shorter outputs
Tool use, agents and MCP6 lessons⏱ 69 minA model alone can only write. With tools it can look things up and act. That loop is what people call an agent.
Lesson 1Intermediate12 min · 5 steps · 1 exercise
Tools and the agent loop
How a model asks to run your function, and how the loop around it works.
- A tool is a name, a description and a schema
- The request, run, return loop
- What an agent is
- When an agent is the wrong choice
Lesson 2Intermediate12 min · 6 steps · 1 exercise
Workflow patterns before agents
Chains, routers, parallel calls and evaluator loops: predictable building blocks.
- Prompt chaining
- Routing
- Parallelisation
- Orchestrator-workers and evaluator-optimiser
Lesson 3Intermediate11 min · 6 steps · 1 exercise
Designing good tools
The model only knows your tools by their names, descriptions and schemas. Write them well.
- Names and descriptions as documentation
- Input schemas and strict validation
- Useful results and useful errors
- Few, well-shaped tools
Lesson 4Intermediate11 min · 6 steps · 1 exercise
MCP: connect tools once, use everywhere
The Model Context Protocol in practice: servers, tools, resources and security.
- Why a protocol for tools
- Servers, clients, tools, resources, prompts
- Local and remote servers
- Trust and permissions
Lesson 5Advanced11 min · 5 steps · 1 exercise
Context and memory for agents
Long tasks fill the context window. Decide what the agent keeps, forgets and writes down.
- The context window as working memory
- Trimming tool results and compaction
- Memory files and notes
- Sub-agents for focused work
Lesson 6Advanced12 min · 5 steps · 1 exercise
Agent safety and prompt injection
When an agent reads the web or email, the text it reads may try to give it orders.
- Prompt injection
- Least privilege for tools
- Human confirmation for risky actions
- Sandboxes and audit logs
RAG: embeddings and retrieval5 lessons⏱ 55 minMost business questions are about private documents. Retrieval puts the right pages in front of the model.
Lesson 1Intermediate12 min · 5 steps · 1 exercise
Retrieve, then answer
Find the few relevant passages and let the model answer from them, with sources.
- Embeddings as meaning coordinates
- Chunking documents
- The retrieve, augment, generate pipeline
- Citations and failure cases
Lesson 2Intermediate11 min · 5 steps · 1 exercise
Chunking and embedding documents well
How you cut documents decides what the model can find.
- Why chunk size matters
- Splitting by structure
- Overlap and context headers
- Metadata for filtering
Lesson 3Intermediate10 min · 5 steps · 1 exercise
Vector search and vector databases
Store embeddings and find the nearest ones fast, even among millions.
- Similarity search
- Approximate nearest neighbour indexes
- pgvector or a dedicated store
- Keeping the index fresh
Lesson 4Advanced11 min · 6 steps · 1 exercise
Hybrid search and reranking
Combine keyword and meaning search, then let a reranker pick the best passages.
- Where vector search fails
- BM25 keyword search
- Combining scores
- Reranking the top results
Lesson 5Advanced11 min · 5 steps · 1 exercise
Evaluating a RAG system
Measure retrieval and answers separately, so you know which half to fix.
- Retrieval metrics: recall at k
- Answer metrics: faithfulness and relevance
- Building a question set
- Common fixes for each failure
12 · AI Engineer: shipping
Evals and quality4 lessons⏱ 43 minA prompt change that fixes one case can break ten. Evals are the tests of AI features.
Lesson 1Intermediate12 min · 5 steps · 1 exercise
Evals: tests for AI features
Build a small set of real cases and score every change against it.
- Why trying it by hand does not scale
- A dataset of inputs and expected results
- Code graders and model graders
- Running evals in CI
Lesson 2Intermediate10 min · 5 steps · 1 exercise
Building eval datasets
Good evals start with the right examples, not the right tools.
- Where examples come from
- Covering the important cases
- Expected outputs and criteria
- Keeping a held-out set
Lesson 3Advanced11 min · 5 steps · 1 exercise
LLM-as-judge done right
Use a model to grade open-ended answers, and check that the judge agrees with people.
- When a model judge is needed
- Rubrics and pass or fail
- Calibrating against human labels
- Judge biases
Lesson 4Intermediate10 min · 5 steps · 1 exercise
Online evaluation and feedback
After launch, keep measuring with real traffic: feedback, sampling and A/B tests.
- Offline versus online evals
- User feedback signals
- Sampling and grading production traffic
- A/B testing prompt or model changes
Fine-tuning and open models4 lessons⏱ 43 minFine-tuning is the last tool to reach for, not the first. Know when it pays and what open models change.
Lesson 1Intermediate10 min · 5 steps · 1 exercise
Prompt, retrieve, or fine-tune?
A decision order that saves months, and what running a model yourself involves.
- The order: prompt, examples, retrieval, then fine-tune
- What fine-tuning changes
- LoRA in one paragraph
- Running open models locally
Lesson 2Advanced10 min · 5 steps · 1 exercise
Preparing fine-tuning data
Fine-tuning learns exactly what the examples show, including their mistakes.
- When you really need fine-tuning
- Example format
- Quality over quantity
- Train, validation and eval
Lesson 3Advanced12 min · 6 steps · 1 exercise
LoRA fine-tuning hands-on
Adapt an open model on one GPU by training small adapter matrices.
- Full fine-tuning versus adapters
- How LoRA works
- Key settings
- Merging and serving adapters
Lesson 4Advanced11 min · 5 steps · 1 exercise
Serving open models
Quantization, inference servers and when self-hosting is worth it.
- Why self-host
- Quantization
- Inference servers: vLLM, llama.cpp, Ollama
- Throughput, batching and cost
Production AI engineering5 lessons⏱ 53 minThis is where the Architect Path and the AI course meet: an AI call is a slow, costly, sometimes-wrong dependency behind a port.
Lesson 1Advanced12 min · 5 steps · 1 exercise
An AI call is an unreliable dependency
Wrap the model behind a port, stream, cache, limit and observe, in Spring Boot and React Native.
- The model behind a port
- Streaming for perceived speed
- Caching, timeouts and retries
- Logging tokens, cost and quality
Lesson 2Intermediate11 min · 5 steps · 1 exercise
Guardrails: input, output and data
Checks around the model that keep users, data and the company safe.
- Input checks
- Output checks
- Personal data
- Handling refusals and fallbacks
Lesson 3Intermediate11 min · 5 steps · 1 exercise
Cost and latency in production
Route, cache, stream and right-size every call.
- Cost per completed task
- Routing to smaller models
- Effort and output length
- Timeouts, fallbacks and limits
Lesson 4Intermediate10 min · 5 steps · 1 exercise
Observability for AI features
Trace every call: prompt version, tokens, latency, tools and outcome.
- What to log per call
- Traces for chains and agents
- Dashboards and alerts
- Privacy in logs
Lesson 5Intermediate9 min · 5 steps · 1 exercise
Versioning prompts and rolling out changes
Treat prompts, models and settings as releasable code.
- Prompts in version control
- A config per feature
- Gradual rollouts and rollback
- Model upgrades
AI system design and capstone5 lessons⏱ 65 minChoose between the patterns you learned and write down why, the way an architect does. Then the final project: build your own GPT.
Lesson 1Advanced12 min · 5 steps · 1 exercise
Design an AI feature like an architect
A repeatable way to go from a vague request to a design you can defend.
- Start from the user outcome
- Pick the simplest pattern that works
- Budget quality, latency and cost
- Record the decision in an ADR
Lesson 2Advanced11 min · 5 steps · 1 exercise
The LLM gateway and routing
One internal service between your apps and every model provider.
- Why a gateway
- Routing and fallbacks
- Keys, quotas and cost attribution
- Caching and logging in one place
Lesson 3Advanced14 min · 5 steps · 1 exercise
Case study: a customer support assistant
Answer from help articles, look up orders, and hand over to humans.
- Requirements and boundaries
- Retrieval plus tools
- Escalation and human handover
- Evals and metrics
Lesson 4Advanced14 min · 5 steps · 1 exercise
Case study: enterprise document Q&A
Ask questions over millions of internal documents, with permissions respected.
- Ingestion pipeline
- Permissions in retrieval
- Freshness and deletion
- Scaling and cost
Lesson 5Advanced14 min · 5 steps · 1 exercise
Case study: an agent that does real work
An agent that triages bug reports, reproduces them and drafts fixes for review.
- Scope and autonomy level
- Sandboxed tools
- Human review gates
- Budgets, logs and evaluation
13 · AI Engineer: build your own GPT
Build your own GPT14 lessons⏱ 154 minNothing explains an LLM like building one. You write every part of a GPT yourself, train it, and turn it into a small chat assistant with the same steps used for GPT-3.5.
Lesson 1Intermediate10 min · 6 steps · 1 exercise
What GPT-3.5 really took, and what you will build
The honest scale of GPT-3.5, and a plan that fits a laptop and a small GPU budget.
- What GPT-3.5 is made of
- Why you cannot copy its size
- The same recipe at small scale
- The project plan
Lesson 2Beginner8 min · 6 steps · 1 exercise
Set up PyTorch and the data
Install PyTorch, use your Mac's GPU, and load a first dataset.
- A clean Python environment
- PyTorch on Apple Silicon, CUDA or CPU
- Tensors in two minutes
- The Shakespeare dataset
Lesson 3Intermediate11 min · 6 steps · 1 exercise
Build a tokenizer
From characters to byte-level BPE, the way GPT models split text.
- Why models need tokens
- Character tokens
- Byte-pair encoding
- Special tokens for chat
Lesson 4Intermediate9 min · 6 steps · 1 exercise
Turn text into training batches
Train and validation splits, context windows, and inputs shifted by one.
- Tokenise once, store as numbers
- Train and validation split
- Random windows
- Targets are inputs shifted by one
Lesson 5Intermediate9 min · 6 steps · 1 exercise
The simplest language model
A bigram model, cross-entropy loss and a baseline to beat.
- Embedding tables
- Logits and softmax
- Cross-entropy loss
- The loss you should see at the start
Lesson 6Advanced13 min · 6 steps · 1 exercise
Self-attention from scratch
Queries, keys and values, the causal mask, and why we scale by √d.
- Tokens talk to earlier tokens
- Query, key, value
- The causal mask
- Multi-head attention
Lesson 7Advanced13 min · 6 steps · 1 exercise
The full GPT model
Transformer blocks with residuals and LayerNorm, positions and weight tying.
- Multi-head causal attention
- The MLP
- Residual connections and LayerNorm
- Putting the GPT together
Lesson 8Advanced12 min · 6 steps · 1 exercise
Train it
AdamW, learning-rate warmup and decay, gradient clipping, evaluation and checkpoints.
- The training loop
- AdamW and the learning-rate schedule
- Measuring progress honestly
- Checkpoints
Lesson 9Intermediate10 min · 6 steps · 1 exercise
Generate text
Autoregressive sampling with temperature, top-k and top-p.
- One token at a time
- Temperature
- Top-k and top-p
- Stopping
Lesson 10Advanced14 min · 6 steps · 1 exercise
Scale to GPT-2 size on a GPU
A 124M model on 10 billion tokens: bfloat16, torch.compile, FlashAttention and multiple GPUs.
- Real pretraining data
- Speed: bf16, compile, flash attention
- Big batches with gradient accumulation
- Many GPUs with DDP
Lesson 11Advanced12 min · 6 steps · 1 exercise
Make it a chat model (SFT)
Chat templates, special tokens and training only on the assistant's words.
- Base models only continue text
- Chat templates
- Loss masking
- Good SFT data
Lesson 12Advanced12 min · 6 steps · 1 exercise
Teach preferences (RLHF and DPO)
From "answers correctly formatted" to "answers people prefer".
- What SFT cannot teach
- RLHF in one picture
- DPO: preferences without a reward model
- Writing the DPO loss
Lesson 13Advanced11 min · 6 steps · 1 exercise
Evaluate your model
Validation loss, a real benchmark, and honest side-by-side checks.
- Loss and perplexity
- HellaSwag
- Chat evaluation by hand and by judge
- Comparing with GPT-2
Lesson 14Advanced10 min · 6 steps · 1 exercise
Serve and share your model
A streaming API, quantisation, and running it next to your other local models.
- Load once, serve many
- Streaming tokens
- KV cache and quantisation
- Model cards and limits
14 · Money: personal finance and investing
Personal finance basics6 lessons⏱ 49 minMoney skills are life skills: a budget, a safety buffer and understanding interest protect you before any investing. Education only, not financial advice.
Lesson 1Beginner8 min · 6 steps · 1 exercise
A budget you can actually keep
Know where money goes, with a simple rule instead of a spreadsheet you abandon.
- Income minus spending
- Needs, wants and saving
- Pay yourself first
- Automate it
Lesson 2Beginner7 min · 6 steps · 1 exercise
The safety buffer
Why an emergency fund comes before investing, and how big it should be.
- What counts as an emergency
- How big the buffer should be
- Where to keep it
- Why it comes first
Lesson 3Beginner9 min · 6 steps · 1 exercise
Interest and compounding
The force that grows savings and debts: simple and compound interest, and the rule of 72.
- Simple versus compound interest
- The rule of 72
- Time matters most
- Compounding works against you on debt
Lesson 4Beginner8 min · 6 steps · 1 exercise
Inflation and real value
Why prices rise, what central banks do, and why cash slowly loses value.
- What inflation measures
- Why a little inflation is normal
- Interest rates and central banks
- Protecting purchasing power
Lesson 5Beginner9 min · 6 steps · 1 exercise
Debt, loans and credit
Good debt, bad debt, APR, and how to get out of expensive debt.
- What APR means
- Good and bad debt
- Avalanche and snowball
- Credit history
Lesson 6Beginner8 min · 6 steps · 1 exercise
Taxes, accounts and the paperwork
How income and investment taxes work in general, and why account types matter.
- Gross versus net
- Progressive tax brackets
- Taxes on investments
- Tax-advantaged accounts
Investing basics6 lessons⏱ 54 minInvesting lets savings grow faster than inflation, with risk you must understand. This module explains how it works, not what to buy. Education only, not financial advice.
Lesson 1Beginner9 min · 6 steps · 1 exercise
Stocks, bonds and cash
The three building blocks, what you own, and how each can make or lose money.
- A stock is part of a company
- A bond is a loan
- Cash and money-market funds
- Risk and return together
Lesson 2Beginner9 min · 6 steps · 1 exercise
Funds, ETFs and index investing
Owning many companies at once, low fees, and why most active funds trail the index.
- What a fund is
- Index funds and ETFs
- Active versus passive
- Fees compound too
Lesson 3Beginner9 min · 6 steps · 1 exercise
Risk, diversification and time
Do not put all eggs in one basket, match investments to time, and survive the falls.
- Volatility and drawdowns
- Diversification
- Time horizon
- Behaviour is the biggest risk
Lesson 4Intermediate9 min · 6 steps · 1 exercise
Asset allocation and a simple plan
Choosing the mix of stocks, bonds and cash, investing regularly, and rebalancing.
- Asset allocation
- Dollar-cost averaging
- Rebalancing
- An investment policy on one page
Lesson 5Intermediate9 min · 6 steps · 1 exercise
Real estate, crypto and other assets
What else exists, how each makes or loses money, and the special risks.
- Buying a home versus renting
- Real estate as an investment
- Crypto: what it is and its risks
- Gold, commodities and private assets
Lesson 6Intermediate9 min · 6 steps · 1 exercise
Long-term goals: retirement and financial independence
How much is enough, the 4% rule and its limits, and planning in simple steps.
- Goals with dates
- The 4% rule of thumb
- Sequence-of-returns risk
- Reviewing yearly
15 · Money: markets and trading
How markets work6 lessons⏱ 55 minBefore trading anything, understand the machine: exchanges, order books, prices, brokers and settlement. This is also the domain your fintech systems will model.
Lesson 1Beginner9 min · 6 steps · 1 exercise
Exchanges, brokers and clearing
Who is involved when you click "buy", from your app to settlement.
- Exchanges and listings
- Brokers
- Clearing and settlement (T+1)
- Protection of your assets
Lesson 2Intermediate10 min · 6 steps · 1 exercise
The order book and how prices form
Bids, asks, the spread, liquidity, and what a price really is.
- Bids and asks
- The spread
- Liquidity and depth
- Market makers
Lesson 3Intermediate9 min · 6 steps · 1 exercise
Order types: market, limit and stop
Which order to use, what each guarantees, and the traps.
- Market orders
- Limit orders
- Stop and stop-limit orders
- Gaps and fast markets
Lesson 4Beginner8 min · 6 steps · 1 exercise
Indices, sectors and the economy
What the S&P 500 and MSCI World are, and how economic news moves markets.
- What an index is
- Weighting by size
- Sectors and countries
- Earnings, rates and news
Lesson 5Advanced9 min · 6 steps · 1 exercise
Short selling, margin and leverage
Borrowing to bet: how it works and why losses can exceed what you put in.
- Margin accounts
- Leverage multiplies both ways
- Margin calls
- Short selling and unlimited loss
Lesson 6Advanced10 min · 6 steps · 1 exercise
Derivatives: options, futures and CFDs
Contracts whose value comes from another asset: what they do and why they are risky.
- Futures
- Options: calls and puts
- CFDs and retail losses
- Hedging versus speculation
Trading, honestly6 lessons⏱ 58 minTrading is a skill game with high costs and poor odds for most people. Learn how traders think, test and manage risk, so you can judge any strategy, or build tools for it. Education only, not financial advice.
Lesson 1Intermediate9 min · 6 steps · 1 exercise
Trading versus investing, and the real odds
Time frames, costs, and what research says about people who day trade.
- Investing versus trading
- Time frames
- Costs add up
- The evidence on day traders
Lesson 2Intermediate10 min · 6 steps · 1 exercise
Charts and technical analysis
Candles, trends, support, resistance and moving averages, and their limits.
- Reading candlesticks
- Trends, support and resistance
- Moving averages
- Why it often fails
Lesson 3Intermediate10 min · 6 steps · 1 exercise
Fundamental analysis and valuation
Reading a company's numbers: revenue, profit, P/E, growth, and what a fair price could be.
- Revenue, profit and margins
- Valuation ratios
- Growth and moats
- Discounted cash flow in one idea
Lesson 4Advanced10 min · 6 steps · 1 exercise
Risk management: sizing, stops and expectancy
The part of trading that decides survival: how much to risk per trade, and whether a strategy has an edge.
- Risk per trade
- Position sizing
- Risk/reward
- Expectancy
Lesson 5Intermediate8 min · 6 steps · 1 exercise
Psychology and biases
Loss aversion, FOMO, overconfidence and revenge trading, and simple defences.
- Loss aversion
- FOMO and herding
- Overconfidence
- A trading journal
Lesson 6Advanced11 min · 6 steps · 1 exercise
Backtesting and paper trading
Test a strategy on history without fooling yourself, then on paper, before any real money.
- A simple backtest
- Costs and slippage
- The three classic biases
- Paper trading and algorithmic trading
16 · Money: finance for builders
Finance for founders and CTOs6 lessons⏱ 57 minAs a CTO or founder, architecture choices show up in the numbers: gross margin, burn and runway. Read the statements, speak the metrics investors use, and design systems that make money.
Lesson 1Beginner10 min · 6 steps · 1 exercise
The three financial statements
Income statement, balance sheet and cash flow, read in plain words.
- The income statement (P&L)
- The balance sheet
- The cash flow statement
- Why profit is not cash
Lesson 2Intermediate10 min · 6 steps · 1 exercise
Unit economics: CAC, LTV and payback
Does each customer make money, and how fast?
- Customer acquisition cost
- Gross margin per customer
- Lifetime value
- Payback period
Lesson 3Intermediate9 min · 6 steps · 1 exercise
SaaS metrics: ARR, churn, NRR
The language of subscription businesses and what good looks like.
- MRR and ARR
- Logo churn and revenue churn
- Net revenue retention
- The Rule of 40
Lesson 4Beginner8 min · 6 steps · 1 exercise
Burn, runway and scenarios
How long the money lasts, and planning for good and bad cases.
- Gross and net burn
- Runway
- Scenarios
- Default alive
Lesson 5Intermediate10 min · 6 steps · 1 exercise
Fundraising, valuation and dilution
Pre-money, post-money, the cap table, SAFEs, vesting and option pools.
- Pre-money and post-money
- Dilution
- The cap table
- SAFEs, vesting and option pools
Lesson 6Intermediate10 min · 7 steps · 1 exercise
FinOps: cloud cost as an architecture decision
Measure cost per customer, find waste, and design for unit cost.
- Cost visibility and tagging
- Unit cost
- Commitments and right-sizing
- Designing for cost
Building fintech systems6 lessons⏱ 59 minMoney software must never lose or invent a cent. As an architect, learn how to represent money, keep a double-entry ledger, take payments safely, reconcile, match orders and meet compliance rules.
Lesson 1Intermediate9 min · 6 steps · 1 exercise
Representing money in code
Never floats: minor units, decimals, currencies, rounding and fair splitting.
- Why floats are wrong for money
- Minor units and BigDecimal
- Currencies and rounding
- Splitting amounts fairly
Lesson 2Advanced10 min · 6 steps · 1 exercise
The double-entry ledger
The 500-year-old idea at the heart of every bank and wallet.
- Accounts and entries
- Debits equal credits
- Immutable history
- Balances are derived
Lesson 3Advanced10 min · 6 steps · 1 exercise
How card payments work
Authorisation, capture, settlement, refunds, chargebacks and webhooks.
- The parties
- Authorise, capture, settle
- Refunds and chargebacks
- Idempotency and webhooks
Lesson 4Advanced9 min · 6 steps · 1 exercise
Reconciliation: proving the numbers match
Comparing your ledger with bank and PSP reports every day, and handling breaks.
- Why reconcile
- Matching records
- Breaks and their causes
- Automating it
Lesson 5Advanced11 min · 6 steps · 1 exercise
Designing an exchange matching engine
Price-time priority, a single-threaded core, event sourcing and low latency.
- Price-time priority
- The order book data structure
- One thread per symbol
- Event sourcing and recovery
Lesson 6Intermediate10 min · 6 steps · 1 exercise
Compliance by design: KYC, AML, PCI DSS, PSD2
The rules money software lives under, and how architecture reduces the burden.
- KYC and AML
- PCI DSS and tokenisation
- Strong customer authentication
- Audit trails and data protection
17 · Mind: how your mind works
Know your mind6 lessons⏱ 48 minYou do all your learning and all your work with one mind. Knowing how attention, habits, stress and sleep work makes everything else on this site easier. Education only, not medical advice.
Lesson 1Beginner8 min · 6 steps · 2 exercises
Attention is a spotlight
Why you can only focus on one hard thing, what each switch costs, and how to protect a block of focus.
- Why two hard tasks cannot run together
- What a task switch really costs
- How to protect a block of focus
- A ten-minute focus drill
Lesson 2Beginner8 min · 7 steps · 2 exercises
How a habit is built
A habit is a loop of cue, action and reward. Build one by making it tiny and tying it to something you already do.
- The three parts of a habit
- Why tiny beats ambitious
- How to tie a new habit to an old one
- What to do after a missed day
Lesson 3Beginner7 min · 6 steps · 2 exercises
Motivation follows action
Waiting to feel ready is the trap. Make starting almost free, and the feeling arrives afterwards.
- Why action often comes before motivation
- How to shrink a first step
- Three things that make a task pull
- A five-minute start
Lesson 4Beginner8 min · 7 steps · 2 exercises
Stress, and the way back to calm
What the stress response is for, and three things that bring the body back down: a slow breath out, naming the feeling, and a pause.
- What the stress response is for
- Why slow breathing out calms the body
- How naming a feeling helps
- When to ask a professional for help
Lesson 5Beginner8 min · 7 steps · 2 exercises
Sleep and energy
Two forces decide when you feel sleepy. Light, caffeine and a steady wake-up time are the levers you control.
- The two forces behind sleepiness
- How light sets your body clock
- What caffeine really does
- How to plan work around your energy
Lesson 6Beginner9 min · 7 steps · 2 exercises
Working with an ADHD brain
ADHD is a difference in how attention is steered. Work with it: put things outside your head, make time visible, borrow structure, and drop the shame.
- Why interest steers attention more than importance
- How to put plans outside your head
- How to make time visible
- Why another person nearby helps you start