eBay interview question

Questions about recursion and string