Phase 17 Exam

Quant Programming & Research Engineering - Phase Exam

18 interleaved questions drawn from every lesson in this phase. Interleaving mixes topics on purpose - that difficulty is what builds durable, transferable understanding. Aim for 70%+ before advancing; below that, revisit the flagged lessons.

How this exam teaches
Questions are shuffled across lessons (not blocked by topic) so you practice choosing the right idea. Missed questions are added to your review queue automatically.
Q1 Easy
The main reason a*b on two NumPy float arrays beats a Python loop is that:
Python multiplication is inaccurate
The element loop runs in compiled C with a fixed dtype, avoiding interpreter overhead
NumPy uses the GPU by default
Loops are not allowed on arrays
Q2 Easy
Why do you assert abs(a-b)<tol instead of a==b for computed reals?
Because Python is slow
Because IEEE-754 rounds each operation, so mathematically-equal values differ in the last bits
Because == is deprecated
Because tolerances are faster to compute
Q3 Easy
Which set of things must be pinned for a Monte Carlo result to be reproducible?
Only the seed
Code, data, environment, and seed
Only the code
The seed and the operating system font
Q4 Easy
The DRY principle is best stated as:
Never write the same line of code twice
Every piece of knowledge has a single, authoritative representation
Always use functions
Comment everything
Q5 Medium
The hot path of your program is 25% of runtime. The best possible overall speedup from optimizing only it is:
\(4\times\)
\(1.33\times\)
\(\infty\)
\(1.25\times\)
Q6 Medium
In SQL, WHERE and HAVING differ because:
They are synonyms
WHERE filters rows before grouping; HAVING filters groups after aggregation
HAVING is faster
WHERE only works on numbers
Q7 Medium
You subtract two pandas Series with different date indices and get many NaNs. The cause is:
A floating-point rounding bug
pandas aligns by label first, so non-overlapping dates have no match
The dtype is wrong
Broadcasting failed
Q8 Medium
Put–call parity is an especially strong test because it is:
Only true in Black–Scholes
Model-free (from no-arbitrage), so it must hold for any correct European pricer at every input
An approximation
True only at the money
Q9 Medium
Why prefer a local rng = np.random.default_rng(seed) over the global np.random.seed?
It is faster
The global RNG is shared mutable state, so any other draw shifts your stream; a local generator is order-independent
The global one is deprecated and removed
Local generators use less memory
Q10 Medium
Your signal module imports the broker API, so switching brokers changes your signals. This violates:
DRY
Orthogonality (the components are coupled)
Reproducibility
Vectorization
Q11 Medium
A C++ numeric inner loop typically beats the Python equivalent mainly because:
C++ has better libraries
It is compiled to machine code with static types, avoiding per-operation interpreter overhead and enabling SIMD
Python cannot do arithmetic
C++ uses the GPU
Q12 Medium
Building a backtest universe from today’s index constituents causes:
Look-ahead bias
Survivorship bias - delisted/bankrupt names are omitted, inflating historical returns
No bias
A syntax error
Q13 Medium
To subtract per-column means from a (T,N) matrix by broadcasting, the mean must have shape:
\((T,)\)
\((N,1)\)
\((1,N)\)
\((T,N)\)
Q14 Medium
A Monte Carlo price estimate from 10,000 paths should be tested by:
Exact equality to the closed form
|estimate−truth| within a few standard errors (~3×SE)
Checking it equals 0
A 1e-12 tolerance
Q15 Medium
Reproducibility and robustness differ because:
They are the same thing
Reproducibility is same-inputs→same-output; robustness is whether the conclusion survives reasonable changes to inputs
Robustness means the code never crashes
Reproducibility requires the cloud
Q16 Medium
A tracer bullet differs from a prototype in that it is:
Written in C++
Thin but real end-to-end code you keep and grow, whereas a prototype is throwaway
Always faster
Only used for testing
Q17 Easy
Before optimizing quant research code, the correct first step is to:
Rewrite the slowest-looking function in C++
Profile to find where time is actually spent
Add more cores
Delete the tests to save time
Q18 Medium
The key data guarantee that prevents look-ahead bias is:
Faster queries
Point-in-time storage: each value tagged with the date it was known, so a decision at t uses only data timestamped ≤ t
Using more data
Deleting old data
← Phase 17 lessons All exams Review missed →