Nokia interview question

They also asked me to write two programs: 1.Reverse a string 2.Count the frequency of numbers in an array.