Capgemini Engineering Interview Question

Explain Singleton and Factory pattern