Bloomberg logo

Bloomberg Hard Interview Questions

5 hard-level practice questions for Bloomberg technical interviews

Bloomberg software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.

Software Engineer Backend Engineer Frontend Engineer Full Stack Engineer Mobile Engineer Data Engineer Data Scientist ML Engineer DevOps Engineer DevOps Engineer Product Manager SRE Security Engineer Engineering Manager Data Analyst UX/UI Designer QA Engineer
coding Hard Verified Question #1

1. Dual Extremes Queue


Category: Queue-based coding problem
Design a StreamBuffer class that buffers a stream of integer latency samples in FIFO order and supports O(1) access to both the minimum and maximum...
Input: Integer(s)
Output: Integer
Want to practise this one?
Create a free account to open the full question and practise Bloomberg questions with AI.
Sign up free
coding Hard Verified Question #2

2. Fuel Grid Navigation


Category: Grid/matrix coding problem

Question You are navigating a grid from a start cell S to a destination cell D. Your vehicle has a fuel tank with a maximum capacity. Moving...

Input: 2D grid
Output: Integer
coding Hard sliding window #1

1. [AI Enabled Coding] Trade Surveillance Rule Engine


Scenario
Bloomberg Trade Order Management Solutions (TOMS) supports institutional trading workflows. Build a prototype surveillance component for USD-denominated execution records that lets operations analysts identify unusually large executions, conflicting operator locations, and concentrated desk activity. The policies below are interview assumptions, not claims about Bloomberg's production surveillance rules; you may use an AI assistant while implementing and testing them.
Part 1 — Execution-level alerts
  • Each record has string-valued fields id, trader, desk, city, minute, and amount_usd. Minutes are absolute integer timestamps, not times of day; inputs may be unsorted.

  • AMOUNT_LIMIT: flag an execution when its amount is strictly greater than 1000.00 USD.

  • CITY_CONFLICT: flag an execution if another execution by the same trader occurred in a different city within 60 minutes inclusive, before or after it. Flag both executions in a conflicting pair, even across desks.

  • Evaluate rules independently against all original records. An execution that triggers one rule still participates in every other rule.

  • Return one result per input record, in input order, containing its ID and alphabetically sorted, unique rule names. Records without alerts must also appear.

  • Implement evaluate_executions(records: list[dict[str, str]]). The concrete return type is up to the candidate; the JSON below defines its observable contents.


Example 1:
Input:
{"records":[{"id":"a","trader":"u","desk":"A","city":"NYC","minute":"0","amount_usd":"1000.00"},{"id":"b","trader":"u","desk":"A","city":"London","minute":"60","amount_usd":"1000.01"},{"id":"c","trader":"u","desk":"A","city":"NYC","minute":"121","amount_usd":"500.00"},{"id":"d","trader":"v","desk":"B","city":"London","minute":"30","amount_usd":"400.00"},{"id":"e","trader":"v","desk":"B","city":"NYC","minute":"91","amount_usd":"100.00"}]}

Output:
[{"id":"a","rules":["CITY_CONFLICT"]},{"id":"b","rules":["AMOUNT_LIMIT","CITY_CONFLICT"]},{"id":"c","rules":[]},{"id":"d","rules":[]},{"id":"e","rules":[]}]

Explanation: a and b differ in city and are exactly 60 minutes apart. Only b exceeds 1000.00. The gaps from b to c and from d to e are 61 minutes, so those pairs do not conflict.
Part 2 — Configurable desk-window policies
Other surveillance teams now need desk-level rolling notional policies. Extend the function to evaluate_executions(records: list[dict[str, str]], desk_rules: list[dict[str, str]] | None = None) without replacing the Part 1 rules.
  • Each desk rule has string fields name, window_minutes, and cap_usd.

  • For an execution at minute t, sum amounts for its desk across all traders in the inclusive interval [t - window_minutes, t]. Include all executions tied at t, irrespective of input order.

  • Flag that execution with the configured rule name if the sum is strictly greater than cap_usd. This does not automatically flag other members of its window; each execution is evaluated at its own timestamp.

  • Previously flagged executions still contribute their full amounts. Desks are independent.

  • When desk_rules is provided, return an object containing records, with the Part 1 result shape, and breaches, with one {id, rule, total_usd} item per violated desk rule. Format totals with exactly two decimal places. Order breaches by input-record position, then rule name. An empty configuration list still selects this extended output shape.

  • The design must support future desk-window policies through configuration and future rule implementations without rewriting the existing rules. Discuss how the return type changes before implementing the extension.


