Deloitte interview question

factory and singleton design pattern