FastPrepSpelling Bee Word Filter
Problems/Spelling Bee Word Filter

Spelling Bee Word Filter

Bloomberg LP logoBloomberg LP● EasyNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report gives the Spelling Bee rules, one required letter, six optional letters, and example words such as ENCODE, NONCE, DONE, NODE, POLE and TONE. Its second example also lists TROPE, even though R is in neither the required nor the optional letters. We follow the rule that no other letters are allowed, so we reject TROPE. Words are lowercase and different from each other, the output keeps the dictionary order, and the six optional letters come as one string.

You are given an array of unique lowercase words dictionary, a one-character string required, and a six-character string optional.

Return every dictionary word that satisfies all of these rules:

  • The word contains at least four letters.
  • The required letter appears at least once.
  • Every character is either the required letter or one of the optional letters.
  • Allowed letters may be repeated any number of times.

Preserve the words' original dictionary order.

Function

spellingBeeWords(dictionary: String[], required: String, optional: String) → String[]

Examples

Example 1

dictionary = ["encode","nonce","done","node","oven","deed","coded","envy","no"]required = "n"optional = "vcodey"return = ["encode","nonce","done","node","oven","envy"]

deed and coded omit the required letter, while no is too short.

Example 2

dictionary = ["pole","tone","toll","gone","trope","ton","google","people","noon","longer"]required = "o"optional = "gleptn"return = ["pole","tone","toll","gone","google","people","noon"]

ton is shorter than four letters. trope and longer contain the disallowed letter r.

Example 3

dictionary = []required = "a"optional = "bcdefg"return = []

An empty dictionary has no matching words.

Constraints

  • 0 <= dictionary.length <= 100000.
  • Every dictionary word is unique, nonempty, and contains only lowercase English letters.
  • The total number of characters across dictionary is at most 1000000.
  • required contains exactly one lowercase English letter.
  • optional contains exactly six distinct lowercase English letters, none equal to required.

More Bloomberg LP Phone Screen questions

  • 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
  • Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Sparse Vector and Matrix OperationsPHONE SCREEN · Seen Oct 2026

Similar questions at other companies

  • Repeated DNA SequencesNVIDIA · PHONE SCREENNVIDIA interview questions
  • Numeric Wildcard Dictionary MatchingHeadlands Technologies · PHONE SCREENHeadlands Technologies interview questions
  • Palindrome-Rearrangeable PairsExpedia · OAExpedia interview questions
  • Palindrome PermutationRippling · OARippling interview questions
  • Password Clues and the Next CommandOpenAI · OAOpenAI interview questions
  • Count Magical Adjacent Substring TripletsGoogle · ONSITE INTERVIEWGoogle interview questions
  • Longest Substring with Even OccurrencesDeloitte · OADeloitte interview questions
  • 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

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)
  • Bloomberg Experienced SWE Interviews: 167 Questions (Part 1 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 String[] spellingBeeWords(String[] dictionary, String required, String optional) {
        // Write your code here.
    }

}
Checking account…