← 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
Hiring now
SBS has 40 open roles right now
landed applies to roles like these for you, on each company’s own site, with answers written for the role.
Get 5x interviews10 free auto-applies. No card.
Manager, Tax
Scottsdale, AZ, US
Senior Customer Success Manager
Bristol, UK
Customer Tech Support Engineer II
Bucharest, RO
Next question