Caterpillar Interview Question

Write a singleton class. it should be thread safe