← Hudson River Trading Interview Insights

Hudson River Trading·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jul 2026

Summary

Got a simulation-style coding problem for a Hudson River Trading software engineer round. The problem looked like a queue/scheduling thing on the surface but had enough edge cases to trip you up if you weren't careful.

Questions Asked (1)

Q1

A lab has a single molecular reactor that processes one sample at a time, taking exactly 5 minutes (300 seconds) each. Samples arrive at integer timestamps. A cooling chamber holds at most 10 waiting samples. If a sample arrives when the chamber is full, it gets rejected. If a sample arrives exactly when another finishes processing, the chamber sample goes next and the new arrival waits. Given a sorted list of arrival times, return the time when all accepted samples finish processing.

Algorithms & Data StructuresSystem Design
Author's notes

The queue simulation part was fine but I kept second-guessing the tie-breaking rule.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the system as a single-server queue with a finite buffer of size 10 and deterministic service time of 300 seconds. Simulate the process by tracking the reactor's next available time and the queue of waiting samples, carefully handling the tie-breaking rule when an arrival coincides with a service completion. Return the completion time of the last accepted sample.

Pro tip: Clarify the tie-breaking rule upfront: when an arrival occurs exactly at a service completion, the waiting sample goes next and the new arrival waits. This subtlety can change the result, so explicitly state your assumption and handle it in code.

1. Understand the problem and constraints

Restate the problem: single reactor, 5-minute service, buffer capacity 10, integer arrival times, and the specific tie-breaking rule. Identify that we need the finish time of all accepted samples.

2. Choose a simulation approach

Decide to simulate the process using a queue to represent the cooling chamber and a variable for the reactor's next available time. This is efficient because the number of samples is likely small.

3. Process arrivals and manage the queue

Iterate through arrival times. For each arrival, first advance the reactor's time if it has finished processing and move samples from the queue to the reactor as capacity allows. Then, if the queue size is less than 10, enqueue the arrival; otherwise, reject it.

4. Handle the tie-breaking rule

When an arrival time equals the reactor's next available time, ensure the waiting sample (if any) is processed first, and the new arrival is enqueued only if there is space. This may require processing the queue before handling the new arrival.

5. Compute the final completion time

After all arrivals are processed, continue processing any remaining samples in the queue. The final completion time is the reactor's next available time after the last sample finishes.

Key Points to Mention

  • Queue simulation with a fixed-size buffer (capacity 10).
  • Tracking the reactor's next available time and updating it by 300 seconds per sample.
  • Handling the tie-breaking rule: when arrival time equals completion time, the waiting sample goes first.
  • Rejecting samples when the buffer is full (queue size == 10).
  • Edge cases: empty input, all samples rejected, arrivals before reactor is free.
  • Time complexity: O(n) where n is the number of arrivals, since each sample is processed at most once.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.