Market Data Signal Watcher

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

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

With up to 200000 updates in the batch, anything that rescans history per update is dead on arrival. That's the setup in the Hudson River Trading OA reported in July 2026, the Market Data Signal Watcher. It looks like a stream-processing story, but it's a one-pass simulation with a single boolean of state. If you see it cold, the framing can make you overbuild. If you blank, StealthCoder runs invisibly on screen and hands you the clean loop as a safety net.

The problem

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 = 100
return = [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 = 100
return = [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 = 10
return = [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

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick is edge detection. Keep one boolean, call it active, for whether the condition is currently true. Walk the arrays once. If symbols[i] isn't watchSymbol, active stays put and signals[i] is false. If it matches, compute now = prices[i] >= threshold. Signal is true only when now is true and active was false. Then set active = now. That's O(n) time and O(n) for the output. Pitfalls: using strictly greater than when the threshold is inclusive, resetting state on unrelated symbols, and signaling on every true update instead of only the transition. Example 3 catches that last one, since the second NVDA signal only fires after 9 rearms it. Don't store a map of all symbols. Only the watched one matters. Compare strings with equals, not identity, in languages where that differs.

The honest play: practice the pattern, and have StealthCoder ready for the one you didn't see coming.

If this hits your live OA

You can drill Market Data Signal Watcher 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. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Hudson River Trading's OA.

Hudson River Trading reuses patterns across OAs. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Market Data Signal Watcher FAQ

How hard is the Market Data Signal Watcher really?+

Easy once you spot it's edge detection. It's a single pass with one boolean. The difficulty is reading the rearm rules carefully, not the algorithm. Most misses come from signaling on every true update instead of only false-to-true transitions.

What's the trick to this Hudson River Trading question?+

Track whether the condition was true before the update, compute whether it's true after, and signal only when it flipped from false to true. Updates for other symbols don't touch the state. That's the whole solution, and it runs in O(n).

Do I need a hash map of latest prices?+

No. Only watchSymbol matters, and the condition depends on its latest price alone. A map is wasted work. One boolean for the current condition is enough, since each matching update overwrites the previous price anyway.

What edge cases should I test before submitting?+

Test a price exactly equal to threshold, since it's inclusive. Test a drop below threshold followed by a recovery, which must signal again. Test a batch with no watchSymbol updates at all, which returns all false. Also test a single-element input.

How do I prepare for this in 48 hours?+

Practice stateful single-pass simulations: previous state, new state, act on the transition. Write this one from scratch twice and trace the three examples by hand. Be ready for variants like a falling-edge signal or a cooldown between signals.

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

OA at Hudson River Trading?
Invisible during screen share
Get it