← Cognizant questions
CodingEasyReported in a candidate post, Sep 2022

Count Character Frequencies in a String and Output Sorted

Filed under Cognizant

Write a program that takes a string input, calculates the frequency of each character (including uppercase letters), and prints the result in sorted order.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Cognizant questions

Collected from public candidate posts and coding forums. Updated Nov 2026.