blog-cover-image

Hudson River Trading Quant Interview: Top Questions & Tips

The quant researcher interview at Hudson River Trading (HRT) is known to be among the most intellectually stimulating in the quantitative finance industry. Candidates are expected to master a broad spectrum of mathematical, statistical, and logical reasoning problems. In this article, we solve and explain some Hudson River Trading quant researcher interview questions.

Hudson River Trading Quant Researcher Interview Questions


1. Permutations: Variance of Fixed and Non-Fixed Points

Problem Statement

Consider a random permutation of the numbers \(1, 2, ..., 31415\). Let \(A\) be the number of fixed points (elements that remain in their original position), and let \(B\) be the number of non-fixed points. What is the variance of \(B-A\)?

Step-by-Step Solution

Step 1: Relate \(A\), \(B\), and \(n\)

Let \(n = 31415\). By definition:

  • \(A\): The number of fixed points in the permutation.
  • \(B\): The number of non-fixed points.

Since every number is either fixed or not fixed:

\[ A + B = n \]

Therefore, \[ B - A = (n - A) - A = n - 2A \]

To understand the question clearly, take a small example. Say n = 4. The number sequence is 1,2,3,4. A is the random variable of number of fixed points in the permutations.

Let's say that position 1 is fixed. We don't care about 2, 3, or 4.

Let's count the permutations.

Fix 1: Now arrange 2,3,4 any way you like: number of ways = 3!=6

Those 6 permutations are:

1234,  1243,  1324,  1342,  1423,  1432

Permutation   Number of fixed points
1234 4 (all are in their original position)
1243 2 (1 and 2 are in their original position)
1324 2 (1 and 4 are in their original position)
1342 1 (1 is in its original position)
1423 1 (1 is in its their original position)
1432 2 (1 and 3 are in their original position)
 
If we define indicator variables for each position: \[ I_i = \begin{cases} 1 & \text{if position } i \text{ is fixed} \\ 0 & \text{otherwise} \end{cases} \]
 
Every one of the above permutation has \(I_1=1\) , because the number in position 1 is fixed (i.e. it is in its original position)

Therefore,

\[P(I_1=1) = \frac{6}{24} = \frac{1}{4}.\]

Note that this will always be equal to \[\frac{(n-1)!}{n!} = \frac{1}{n}​\].

So if \(I_i \) is our Bernoulli random variable, \(P(I_i=1) = 1/n \)

Step 2: Variance Transformation

Recall that adding a constant does not affect the variance. Also, scaling by a constant scales the variance by the square of that constant:

\[ \text{Var}(B - A) = \text{Var}(n - 2A) = 4\,\text{Var}(A) \]

Thus, our task reduces to finding \(\text{Var}(A)\).

Step 3: Modeling \(A\) with Indicator Variables

We defined our Bernoulli random variables (indicator variables) for each position: \[ I_i = \begin{cases} 1 & \text{if position } i \text{ is fixed} \\ 0 & \text{otherwise} \end{cases} \]

Then, \[ A = \sum_{i=1}^{n} I_i \]

Step 4: Compute \(\mathbb{E}[I_i]\) and \(\text{Var}(I_i)\)

We know that \( I_i \) is a Bernoulli random variable. 

As seen earlier, the probability that element \(i\) is fixed in a random permutation is: \[ \mathbb{P}(I_i = 1) = \frac{1}{n} \]

Therefore, \[ \mathbb{E}[I_i] = \frac{1}{n} \] \[ \text{Var}(I_i) = \mathbb{E}[I_i^2] - (\mathbb{E}[I_i])^2 = \frac{1}{n} \left(1 - \frac{1}{n}\right) \]

Step 5: Covariance Between Different \(I_i\) and \(I_j\)

For \(i \neq j\), the probability that both positions are fixed is: \[ \mathbb{P}(I_i = 1 \ \text{and}\ I_j = 1) = \frac{1}{n(n-1)} \]

