← All questions
Coding
Count frequency of each character in the input string
Asked at
SBS
1Give yourself 5 minutes
2Answer out loud, not in your head
3Then compare with the answer below
0
Stuck? Show a way to structure it+
- 01Clarify case, whitespace, and character set rules.
- 02Initialize a frequency map or bounded array.
- 03Increment once per character.
- 04Preserve a requested output order.
- 05State encoding and complexity assumptions.
Reference answer
Then expect these follow-ups
Should 'A' and 'a' be combined?
Tests: follow-up reasoning
How would you count Unicode grapheme clusters?
Tests: implementation extension
Free to read · better with Enzo
Practice this out loud with Enzo
Enzo runs it as a mock interview, pushes back with follow-ups, and grades you on the rubric.
Next question