PracHub
QuestionsPremiumLearningGuidesCheatsheetNEW
|Home/Coding & Algorithms/Bloomberg

Check equal character frequencies

Last updated: Apr 2, 2026

Quick Overview

This question evaluates a candidate's understanding of character frequency analysis and algorithmic reasoning in string manipulation, measuring the ability to recognize frequency invariants and handle edge cases.

  • medium
  • Bloomberg
  • Coding & Algorithms
  • Software Engineer

Check equal character frequencies

Company: Bloomberg

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Given a string `s`, implement two functions: 1. **Check whether all characters have equal frequency** Return `true` if every distinct character in `s` appears the same number of times; otherwise return `false`. Examples: - `"abc"` -> `true` - `"abcabc"` -> `true` - `"aab"` -> `false` 2. **Check whether deleting exactly one character can make frequencies equal** You must delete exactly **one character occurrence** from `s`, then determine whether every remaining distinct character appears the same number of times. Important: if the original string is already balanced, you still must delete one character. If no single deletion results in equal frequencies, return `false`. Examples: - `"aabbccc"` -> `true` because removing one `c` gives `"aabbcc"` - `"aaabbbccc"` -> `false` - `"aaa"` -> `true` because removing one `a` gives `"aa"` Aim for the best possible time and space complexity.

Quick Answer: This question evaluates a candidate's understanding of character frequency analysis and algorithmic reasoning in string manipulation, measuring the ability to recognize frequency invariants and handle edge cases.

Related Interview Questions

  • Solve meeting and tree problems - Bloomberg (easy)
  • Minimize travel cost with two cities - Bloomberg (easy)
  • Check connectivity between two subway stations - Bloomberg (easy)
  • Design a data structure for dynamic top‑K frequency - Bloomberg (hard)
  • Find tree root and bucket numbers - Bloomberg (hard)
Bloomberg logo
Bloomberg
Jan 5, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
0
0
Loading...

Given a string s, implement two functions:

  1. Check whether all characters have equal frequency Return true if every distinct character in s appears the same number of times; otherwise return false . Examples:
    • "abc" -> true
    • "abcabc" -> true
    • "aab" -> false
  2. Check whether deleting exactly one character can make frequencies equal You must delete exactly one character occurrence from s , then determine whether every remaining distinct character appears the same number of times. Important: if the original string is already balanced, you still must delete one character. If no single deletion results in equal frequencies, return false . Examples:
    • "aabbccc" -> true because removing one c gives "aabbcc"
    • "aaabbbccc" -> false
    • "aaa" -> true because removing one a gives "aa"

Aim for the best possible time and space complexity.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Bloomberg•More Software Engineer•Bloomberg Software Engineer•Bloomberg Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.