A design pattern is a reusable solution to a problem. They can be of various types: creational, structural, behavioral…