Skip to content
LeetQuant
F0 Introduction and Diagnostic

F0 · Introduction and Diagnostic · Lesson 4 of 5

Initial Skill Diagnostic

A short mixed self-check across probability, expectation, statistics, linear algebra, coding and markets, with worked solutions and a guide from each miss to the roadmap module to study first.

20 min

What this is, and what it is not

This is a self-check, not a placement test. LeetQuant does not score it, store your answers or build a plan from it. Its job is to tell you, in about twenty minutes, which foundation modules you can move through quickly and which ones to start with.

How to take it

  1. Use paper and no calculator. Give yourself about 2 minutes per question, as in a phone screen.
  2. For each question, write your answer and a one-line reason before opening the solution.
  3. Grade yourself on three levels:
    • Clean: correct, inside the time, and you could explain it out loud.
    • Shaky: correct but slow, or you were not sure why.
    • Miss: wrong, or no method.
  4. Use the table at the end to turn misses and shaky answers into a starting module.

There are fourteen questions: twelve in six worked sets, and two as knowledge checks.

Worked example

Set A, probability and counting

A1. Two fair dice are rolled. You are told at least one shows a six. What is the probability both show a six?

A2. A condition affects 2% of a population. A test detects it 95% of the time and gives a false positive 5% of the time. A random person tests positive. What is the probability they have the condition?

A3. What is the probability that a five-card hand from a shuffled 52-card deck contains at least one ace?

Show solution

A1: 1/111/11. Of the 36 equally likely outcomes, 11 contain at least one six (6+6−16 + 6 - 1, removing the double-counted (6, 6)). Only one of those is (6, 6). The classic wrong answer is 1/61/6, which treats "at least one" as "the first one".

A2: 19/68≈0.2819/68 \approx 0.28. In 10,000 people: 200 have the condition and 190 test positive; 9,800 do not and 490 test positive. So P(condition∣+)=190/(190+490)=19/68P(\text{condition} \mid +) = 190 / (190 + 490) = 19/68. Most positives are false because the condition is rare. Answering 95% is base-rate neglect.

A3: about 0.3410.341. Use the complement:

1−(485)(525)=1−1,712,3042,598,960=1847254145≈0.341.1 - \frac{\binom{48}{5}}{\binom{52}{5}} = 1 - \frac{1{,}712{,}304}{2{,}598{,}960} = \frac{18472}{54145} \approx 0.341 .

A quick check: four aces among 52 cards, five draws, so roughly 5×4/52≈0.385 \times 4/52 \approx 0.38 expected aces, and the probability of at least one must be a little below that.

If you missed: A1 or A2 point to F3 (conditional probability and Bayes). A3 points to F2 (counting and complements).

Worked example

Set B, expectation and variance

B1. A fair die is rolled six times. What is the expected number of distinct faces that appear?

B2. You roll a fair die and are paid its value in dollars. After seeing the first roll you may reroll once, but then you must take the second result. What is the game worth with optimal play?

B3. XX and YY have standard deviations 2 and 3 and correlation 0.50.5. What is the variance of X−YX - Y?

Show solution

B1: 6(1−(5/6)6)≈3.996\left(1 - (5/6)^6\right) \approx 3.99. Let IkI_k be 1 if face kk appears. Then P(Ik=1)=1−(5/6)6≈0.665P(I_k = 1) = 1 - (5/6)^6 \approx 0.665, and by linearity of expectation (which needs no independence) the expected count is 6×0.665≈3.996 \times 0.665 \approx 3.99. Most people guess higher; six rolls usually miss two faces.

B2: 4.254.25. A second roll is worth 3.53.5 on average, so keep the first roll if it beats 3.53.5 (4, 5 or 6) and reroll otherwise. Then

E=12×5⏟mean of 4,5,6+12×3.5=4.25.\mathbb{E} = \tfrac12 \times \underbrace{5}_{\text{mean of 4,5,6}} + \tfrac12 \times 3.5 = 4.25 .

