Extreme Reality interview question

Code mainly in different languages