CME Group Interview Question

I was asked to write codes on paper for a small project in different programming languages.