B3: 77. Var⁡(X−Y)=σX2+σY2−2ρσXσY=4+9−2(0.5)(2)(3)=7\operatorname{Var}(X - Y) = \sigma_X^2 + \sigma_Y^2 - 2\rho\sigma_X\sigma_Y = 4 + 9 - 2(0.5)(2)(3) = 7. The common slip is adding the covariance term instead of subtracting it.

If you missed: B1 or B3 point to F4 (indicators, linearity, covariance). B2 points to F4 and then QT03 (expected value and decision theory).

Worked example

Set C, statistics

C1. A coin gives 60 heads in 100 flips. Give an approximate 95% confidence interval for its probability of heads.

C2. You backtest 20 independent strategies, none of which has any real edge, and test each at the 5% significance level. What is the probability that at least one looks significant?

Show solution

C1: about [0.50,0.70][0.50, 0.70]. p^=0.6\hat p = 0.6 and the standard error is p^(1−p^)/n=0.24/100≈0.049\sqrt{\hat p(1 - \hat p)/n} = \sqrt{0.24/100} \approx 0.049. So the interval is 0.6±1.96×0.049≈[0.504,0.696]0.6 \pm 1.96 \times 0.049 \approx [0.504, 0.696]. It only just excludes 0.50.5, which is the right intuition to state: 60 out of 100 is borderline evidence of bias, not strong evidence.

C2: 1−0.9520≈0.641 - 0.95^{20} \approx 0.64. Each null strategy passes with probability 0.050.05, so the chance that none passes is 0.9520≈0.360.95^{20} \approx 0.36. With enough tries, a "significant" backtest is close to guaranteed. This is the multiple-comparisons problem behind most overfit research.

If you missed: C1 points to F5 (sampling distributions and intervals). C2 points to F5, and for QR candidates later to QR08 (backtesting and research design).

Worked example

Set D, linear algebra

D1. Find the eigenvalues and eigenvectors of A=(2112)A = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}.

D2. Can three assets all have pairwise correlation −0.6-0.6 with each other?

Show solution

D1: eigenvalues 3 and 1. Try the symmetric directions: A(1,1)⊤=(3,3)⊤A(1, 1)^\top = (3, 3)^\top and A(1,−1)⊤=(1,−1)⊤A(1, -1)^\top = (1, -1)^\top. So (1,1)(1, 1) has eigenvalue 3 and (1,−1)(1, -1) has eigenvalue 1. Check: the eigenvalues sum to the trace (4) and multiply to the determinant (4−1=34 - 1 = 3).

D2: no. The correlation matrix with every off-diagonal entry equal to ρ\rho has eigenvalues 1+2ρ1 + 2\rho (eigenvector (1,1,1)(1, 1, 1)) and 1−ρ1 - \rho (twice). A valid correlation matrix must be positive semidefinite, so 1+2ρ≥01 + 2\rho \ge 0, that is ρ≥−1/2\rho \ge -1/2. At ρ=−0.6\rho = -0.6 the first eigenvalue is −0.2-0.2: the equally weighted portfolio would have negative variance. Intuition: if A and B move opposite to each other, and A and C do too, then B and C must move together.

If you missed: either one points to F6 (eigenvalues and valid covariance matrices).

Worked example

Set E, coding and complexity

E1. What does this print?

def append_to(x, acc=[]):
    acc.append(x)
    return acc

append_to(1)
print(append_to(2))

E2. Given a list of nn integer prices and a target, decide whether two different entries sum to the target. What is the best expected time complexity, and how?

Show solution

E1: [1, 2]. Default arguments are evaluated once, when the function is defined, so every call that omits acc shares the same list. The idiomatic fix is acc=None and if acc is None: acc = [] inside the function.

E2: O(n)O(n) expected time with a hash set. Comparing all pairs is O(n2)O(n^2); sorting then using two pointers is O(nlog⁡n)O(n \log n). A single pass with a set of values seen so far is O(n)O(n) expected time and O(n)O(n) space:

def has_pair_with_sum(prices, target):
    seen = set()
    for p in prices:
        if target - p in seen:
            return True
        seen.add(p)
    return False

print(has_pair_with_sum([3, 9, 4, 12], 13))  # True (9 + 4)
print(has_pair_with_sum([3, 9, 4, 12], 8))   # False
print(has_pair_with_sum([4], 8))             # False: one entry cannot be used twice

