Tech Mahindra interview question

Write a code to count the frequency of characters in a string .