Trianz Interview Question

First round Aptitude with 2 coding