Sendoso interview question

I was asked to write a string character counting code.