CGI Interview Question

2 coding question and oops , data structure