Question d’entretien chez EPAM Systems

They asked me to write code on given senario