Getty Images Interview Question

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