EPAM Systems interview question

code for abstract factory pattern