CGI interview question

irst round was simple, but second was really technical with programming question