FastPrepGenerate Wildcard Binary Strings
Problems/Generate Wildcard Binary Strings

Generate Wildcard Binary Strings

Bloomberg LP logoBloomberg LP● EasyNEW GRADPHONE SCREENONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a firsthand Bloomberg London new grad phone-screen post. The prompt was only in an image. Here the results are in alphabetical order, so answers can be compared.

pattern contains 0, 1, and ?. Replace every wildcard independently with either 0 or 1 and return every resulting binary string in lexicographic order.

Function

expandWildcards(pattern: String) → String[]

Examples

Example 1

pattern = "01?0"return = ["0100","0110"]

The one wildcard produces two strings.

Example 2

pattern = "0??0"return = ["0000","0010","0100","0110"]

Two wildcards produce four strings.

Constraints

  • 0 <= pattern.length <= 20.

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

  • DFS Subsequences of a String (For MLE)CoinDCX · PHONE SCREEN
  • Enumerate Weekly Work SchedulesAgoda · PHONE SCREENAgoda interview questions
  • Largest Number Below N from Reusable DigitsByteDance · PHONE SCREENByteDance interview questions
  • All Balanced Strings from Minimum Parenthesis InsertionsRubrik · ONSITE INTERVIEWRubrik interview questions
  • Phone-Number Letter CombinationsHeadway · PHONE SCREENHeadway interview questions
  • Letter Combinations of a Phone NumberLinkedIn · PHONE SCREENLinkedIn interview questions
  • String Permutations in Custom Character OrderWex · OA · PHONE SCREEN
  • Remove Invalid ParenthesesMygate · ONSITE INTERVIEWMygate interview questions
  • Balanced Parentheses with Sequential Left DeletionsGoogle · PHONE SCREENGoogle interview questions
  • Generate Strings of Length at Least ThreeMorgan Stanley · ONSITE INTERVIEWMorgan Stanley interview questions

Interview reports that mention this question

  • Bloomberg Experienced Design & More: 126 Questions (Part 2 of 2)
  • Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)
  • Bloomberg New Grad OOD Follow-ups: 14 Experiences (Part 3 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
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights
Saved
class Solution {
    public String[] expandWildcards(String pattern) {
      // Write your code here.
    }
}
Checking account…