Synopsys interview question

basically coding style and simple algorithm design.