Question bank › Hashing
Dsa Hashing Warm-up

Character Count in String

Write a program that counts the frequency of each character in the input string. The output should be in the format 'character: count', with each character frequency printed on a new line. Ignore spaces and print only characters that appear in the string. Example: Input: hello world Output: h: 1 l: 3 o: 2 r: 1 w: 1 d: 1

Key concepts

hashingfrequencystrings

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of Praxari's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.