Komatsu interview question

Design Patterns- Singelton, Factory Design