Algoworks interview question

puzzles from gfg and easy technical question