Xceedance interview question

basic subject and tricky puzzles