Synopsys interview question

basic verilog, c programing,and some puzzles