InterviewLegend

Backtracking & Enumeration

Alex Chen22 min readUpdated 330 real interview reports

A few Bloomberg coding problems ask for every possible answer instead of one. That means routes between two cities on a flight network, subsets of a list that repeats values, or the strings a pattern of 0s, 1s and wildcards expands to. In the worst case the output alone is exponential, and no trick changes that. You write a search that produces each answer once and cleans up as it returns, then state its cost in terms of the output. The routes problem usually uses one-way flights between airports or lettered stops in place of numbered nodes. Its sample network can include a leg back to an earlier stop that the prompt doesn't point out. Ask whether the network can loop before you write anything, because that decides whether you need a visited set. Most follow-ups are about recursion. Interviewers ask what a recursive answer costs in memory, and sometimes the wildcard prompt itself asks for an iterative solution. The subsets version with repeated values can also take the second half of an hour that opened on plain subsets, so be ready to extend your own code with less time left.

BloombergPremium lesson · Coding round

The 3 Bloomberg problems are below.

  1. A Premium questionCoding · Medium
  2. A Premium questionCoding · Medium
  3. A Premium questionCoding · Medium

Each with hints, the follow-up and a tested solution.

Get the Bloomberg questions

$49 a year · all 100 companies · cancel anytime

From 330 Bloomberg reports, forum threads behind logins and write-ups in Chinese.

Had your Bloomberg interview?Tell us what they asked. Reviewed before it goes in, never with your name.
Bloomberg interview guide

Know what Bloomberg asks before you walk in.

27 coding · 4 system design · 15 behavioral questions

Get Premium$49 a year · Cancel anytime
Or start freeNo card.

Get their questions first.

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.