GlobalLogic interview question

Questions over memory management