So, \[ \text{Cov}(I_i, I_j) = \mathbb{E}[I_i I_j] - \mathbb{E}[I_i] \mathbb{E}[I_j] = \frac{1}{n(n-1)} - \left(\frac{1}{n}\right)^2 = \frac{1}{n(n-1)} - \frac{1}{n^2} \]

Simplify: \[ \frac{1}{n(n-1)} - \frac{1}{n^2} = \frac{n - (n-1)}{n^2(n-1)} = \frac{1}{n^2(n-1)} \]

Step 6: Variance of \(A\)

Variance of a sum: \[ \text{Var}(A) = \sum_{i=1}^n \text{Var}(I_i) + 2\sum_{1 \leq i < j \leq n} \text{Cov}(I_i, I_j) \]

  • Sum of variances: \[ n \cdot \text{Var}(I_i) = n \cdot \frac{1}{n}(1 - \frac{1}{n}) = 1 - \frac{1}{n} \]
  • Sum of covariances: \[ 2 \cdot \binom{n}{2} \cdot \frac{1}{n^2(n-1)} = 2 \cdot \frac{n(n-1)}{2} \cdot \frac{1}{n^2(n-1)} = \frac{n(n-1)}{n^2(n-1)} = \frac{1}{n} \]

Therefore, \[ \text{Var}(A) = 1 - \frac{1}{n} + \frac{1}{n} = 1 \]

Step 7: Final Answer

Recall: \[ \text{Var}(B - A) = 4\,\text{Var}(A) = 4 \times 1 = 4 \]

Thus, the variance of \(B-A\) is 4.


2. Probability: Center Inclusion in a Random n-gon on a Circle

Problem Statement

Let \(n\) points be placed on the circumference of a circle. What is the probability that the convex \(n\)-gon formed by these points includes (contains) the center of the circle?

Step-by-Step Solution

Step 1: Visualize the Problem

Randomly select \(n\) points on the circle. The convex hull is the entire circle, but the polygon formed by connecting these points may or may not contain the center.

Step 2: Key Insight

The center is inside the \(n\)-gon if and only if all the points do not lie in any semicircle.

Equivalently: The center is inside the convex hull if and only if no arc (less than or equal to half the circle) contains all the points.

Step 3: Counting Favorable Arrangements

Imagine fixing the first point and arranging the others. For the center to be excluded, all points must fall within some semicircle.

The number of ways all \(n\) points can be contained within a semicircle is \(2n\):

  • For each of the \(n\) points, there are two possible semicircles (clockwise and counterclockwise) starting from that point.

 

Step 4: Total Arrangements

The total number of ways to select \(n\) points on the circle (modulo rotation) is \(2^n\).

Step 5: Probability Calculation

The probability the center is NOT included is: \[ P_\text{not inside} = \frac{2n}{2^n} \] Therefore, the probability the center IS inside is: \[ P_\text{inside} = 1 - \frac{2n}{2^n} \]

This formula is valid for \(n \geq 3\).

Example Calculation

For \(n=4\): \[ P_\text{inside} = 1 - \frac{8}{16} = 0.5 \]

General Answer

The probability that the center is included in the convex \(n\)-gon is: \[ \boxed{1 - \frac{2n}{2^n}} \]


3. Covariance Matrices: Sums and Products

Problem Statement

Let \(A\) and \(B\) be two covariance matrices.

  • Is \(A+B\) also a covariance matrix?
  • How about \(A^2\)?
  • How about \(AB\)?

 

Step-by-Step Solution

What is a Covariance Matrix?

A covariance matrix is a symmetric, positive semi-definite matrix. For any real-valued random vector \(X\), \[ \Sigma = \mathbb{E}\left[(X - \mathbb{E}X)(X - \mathbb{E}X)^T\right] \] is a covariance matrix. Properties:

  • Symmetric: \(\Sigma^T = \Sigma\)
  • Positive semi-definite: For all \(v\), \(v^T \Sigma v \geq 0\)

 

