Pergunta de entrevista da empresa Qualcomm

you are provided with a string write a program to identify the most frequently occurring char in the string? in Java and also in c/C++.. explained the algo over phone and submitted the program later