FastPrepMarket Data Signal Watcher
Problems/Market Data Signal Watcher

Market Data Signal Watcher

Hudson River Trading logoHudson River Trading● EasyFULLTIMEPHONE SCREEN
QuestionFunctionExamplesConstraints

Problem statement

Source note: The interview report identifies a market-data callback that keeps state across symbol-price updates and invokes a signal handler when a configured condition becomes true, but omits the concrete condition, transition semantics, finite runner shape, and bounds. The judged core task matches the visible source at about 82%.

Simulate a market-data signal watcher over an ordered batch of updates. Update i sets the latest price of symbols[i] to prices[i].

The configured condition is true exactly when the watcher has received at least one price for watchSymbol and its latest price is greater than or equal to threshold. Before the first price for watchSymbol, the condition is false.

After applying each update, invoke the signal handler exactly when the condition changed from false immediately before that update to true immediately after it. While the condition remains true, later updates do not invoke the handler again. A later update for watchSymbol below threshold makes the condition false and rearms the watcher, allowing a future qualifying update to invoke the handler again. Updates for other symbols preserve the current condition.

Return a boolean array signals, where signals[i] is true if and only if the signal handler is invoked after update i.

Function

marketDataSignals(symbols: String[], prices: int[], watchSymbol: String, threshold: int) → boolean[]

Examples

Example 1

symbols = ["AAPL","AAPL","AAPL","AAPL"]prices = [99,100,101,98]watchSymbol = "AAPL"threshold = 100return = [false,true,false,false]

The first update leaves the condition false. The price 100 changes it to true and invokes the handler. Price 101 keeps it true without another invocation, and price 98 rearms the watcher without signaling.

Example 2

symbols = ["MSFT","AAPL","MSFT","AAPL","AAPL"]prices = [500,90,510,110,105]watchSymbol = "AAPL"threshold = 100return = [false,false,false,true,false]

The MSFT updates do not change the watched condition. The first AAPL price is below the threshold; the later price 110 creates the only false-to-true transition.

Example 3

symbols = ["TSLA","NVDA","TSLA","TSLA","NVDA","NVDA"]prices = [5,10,7,8,9,10]watchSymbol = "NVDA"threshold = 10return = [false,true,false,false,false,true]

The first NVDA update reaches the inclusive threshold and signals. Two unrelated updates preserve the true condition. Price 9 rearms the watcher, so the final price 10 signals again.

Constraints

  • 1 <= symbols.length == prices.length <= 200000
  • 1 <= symbols[i].length, watchSymbol.length <= 20
  • Every symbol contains only uppercase English letters, decimal digits, or _.
  • 0 <= prices[i], threshold <= 10^9

More Hudson River Trading problems

  • Format a Signed Integer with CommasPHONE SCREEN · Seen Nov 2026
  • Order and Batch Open-Close LifecyclePHONE SCREEN · Seen Nov 2026
  • Count Palindrome Addition ChoicesOA · Seen Nov 2026
All Hudson River Trading interview questionsSee Hudson River Trading hiring insights
Saved
class Solution {
    public boolean[] marketDataSignals(String[] symbols, int[] prices, String watchSymbol, int threshold) {
        // Write your code here.
    }
}
Checking account…