Getty Images interview question

Explain a factory design pattern and when will you use it.