Vintedge interview question

program structure and simple logic