Pergunta de entrevista da empresa Citi

What is factory pattern? What is singleton?