Sapiens interview question

coding questions related to collection and singleton