Bloomberg software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
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)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...
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:
k = 2, prices = [2, 4, 1, 7, 5] 7 k = 1, prices = [3, 2, 6, 5, 0, 3] 4 1 <= k <= 100 0 <= prices.length <= 1000 0 <= prices[i] <= 1000 Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free