Cvent Interview Question

find occurrences of character in string write code with unit test cases.