Infosys interview question

Example with code of a singleton design pattern