Posts by Year

2025

Solving an underdetermined system

less than 1 minute read

A lot of firms will ask questions that are variations on the following: Suppose you have a $p$ -dimensional parameter $x$ you want to estimate, and you have...

Store-bought extracts for at-home drinks

2 minute read

I have recently been watching videos from Darcy O’Neil’s YouTube channel Art of Drink. In it, he goes through techniques for how to extract flavor compounds ...

Finding colinear subset

2 minute read

This note explores the following quant interview question: if you are given a matrix $X \in \mathbb{R}^{n\times p}$ that you are told has colinearity, how wo...

Bounding $R^2$

less than 1 minute read

We have $X, Y, Z$, where $Z \sim X$ has $R^2=.1$ and $Z \sim Y$ has $R^2=.2$. Bound the $R^2$ of $Z \sim X + Y$.

CV tradeoff

2 minute read

In a quant interview last year, I was asked a question about the tradeoff in changing the number of folds $k$ in $k$-fold cross-validation. Obviously, as the...

Find next in binary search tree

less than 1 minute read

For a binary search tree (BST), if you are at node $A$, how would you find the lexicographically next node after $A$? That is, how would you find the smalle...

Rolling 6 dice

less than 1 minute read

What is the probability the sum of 6 dice rolls is a multiple of 6?

How to regularize a neural network?

less than 1 minute read

Solution This is just a basic question to query if you have basic familiarity with neural networks. You should mention techniques such as dropout,...

Streaming mean and variance

less than 1 minute read

How to update mean and variance in a streaming way? By streaming we mean without retaining the individual samples, i.e. computing $\bar x_n$ from only $\bar...

Hyperplanes

less than 1 minute read

You have points in 3D. How to find hyperplane that minimizes z-axis error? How to find hyperplane that minimizes orthogonal error? When would you prefer one ...

OLS when $X$ is too large.

1 minute read

What is OLS solution? How is it derived? How to compute with $n \gg p$, such that $X$ cannot be loaded in memory. Consider both when $p$ very small, but also...

Drawing primes

less than 1 minute read

If I draw 4 numbers without replacement from the first 16 primes, what is the probability the sum is even?

2 player game

less than 1 minute read

Suppose two players play a game alternating turns. Player 1 goes first and has 50% chance of winning in that round. Player 2 goes second (if P1 doesn’t win) ...

Uniform on unit sphere

less than 1 minute read

If we draw uniformly form the unit sphere, and call its coordinates $(X,Y,Z)$, what is the variance of $X$?

Product of uniforms

less than 1 minute read

If $U_1, U_2 \overset{iid}{\sim} U[0,1]$, compute $Pr(U_1U_2 \le .5)$?

Two 6-sided die

less than 1 minute read

Let $X,Y$ be the outcomes of rolling two iid six-sided dies. Compute $\mathrm{Pr}(X+Y < XY)$.

Sine integral

less than 1 minute read

Compute $\int_\pi^{2\pi} \sin x dx$.

Ordering uniforms

1 minute read

Suppose you are going to be shown three iid uniform rv, $U_i \sim U[0,1]$. Your task is to after seeing $U_1$, assign it lowest, middle, or highest. Then see...

Gambler’s ruin

less than 1 minute read

If $X_0=0$, and goes up or down one at each time step with equal probability, what is the probability $X$ hits $4$ before $X$ hits $-6$?

OLS coefficient bounds

less than 1 minute read

If $Y \sim X$ gives coefficient $\hat\beta$, what is the bound on the coefficient $\hat\theta$ from $X \sim Y$?

Probability of pizza

less than 1 minute read

I like to eat pizza on weekends. $\mathrm{Pr}(\text{eat pizza Sat}) = .3$ and $\mathrm{Pr}(\text{eat pizza Sun}) = .4$. What is the probability that I will e...

Partitioning square roots

less than 1 minute read

How would you partition the square roots of the first 50 natural numbers $\sqrt 1, \sqrt 2, \dots, \sqrt{50}$ into two groups $A, B$, such that

Gold and silver coins

1 minute read

Suppose we play a game where we flip a gold coin 500 times and a silver coin 500 times. We get 3 dollars per gold head, and 1 dollar per silver head, getting...

First color out

less than 1 minute read

We have a sack with 60 balls: 30 yellow, 20 red, and 10 white. If we draw randomly from the sack w/o replacement until all are drawn, what is the probability...

Counting passwords

less than 1 minute read

If I have an 8 digit passcode, taking values $0-9$, what is the probability that a randomly generated passcode has exactly $5$ occurrences of the same digit?...

Seating bar patrons

less than 1 minute read

Suppose you run a bar that has 25 seats at the bar. Patrons will enter and seat themselves according to the following rules. They will not sit next to someon...

Estimating the SE of Lasso CV coefficients

3 minute read

This note comes from the following question: You have data $X, Y$ and you run a lasso-penalized linear regression of $Y$ onto $X$, with the lasso parameter t...

Back to Top ↑