Question d’entretien chez ServiceNow

what is factory pattern? stack implementation code