Baidu interview question

Design patterns, singleton, factory?