Is \(A+B\) a Covariance Matrix?

Yes. The sum of two symmetric, positive semi-definite matrices is symmetric and positive semi-definite. Therefore, \(A+B\) is a covariance matrix.

Is \(A^2\) a Covariance Matrix?

Let’s analyze:

  • If \(A\) is positive semi-definite and symmetric, then \(A^2 = A \cdot A\) is also symmetric and positive semi-definite. In fact, if \(A\) is positive semi-definite, so is any positive integer power (since all eigenvalues are non-negative, and squaring preserves this).

Thus, \(A^2\) is also a covariance matrix.

 

Is \(AB\) a Covariance Matrix?

In general, no. Even though \(A\) and \(B\) are symmetric and positive semi-definite, the product \(AB\) is not necessarily symmetric, nor positive semi-definite, unless \(A\) and \(B\) commute (\(AB=BA\)) and share the same eigenvectors.

In general, \(AB\) is not a covariance matrix.

Summary Table

Operation Covariance Matrix? Reason
\(A+B\) Yes Sum of symmetric positive semi-definite matrices is symmetric and positive semi-definite
\(A^2\) Yes Power of symmetric positive semi-definite matrix is symmetric and positive semi-definite
\(AB\) No (in general) Product may not be symmetric or positive semi-definite

4. Probability: Balls and Bowls

Problem Statement

You have three bowls:

  • Bowl 1: Two blue balls
  • Bowl 2: Two red balls
  • Bowl 3: One blue ball and one red ball

You pick a bowl at random, then draw one ball from it at random. Given that you have drawn a blue ball, what is the probability that if you draw the other ball from the same bowl, it is also blue?

 

Step-by-Step Solution

Step 1: Calculate the Probability Tree

Let’s list all possible ways to draw a blue ball:

  • Bowl 1: Both balls are blue; probability of picking this bowl is \(1/3\); probability of drawing blue is 1.
  • Bowl 2: Both balls are red; probability of picking this bowl is \(1/3\); probability of drawing blue is 0.
  • Bowl 3: One blue, one red; probability of picking this bowl is \(1/3\); probability of drawing blue is \(1/2\).

 

Total probability of drawing a blue ball: \[ P(\text{blue}) = \frac{1}{3} \times 1 + \frac{1}{3} \times 0 + \frac{1}{3} \times \frac{1}{2} = \frac{1}{3} + 0 + \frac{1}{6} = \frac{1}{2} \]

Step 2: Use Bayes' Theorem

We want \(P(\text{next ball is blue} \mid \text{first ball is blue})\).

This can only happen if we are in Bowl 1 (both blue). So, first, find the probability that we were in Bowl 1 given that a blue ball was drawn.

Let \(B_1\) denote Bowl 1. By Bayes’ theorem: \[ P(B_1 \mid \text{blue}) = \frac{P(\text{blue} \mid B_1)P(B_1)}{P(\text{blue})} \] \[ = \frac{1 \cdot \frac{1}{3}}{\frac{1}{2}} = \frac{2}{3} \]

Bowl 3 (one blue, one red) is the only other possibility, but if you draw the other ball from Bowl 3, it will be red (with certainty).

So, the probability the next ball is blue is exactly the probability you were in Bowl 1, which is \(\boxed{\frac{2}{3}}\).

Step 3: Alternative Solution (Explicit Enumeration)

Let’s enumerate all possible blue ball draws:

  • Bowl 1: BB — two blue balls, two possible blue draws
  • Bowl 3: BR — one blue ball, one possible blue draw

 

Across all bowls and balls, the possible blue draws are:

  • Bowl 1, first blue: After, other is blue
  • Bowl 1, secondblue: After, other is blue
  • Bowl 3, blue: After, other is red

Let’s enumerate the sample space:


