Reported February 2024
Hudson River Trading

Harvest Crops

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

Hudson River Trading sent you Harvest Crops in February 2024, and you've got no problem text to study from. That's actually the test. What you're facing is a grid traversal or state-space search problem where you're optimizing something over a landscape. Could be DP, could be greedy, could be BFS. The title hints at collecting resources across a 2D field. StealthCoder will read the actual problem on your screen and give you the pattern in real time if your mind blanks under pressure.

Pattern and pitfall

Harvest Crops almost certainly involves a grid where you pick up items, avoid obstacles, or maximize some metric. The trap is assuming a simple greedy approach works. Most candidates jump to 'always go to the nearest crop' and fail on test cases where order matters or backtracking is cheaper. The real solution likely needs dynamic programming (if you can revisit cells with diminishing returns), BFS (if it's shortest path with constraints), or careful state tracking (if you have limited moves or carrying capacity). The pattern hinges on whether you can revisit tiles and whether the cost changes. Without the problem text, assume you'll need to handle multiple objectives or a non-obvious traversal order.

If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.

If this hits your live OA

You can drill Harvest Crops 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 by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.

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 by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Harvest Crops FAQ

Is this a shortest-path problem?+

Probably not pure shortest path. It's more likely optimizing total harvest or cost while traversing. If there's a path component, it's secondary to maximizing or minimizing a resource metric. Read the objective carefully on the screen.

Will greedy work?+

Almost never. Harvest problems usually punish greedy because local choices (grab the nearest crop) create global inefficiency. Expect to revisit your traversal order or use DP to compare paths.

What if I can't see the full problem before coding?+

Start by parsing the input format and constraints. Build a grid. Write a BFS skeleton. Then adapt based on the actual objective. Don't commit to DP or greedy until you understand what you're optimizing.

Is this Hudson River Trading specific?+

HRT favors algorithms that involve state space, constraints, and resource optimization. They're not looking for a one-liner. Expect a 20-40 line solution with careful bookkeeping.

How do I hedge if I blank on the pattern?+

Have a BFS template and a 2D DP template ready in your head. Both handle grid traversal. The OA will reveal which one. StealthCoder sees it first and tells you which direction to code.

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