Siemens interview question

Singleton pattern in java. How to implement it. Some hash map based questions. Some questions around multithreading difference in map and flatmap.