PracHub
QuestionsPremiumLearningGuidesCheatsheetNEW
|Home/Coding & Algorithms/Bloomberg

Generate all strings by expanding wildcards

Last updated: Mar 29, 2026

Quick Overview

This question evaluates algorithmic string manipulation and combinatorial enumeration skills, focusing on handling wildcard characters and generating all possible binary outcomes from a pattern.

  • medium
  • Bloomberg
  • Coding & Algorithms
  • Software Engineer

Generate all strings by expanding wildcards

Company: Bloomberg

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

## Problem Given a string `s` consisting only of characters `'0'`, `'1'`, and `'*'`, replace every `'*'` with either `'0'` or `'1'` and return **all possible resulting binary strings**. You may return the results in **any order**. ## Example Input: `"01*"` Output: `["010", "011"]` Input: `"1*0*"` Output: `["1000","1001","1100","1101"]`

Quick Answer: This question evaluates algorithmic string manipulation and combinatorial enumeration skills, focusing on handling wildcard characters and generating all possible binary outcomes from a pattern.

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
Dec 15, 2025, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
9
0

Problem

Given a string s consisting only of characters '0', '1', and '*', replace every '*' with either '0' or '1' and return all possible resulting binary strings.

You may return the results in any order.

Example

Input: "01*"

Output: ["010", "011"]

Input: "1*0*"

Output: ["1000","1001","1100","1101"]

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.