Reported September 2026
Bloomberggraph

Currency Conversion Rate

Reported by candidates from Bloomberg's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Bloomberg OA. Under 2s to a working solution.
Founder's read

The Bloomberg OA from September 2026 hands you a pile of currency rates and asks for one conversion, and the whole thing hinges on one data structure: a weighted graph. If you see rows of pairs and think lookup table, you'll stall. You have a day or two, so know the shape now. Currencies are nodes, each rate is an edge, and every edge also works backward as its reciprocal. Search from the source to the target and multiply as you go. If you blank during the live OA, StealthCoder runs invisibly as a safety net and gives you the approach.

The problem

You are given currency conversion rates. Each row contains a source currency, a target currency, and the value of one unit of the source currency in the target currency.
A conversion may use multiple rates. A listed rate may also be used in reverse by taking its reciprocal.
Given a query [from, to], return the conversion rate from from to to, rounded and formatted with exactly two digits after the decimal point. Every judged query is connected by the supplied rates.

Function
findConversionRate(rates: String[][], query: String[]) → String

Examples
Example 1
rates = [["USD","JPY","110"],["USD","AUD","1.45"],["JPY","GBP","0.0070"]]
query = ["GBP","AUD"]
return = "1.88"
Use the reverse of JPY -> GBP, then the reverse of USD -> JPY, then USD -> AUD: (1 / 0.0070) * (1 / 110) * 1.45 = 1.883116.... Rounded to two decimal places, the result is 1.88.
Example 2
rates = [["USD","CAD","1.30"],["CAD","EUR","0.70"]]
query = ["USD","EUR"]
return = "0.91"
One USD is 1.30 CAD, and one CAD is 0.70 EUR, so the rate is 1.30 * 0.70 = 0.91.

Reported by candidates. Source: FastPrep

Pattern and pitfall

Build an adjacency map. For each row [a, b, r], store a to b with weight r and b to a with weight 1/r. Then run DFS or BFS from the query's source, carrying the running product, until you hit the target. Keep a visited set so cycles don't loop forever. The input guarantees every query is connected, so you don't need a no-path case, though returning something safe is cheap. Union-find with weighted ratios also works, but the graph walk is easier to write under pressure. Pitfalls: forgetting the reverse edge, which breaks Example 1, and formatting. The answer must be a string with exactly two decimals, so use a format call, not a raw double print. Also handle from equal to to, which should return 1.00. StealthCoder is your hedge if the graph idea won't come when the timer is running.

StealthCoder is the hedge for the one pattern you didn't drill. It runs invisibly during the screen share.

If this hits your live OA

You can drill Currency Conversion Rate cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. If you're reading this with an OA window open, you're who this was built for.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as evaluate division. If you have time before the OA, drill that.

⏵ The honest play

You've seen the question. Make sure you actually pass Bloomberg's OA.

Bloomberg reuses patterns across OAs. If you're reading this with an OA window open, you're who this was built for. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Currency Conversion Rate FAQ

What's the trick in the Bloomberg currency conversion problem?+

Treat currencies as nodes and rates as weighted edges. Add each rate in both directions, with the reverse stored as 1 divided by the rate. Then traverse from the source to the target, multiplying weights along the path. The product is your answer.

Should I use DFS, BFS, or union-find?+

DFS or BFS is the fastest to write and fully correct here. Any path gives the same product when the rates are consistent. Weighted union-find works too, but it's easier to get wrong under time pressure. Pick the traversal you can code without thinking.

How do I get the two-decimal output right?+

Return a string, not a number. Use your language's fixed-format call with two decimals, like a format specifier for 2 places. Example 1 gives 1.883116... and must come back as 1.88. Test that a value like 0.91 prints with its trailing digits intact.

What edge cases should I check?+

Check that the query's source equals its target, which should give 1.00. Check that a path needing only reversed edges works, as in Example 1. Make sure a visited set stops cycles. The statement says every query is connected, so a no-path case shouldn't be judged.

How do I prepare for this in 48 hours?+

Write this one from scratch twice: build the bidirectional adjacency map, run DFS with a running product, and format the result. Then do one other graph traversal problem with weighted edges. The pattern is small, so reps matter more than reading theory.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Bloomberg.

OA at Bloomberg?
Invisible during screen share
Get it