IBM interview question

Adapt to new environment