Example 2:
Input:
{"records":[{"id":"p","trader":"p1","desk":"A","city":"NYC","minute":"0","amount_usd":"900.00"},{"id":"q","trader":"q1","desk":"A","city":"NYC","minute":"30","amount_usd":"900.00"},{"id":"r","trader":"r1","desk":"A","city":"NYC","minute":"60","amount_usd":"800.00"},{"id":"s","trader":"s1","desk":"A","city":"NYC","minute":"61","amount_usd":"1000.00"}],"desk_rules":[{"name":"DESK_60M","window_minutes":"60","cap_usd":"2500.00"}]}

Output:
{"records":[{"id":"p","rules":[]},{"id":"q","rules":[]},{"id":"r","rules":["DESK_60M"]},{"id":"s","rules":["DESK_60M"]}],"breaches":[{"id":"r","rule":"DESK_60M","total_usd":"2600.00"},{"id":"s","rule":"DESK_60M","total_usd":"2700.00"}]}

Explanation: The totals at minutes 0 and 30 are 900.00 and 1800.00. At minute 60, the inclusive window contains p + q + r = 900 + 900 + 800 = 2600, exceeding 2500. At minute 61, p expires, giving q + r + s = 900 + 800 + 1000 = 2700. No execution exceeds the individual amount limit, and every trader is distinct.
Example 3:
Input:
{"records":[{"id":"x","trader":"u","desk":"A","city":"London","minute":"60","amount_usd":"1500.00"},{"id":"y","trader":"u","desk":"A","city":"NYC","minute":"0","amount_usd":"1000.00"},{"id":"z","trader":"v","desk":"A","city":"NYC","minute":"60","amount_usd":"0.00"},{"id":"w","trader":"u","desk":"A","city":"NYC","minute":"120","amount_usd":"1000.00"},{"id":"v","trader":"k","desk":"B","city":"NYC","minute":"60","amount_usd":"999.00"}],"desk_rules":[{"name":"DESK_60M","window_minutes":"60","cap_usd":"2000.00"}]}

Output:
{"records":[{"id":"x","rules":["AMOUNT_LIMIT","CITY_CONFLICT","DESK_60M"]},{"id":"y","rules":["CITY_CONFLICT"]},{"id":"z","rules":["DESK_60M"]},{"id":"w","rules":["CITY_CONFLICT","DESK_60M"]},{"id":"v","rules":[]}],"breaches":[{"id":"x","rule":"DESK_60M","total_usd":"2500.00"},{"id":"z","rule":"DESK_60M","total_usd":"2500.00"},{"id":"w","rule":"DESK_60M","total_usd":"2500.00"}]}

Explanation: x exceeds the individual limit and conflicts with both y and w, each exactly 60 minutes away. At minute 60, both x and z see y + x + z = 1000 + 1500 + 0 = 2500. At minute 120, w sees x + z + w = 1500 + 0 + 1000 = 2500; already-flagged x is not excluded. These totals exceed 2000. At minute 0, desk A totals 1000; desk B independently totals 999 at minute 60.
Notes:
  • There are at most 200,000 executions and 20 configured desk rules. Avoid enumerating conflicting pairs or rescanning a window for every execution; target O(n log n + kn + k log k) time for n executions and k desk rules.

  • Inputs are valid: IDs are unique, timestamps are nonnegative integers, amounts and caps are nonnegative USD strings with exactly two fractional digits, and windows are integers from 1 through 1440. Use exact monetary arithmetic.

  • Rule names are unique and cannot collide with built-in names; identifiers and city names are case-sensitive. This is a batch evaluation, and no state persists between calls.
