Domanda di colloquio di ServiceNow

what is factory pattern? stack implementation code