FastPrepCool String Check
Problems/Cool String Check

Cool String Check

Bloomberg LP logoBloomberg LP● EasyINTERNFULLTIMEPHONE SCREENONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: An internship candidate's report on the opening interview round at Bloomberg says it began with about ten minutes on the resume and behavioral questions. A fifty-minute coding part followed, held online over Zoom, with one question the author rated easy to medium. The question is described in a single line: recognize a "cool string", a string whose characters are all equally common. The report gives no example, limits or alphabet.

Our choices: a string is cool when every letter that appears in it appears the same number of times, and letters that do not appear are ignored, so a string with one distinct letter is cool. A string has 1 to 100,000 lowercase English letters, and the answer is true or false.

The judged task matches the report at about 85%.

A string is cool when every letter that appears in it appears the same number of times. For example, "aabbcc" is cool because a, b and c each appear 2 times. The string "aaabbc" is not cool because a appears 3 times, b appears 2 times and c appears once.

Given a string s, return true if it is cool and false otherwise.

Only the letters that appear in s are compared. A letter that does not appear is ignored. So "ab" is cool, and so is a string with one distinct letter such as "zzzz".

Function

isCoolString(s: String) → boolean

Examples

Example 1

s = "aabbcc"return = true

The letters are a, b and c. Each one appears 2 times, so the string is cool and the answer is true.

Example 2

s = "aaabbc"return = false

The letter a appears 3 times, b appears 2 times and c appears 1 time. The counts are not all the same, so the answer is false.

Example 3

s = "abba"return = true

The letter a appears 2 times and b appears 2 times. The order of the letters does not matter, so the answer is true.

Constraints

  • 1 <= s.length <= 100000
  • s contains only lowercase English letters ('a' to 'z').

More Bloomberg LP Phone Screen questions

  • N-ary Index-Path Encoder and DecoderPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Fewest Coins CombinationPHONE SCREEN · Seen Nov 2026
  • Recommend Films from Viewers Who Watched Everything You DidPHONE SCREEN · Seen Nov 2026
  • Track New Values in Sorted OrderPHONE SCREEN · Seen Nov 2026
  • Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Sparse Vector and Matrix OperationsPHONE SCREEN · Seen Oct 2026
  • Add Two Numbers IIPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026

Similar questions at other companies

  • Transaction Fee Calculator — Parts 1–2: Basic Fee Calculation and Conditional Fee RulesStripe · PHONE SCREENStripe interview questions
  • Detect a Straight FlushTemu · PHONE SCREENTemu interview questions
  • First Letter to Appear TwiceCisco · PHONE SCREENCisco interview questions
  • Halfway Course in a Single TrackCrunchyroll · PHONE SCREENCrunchyroll interview questions
  • Count Adjacent Symbol Pairs for BPEAmazon · ONSITE INTERVIEW
  • Count a User's Actions in an Event LogMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Single-Condition Product FilterCrowdstrike · PHONE SCREENCrowdstrike interview questions
  • Map and Accumulate Learning QueriesPalantir · ONSITE INTERVIEWPalantir interview questions
  • Summarize Server Healthcheck LogsNVIDIA · PHONE SCREENNVIDIA interview questions
  • Known Words Matching Phone DigitsLinkedIn · PHONE SCREENLinkedIn interview questions

Interview reports that mention this question

  • Bloomberg SWE Intern Interview Questions: 68 Questions
  • Bloomberg Experienced SWE Interviews: 167 Questions (Part 1 of 2)

Bloomberg LP interview experiences

  • Bloomberg AI-Assisted Coding Round, All Levels: 14 Experiences
  • Bloomberg Interview Questions, Level Not Reported: 65 Questions
  • Bloomberg Experienced Design & More: 126 Questions (Part 2 of 2)
  • Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights
Saved
class Solution {
    public boolean isCoolString(String s) {
        // Write your code here.
    }
}
Checking account…