Want to practise this one?
Create a free account to open the full question and practise Bloomberg questions with AI.
Sign up free
coding Hard binary search #2

2. [Divide and Conquer] — Count ships using a restricted geographic query API


Background
Bloomberg's commodity-market coverage includes shipping activity, where geographic queries can help analysts understand vessel movements. This problem models counting vessels when the underlying location service exposes only an existence query; counting ships in a rectangle was reported in a Bloomberg C++ developer interview.
Problem statement
You are given a Sea API and an axis-aligned rectangle defined by integer-coordinate points bottom_left and top_right. Each ship occupies a distinct integer-coordinate point.
The API method has_ships(top_right, bottom_left) returns true if at least one ship lies inside the specified rectangle, including its boundaries, and false otherwise. It does not reveal ship locations or counts. You may call it only with a valid rectangle.
Implement count_ships to return the exact number of ships in the requested rectangle using at most 400 API calls. There are at most 10 ships in the entire coordinate domain. You cannot inspect the API's internal data, and ships outside the requested rectangle must not be counted.
Function or class signature
  • Provided API: Sea.has_ships(top_right: tuple[int, int], bottom_left: tuple[int, int]) -> bool

  • Implement: count_ships(sea: Sea, top_right: tuple[int, int], bottom_left: tuple[int, int]) -> int


Each tuple is ordered as (x, y).
Example 1:
  • Input: Hidden ship locations are [(1, 1), (2, 2), (3, 3), (8, 8)]; top_right = (4, 4); bottom_left = (1, 1).

  • Output: 3

  • Explanation: The first three ships lie within the requested rectangle. The ship at (1, 1) is included because boundaries are inclusive; (8, 8) is outside. Locations are shown only to explain the example and are not supplied to your function.


Example 2:
  • Input: Hidden ship locations are [(0, 0), (5, 0), (5, 5)]; top_right = (5, 0); bottom_left = (1, 0).

  • Output: 1

  • Explanation: This rectangle is a horizontal line segment. It includes (5, 0), excludes (0, 0), and does not include (5, 5).


Constraints:
  • All coordinates are integers in [0, 1000].

  • bottom_left.x <= top_right.x and bottom_left.y <= top_right.y.

  • There are between 0 and 10 ships in the entire domain, with no duplicate locations.

  • Ship locations remain unchanged during execution, and API responses are exact.

  • Each invocation of count_ships may make at most 400 API calls.

  • The implementation must use only the provided API to obtain information about ships.


Follow-up:
Suppose coordinates range from 0 to 10^9, and the maximum ship count is an input parameter K. Derive an API-call bound in terms of K and the rectangle's dimensions, and explain whether a fixed 400-call budget can still be guaranteed.
coding Hard dynamic programming #3

3. Dynamic Programming — Maximize Profit from Stock Trading

Background: In the financial domain, Bloomberg provides tools for stock market analysis, including trading strategies. Understanding how to maximize profit through stock trading is crucial for building robust trading systems.
Problem statement: You are given an array of integers where each integer represents the price of a stock on a given day. You can complete at most k transactions (i.e., buy and sell the stock). Your goal is to maximize your profit. You can assume that you cannot sell a stock before you buy it.
You need to implement a function that calculates the maximum profit that can be achieved with at most k transactions.
Function signature:
def max_profit(k: int, prices: List[int]) -> int:

Example 1:
Input: k = 2, prices = [2, 4, 1, 7, 5]
Output: 7
Explanation: Buy on day 1 (price = 2) and sell on day 2 (price = 4), profit = 2. Buy on day 3 (price = 1) and sell on day 4 (price = 7), profit = 6. Total profit = 2 + 6 = 8.
Example 2:
Input: k = 1, prices = [3, 2, 6, 5, 0, 3]
Output: 4
Explanation: Buy on day 2 (price = 2) and sell on day 3 (price = 6), profit = 6 - 2 = 4.
Constraints:
  • 1 <= k <= 100

  • 0 <= prices.length <= 1000

  • 0 <= prices[i] <= 1000

Start practicing Bloomberg questions

Sign up for free to access walkthroughs, AI-generated questions, and more.

Get Started Free