Unity interview question

Resolving an issue with a function returning garbage.