ReviseAlgo Logo

Design Patterns in C++

Strategy Pattern

Swapping algorithms at runtime

Interview: Design interviews — very common

Strategy

The Strategy pattern encapsulates algorithms behind a common interface, allowing them to be swapped at runtime without changing client code.