FastPrepCount Vowel Substrings of a String
Problems/Count Vowel Substrings of a String

Count Vowel Substrings of a String

Bloomberg LP logoBloomberg LP● MediumNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Bloomberg new grad phone screen. The report names a well-known problem. We kept the whole exercise. We only added a function signature that works in every language and a larger limit that allows the usual linear-time solution. Our version is about 99% the same as the reported question.

A vowel substring is a non-empty contiguous substring that contains only the lowercase vowels a, e, i, o, and u, and contains all five vowels at least once.

Given a lowercase English string word, return the number of vowel substrings.

Function

countVowelSubstrings(word: String) → long

Examples

Example 1

word = "aeiouu"return = 2

The valid substrings are aeiou and aeiouu.

Example 2

word = "unicornarihan"return = 0

The vowels are split apart by consonants, so no stretch of only vowels holds all five kinds. The answer is zero.

Example 3

word = "cuaieuouac"return = 7

The stretch of vowels uaieuoua sits between two c letters. Seven substrings inside it contain all five vowel kinds.

Constraints

  • 1 <= word.length() <= 100000.
  • word contains only lowercase English letters.
  • The answer fits in a signed 64-bit integer.

More Bloomberg LP Phone Screen questions

  • Pascal's TrianglePHONE SCREEN · ONSITE INTERVIEW · Seen Dec 2026
  • Valid Triangle NumberPHONE SCREEN · ONSITE INTERVIEW · Seen Dec 2026
  • Collatz Conjecture with Shared MemoizationPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • N-ary Index-Path Encoder and DecoderPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Trapping Rain WaterPHONE 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

Similar questions at other companies

  • Perfect SubstringsVisa · OAVisa interview questions
  • Longest Substring Without Repeating CharactersAngel One · PHONE SCREEN
  • Longest Substring Without Repeating CharactersNykaa · PHONE SCREENNykaa interview questions
  • Apply Operations to Make a String EmptyFlexport · PHONE SCREENFlexport interview questions
  • Longest Substring Without Repeating CharactersIBM · PHONE SCREENIBM interview questions
  • Longest Substring Without Repeating CharactersTikTok · PHONE SCREENTikTok interview questions
  • Find Word-Multiset WindowsAmazon · PHONE SCREEN
  • Find the First Contiguous HaikuFaire · PHONE SCREEN
  • Shortest Deletion for a Distinct RemainderGoogle · PHONE SCREENGoogle interview questions
  • Longest Substring Without Repeating CharactersCapgemini · PHONE SCREENCapgemini interview questions

Interview reports that mention this question

  • Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)
  • Bloomberg New Grad SWE Offer Loops: 14 Experiences (Part 2 of 5)

Bloomberg LP interview experiences

  • Bloomberg AI-Assisted Coding Round, All Levels: 14 Experiences
  • Bloomberg SWE Intern Interview Questions: 68 Questions
  • Bloomberg Interview Questions, Level Not Reported: 65 Questions
  • Bloomberg Experienced Design & More: 126 Questions (Part 2 of 2)
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights
Saved
class Solution {
    public long countVowelSubstrings(String word) {
        // Write your code here.
    }

}
Checking account…