Checking before adding p is what stops a single 4 from pairing with itself. Mentioning that edge case unprompted is the kind of thing interviewers notice.

If you missed: E1 points to F7 (Python essentials), and for QD candidates to QD02. E2 points to F7 and then QD01 (data structures and algorithms).

Worked example

Set F, mental maths and markets

F1. In under ten seconds each: compute 48×5248 \times 52, and write 7/87/8 as a percentage.

F2. A stock trades at 100. A one-year European call and put, both struck at 100, trade at 10 and 7. Interest rates are zero and there are no dividends. Is there an arbitrage, and how would you trade it?

Show solution

F1: 24962496 and 87.5%87.5\%. 48×52=(50−2)(50+2)=2500−4=249648 \times 52 = (50 - 2)(50 + 2) = 2500 - 4 = 2496. And 7/8=1−1/8=1−0.125=0.8757/8 = 1 - 1/8 = 1 - 0.125 = 0.875. If either took longer than ten seconds, that is a trader-track gap even when the answer was right.

F2: yes, worth 3 per share. Put–call parity with zero rates says C−P=S−K=100−100=0C - P = S - K = 100 - 100 = 0, but here C−P=3C - P = 3: the call is rich relative to the put. Sell the call, buy the put, buy the stock. Cash today: +10−7−100=−97+10 - 7 - 100 = -97, borrowed at zero rate. At expiry, stock plus long put minus short call is worth exactly the strike, 100, whatever the stock does. Repay 97 and keep 3.

If you missed: F1 points to QT01 (mental maths). F2 points to F8 (markets, arbitrage) and later QT08 (options).

Knowledge check

Diagnostic G1. You flip a fair coin until you get two heads in a row. What is the expected number of flips?

Knowledge check

Diagnostic G2. Regressing yy on xx gives slope 0.80.8. The standard deviation of xx is 1 and of yy is 2. What is the correlation between xx and yy?

From results to a starting module

QuestionTopicStudy firstThen, for your track
A1, A2Conditional probability, BayesF3QT02 (QT), QR02 (QR)
A3Counting, complementsF2F3
B1, B3Linearity, indicators, covarianceF4QR02 (QR)
B2Optimal stopping, expected valueF4QT03, QT04 (QT)
G1First-step analysis, waiting timesF4QT02 (QT)
C1, G2Intervals, regressionF5QR03, QR04 (QR)
C2Multiple comparisonsF5QR08 (QR)
D1, D2Eigenvalues, valid covariance matricesF6QR10 (QR)
E1Python semanticsF7QD02 (QD), QR01 (QR)
E2Complexity, hash mapsF7QD01 (QD)
F1Mental arithmeticQT01QT01 timed drills
F2Arbitrage, put–call parityF8QT08 (QT)

How to use it.

  • A miss in a module your track marks required: start that module from its first lesson, in roadmap order (F2 before F3 before F4, for example), and do its linked problems.
  • Shaky only: skip straight to the module's linked problems and read a lesson only when a problem exposes a gap.
  • Clean across a whole set: skim that module's lessons for anything unfamiliar and move on.
  • Misses in a module your track marks optional (for example F6 for QT): note them and come back later; do not let them block the required path.

Retake the diagnostic after a few weeks. Because it is a fixed set you will remember the answers, so on the retake judge yourself on speed and on whether you can explain each step out loud, not on correctness alone.

Knowledge check

You got the Bayes question (A2) right, but it took six minutes and you were not sure of your reasoning. You are on the QT track. What is the best next step?

Key takeaways

  • This diagnostic is a self-check; nothing is scored or stored. Its value depends on grading yourself honestly as clean, shaky or miss.
  • Time and explanation count: a correct answer you could not explain in two minutes is shaky.
  • Map every miss to a module code, start with the required ones for your track in roadmap order, and treat optional-module misses as later work.
  • The most common foundation gaps are conditional probability (F3), linearity and covariance (F4), and multiple comparisons (F5).

Practice problems

Finished reading?

Answer the 3 knowledge checks to complete this lesson (0 done).