Hudson River Trading Online Assessment | A quick look at four question ideas: logic, simulation, arrays, and stacks covered!

539 Views
No Comment

I just took a student through a game last week. Hudson River Trading 's Online Assessment, a 90-minute set of four questions in a row, is very typical in style -- each question is like a test of your logical rigor and boundary awareness when writing code.
HRT's OA does not rely on tricky algorithms to win, but rather examines your engineering thinking and implementation details through multiple layers of logic nesting and data structure mixing.
Here are the full recap version of the thoughts on the four questions.

Hudson River Trading Online Assessment

Hudson River Trading OA Interview Overview

Hudson River Trading's technical hiring process has always been known as "fast, accurate, and stable" and is divided into three stages: Online Assessment (OA) + Technical Interviews + Culture Fit/Final Round. The overall process is divided into three stages: Online Assessment (OA) + Technical Interviews + Culture Fit/Final Round.

1️⃣ Online Assessment (OA)
This round is usually the most critical screening session, with four questions comprehensively covering algorithms, logic, data structures and simulation calculations, with a large number of questions and a tight time frame, requiring extreme pace control and realization accuracy.
The pass rate isn't great, but if you can AC more than three questions in 90 minutes, you're basically solidly in the next round.

2️⃣ Technical Interviews
Usually 2 to 3 rounds to coding + math + logic To the core.

  • Coding: focuses on clean code and clarity of thought, with common topics including arrays, strings, search and probability simulation.
  • Math/Logic: tests discrete thinking and computational accuracy, e.g., randomness problems, complexity analysis.
  • Discussion: Maybe a follow up question like "what if the input size gets bigger" along the lines of the question you asked in the OA.

3️⃣ Final / Culture Fit
The final round is more of a "Trader + Engineer hybrid", where you are tested on your understanding of system efficiency, risk control, and collaborative approaches; HRT emphasizes speed of thinking and logical reasoning.

Overall, HRT's interview system does not aim at showing off skills, but rather at examining a candidate's ability to keep a clear mind and write robust code in a time-critical manner.
If you can demonstrate good logic and implementation skills at the OA stage, the pace of subsequent interviews will be much smoother.

Q1: Find Peaks

Problem.
Given an integer array, find all indices that are "peaks."
An element is a peak if.

  • It's larger than its neighbor(s).
  • the first element is a peak if it's greater than the second.
  • the last element is a peak if it's greater than the second last.

Solution Idea.
Traverse the array once and handle three cases separately - first, middle, last.

Idea:

  1. For intermediate elements, the judgment arr[i] > arr[i-1] && arr[i] > arr[i+1].
  2. For the first and last elements, determine if they are larger than their unique neighbor, respectively.
  3. Output of subscript records that satisfy the conditions.

The focus of this problem is on clear boundary conditions and concise logical judgments. Overall complexity O(n).

Q2: Count Substrings Divisible by 3

Problem.
Given a numeric string, count all substrings that are divisible by 3 and do not have leading zeros.

Solution Idea.
Use prefix sum modulo 3 and count matching remainders.

Idea:

  1. Compute the prefix sum prefix[i] % 3, and count the number of occurrences of the residue using a hash table.
  2. For the current remainder r, the number of valid substrings = the number of previous occurrences of the same remainder.
  3. process sth. separately '0': Although it is divisible by 3, it needs to be eliminated if the leading zero is illegal.
  4. The final accumulation yields the number of all legal substrings.

This is a typical modulo prefix sum problem, focusing on the leading zeros and the single character case.

Q3: Grid Simulation

Problem.
You are given a grid with obstacles (-1), teleport points, and a goal. Starting from a given cell, simulate movements step by step.
Return:

  • -1 if hit an obstacle.
  • -2 if stuck in a loop.
  • or the total steps to reach the goal.

Solution Idea.
Use a visited set to detect loops and a dictionary for teleportation.

Idea:

  1. Store all obstacle point and teleportation point coordinates in a set.
  2. Simulates movement from the starting point in a direction determined by the input rules (e.g. "U, D, L, R").
  3. Judgment for each new grid:
    • Whether or not it's out of bounds;
    • Whether or not it is a barrier (returns -1);
    • Whether to enter the ring (-2 if already present in visited).
  4. If the end point is reached, the number of steps is returned.

The key to this question is the "ring detection" logic, which indicates a dead loop once the state is duplicated. The implementation is similar to the BFS simulation, but only requires a linear scan.

Q4: Largest Square in Histogram

Problem.
Given an array representing histogram bar heights, find the area of the largest square that can fit entirely within the histogram.

Solution Idea.
Use a monotonic stack to find left and right smaller boundaries for each bar.

Idea:

  1. Use the monotonic stack to find the position of the first shorter post to the left and right of each post.
  2. Calculate the expandable width of this column:width = right[i] - left[i] - 1.
  3. Since it is a square, the side length side = min(height[i], width).
  4. Update the maximum area:max_area = max(max_area, side * side).

This question is similar to the classic "largest rectangle in histogram" except that it has an additional square constraint, and the idea is almost the same, but it examines your ability to morph the details.

The secret weapon for getting past HRT OA:Programhelp No Trace Voice Assisted Practical Program

If you've also recently been preparing for an online written test for Hudson River Trading OA or other quantitative positions, learn about our Programhelp no-touch remote assisting solution.
Our team has been accompanying students to battle with various top quantitative and technology companies, including HRT, Jane Street, Citadel, IMC, Optiver, Two Sigma, etc. We support on-line non-delayed voice prompts, real-time thought guidance, and synchronized explanation of code logic.

Compared with the traditional "brush-up" preparation, we emphasize the sense of rhythm and stable play - for example, in OA such as HRT, where time is tight and the logic of the questions is complex, many students do not know how to do it, but panic, which leads to mistakes in details. Our system can remind you of the rhythm by voice at key points, so that you can move forward steadily as if you had done it.

Currently, we have helped hundreds of students to pass OA and get interviews, covering different directions such as SDE, Quant, DS, and so on.
If you want to learn how to achieve zero errors in a real OA environment, please contact us for details of the latest question bank and remote assist program.

author avatar
jor jor
END
 0