# For detailed enumeration:
# Each bowl: (name, balls)
bowls = [
    ("Bowl 1", ["Blue", "Blue"]),
    ("Bowl 2", ["Red", "Red"]),
    ("Bowl 3", ["Blue", "Red"])
]

# For each bowl, count favorable blue draws and what is left in the bowl
sample = []
for name, balls in bowls:
    for i, color in enumerate(balls):
        if color == "Blue":
            remaining = balls[1 - i]
            sample.append((name, color, remaining))
# sample now contains every possible way to draw a blue ball, and what's left

Let’s list the possibilities:

Bowl First Ball Drawn Other Ball in Bowl
Bowl 1 Blue (first) Blue
Bowl 1 Blue (second) Blue
Bowl 3 Blue Red

Each possibility is equally likely, as each bowl is chosen with probability \(1/3\), and each ball in the bowl is chosen with probability \(1/2\) (if two balls).

But let’s check the probabilities explicitly:

  • Bowl 1: \(1/3\) chance to pick, \(2\) blue balls, so \(2\) equally likely blue draws (of total \(6\) equally likely draws across all bowls and balls).
  • Bowl 3: \(1/3\) chance, \(1\) blue ball.

Total possible "blue ball drawn" events: \(2\) (Bowl 1) + \(1\) (Bowl 3) = \(3\).

 

Out of these \(3\) events, \(2\) have the other ball blue (both Bowl 1 cases), and \(1\) has the other ball red (Bowl 3).

Thus, the probability that the other ball is blue given that you drew a blue ball is: \[ P(\text{other blue} \mid \text{drawn blue}) = \frac{2}{3} \]


Summary Table: Key Results

Question Answer
Variance of \(B-A\) in a random permutation of \(n\) elements 4
Probability that random \(n\)-gon includes the center of the circle \(1 - \frac{2n}{2^n}\)
Is \(A+B\) a covariance matrix? Yes
Is \(A^2\) a covariance matrix? Yes
Is \(AB\) a covariance matrix? No (in general)
Probability of second blue ball given first blue ball (three bowls problem) \(\frac{2}{3}\)

Conceptual Explanations and Interview Tips

Fixed Points in Permutations

A fixed point of a permutation is an index that is mapped to itself. For a random permutation of \(n\) elements, the expected number of fixed points is 1, and the variance is also 1, regardless of \(n\). This surprising result comes from the independence and symmetry of permutations. Understanding indicator variables and covariance is critical.

Convex Polygons and the Center

This classic probability puzzle leverages geometric symmetry and combinatorial counting. The key insight is recognizing the equivalence between "not all points in a semicircle" and "center inclusion." For large \(n\), the probability approaches 1, as it's increasingly unlikely that all points cluster on one side.

Covariance Matrix Properties

  • Sum: Closed under addition — always yields a covariance matrix.
  • Powers: Symmetric powers preserve positive semi-definiteness.
  • Product: Not closed under multiplication; symmetry and positivity can be lost if the matrices do not commute.

Balls and Bowls Bayesian Reasoning

This is a classic Bayesian problem. The trick is to realize that drawing a blue ball makes it more likely you chose the bowl with two blue balls. Enumerating the favorable cases or using Bayes’ theorem are both valid approaches. This kind of reasoning is common in quant interviews.


Additional Practice: Sample Python Code for Simulation

Want to confirm these results by simulation? Here’s a code snippet to simulate the balls and bowls problem:


import random

def simulate(num_trials=100000):
    bowls = [["B", "B"], ["R", "R"], ["B", "R"]]
    success = 0
    total = 0
    for _ in range(num_trials):
        bowl = random.choice(bowls)
        first = random.choice(bowl)
        if first == "B":
            other = bowl[0] if bowl[1] == first else bowl[1]
            if other == "B":
                success += 1
            total += 1
    return success / total

print(simulate())
# Should output approximately 2/3 ≈ 0.666...

Related Articles