Tingz interview question

Design pattern