EPAM Systems Interview Question

A simple algorithm and some questions about Design Patterns