Pergunta de entrevista da empresa NinjaCat

What is your preferred design patterns: factory, singleton, prototype

Resposta da entrevista

Sigiloso

24 de fev. de 2019

Prototype. The reason I choose this answer is because: - It eliminates the (potentially expensive) overhead of initializing an object - It simplifies and can optimize the use case where multiple objects of the same type will have mostly the same data