Skip to guide content

Engineering interview preparation

Quant Developer Interview Guide: Code, Systems, and Numerics

Prepare for quant developer interviews with a practical guide to C++, Python, algorithms, concurrency, numerical computing, system design, and testing.

Desk2Quant Editorial Team14 minute read

A quant developer interview sits between software engineering and quantitative computing. Teams need code that is fast enough, numerically trustworthy, observable in production, and understandable to researchers or traders. That changes what a "good" coding answer looks like.

Prepare for standard algorithms, but connect them to market-data streams, pricing libraries, simulation engines, research pipelines, and risk systems. The strongest candidates make constraints explicit and protect correctness while improving performance.

What this guide helps you do

  • Build a role-specific quant developer syllabus.
  • Answer coding questions with correctness, complexity, and numerical checks.
  • Reason about latency, throughput, data layout, and concurrency.
  • Present systems and projects with production-grade trade-offs.

1. Show depth in the language the team uses

For C++, prepare object lifetime, RAII, value semantics, move operations, templates, containers, iterators, memory layout, and the concurrency model. For Python, prepare object semantics, iterators, exceptions, typing, NumPy array behavior, vectorization, multiprocessing, and packaging. In either language, be ready to read unfamiliar code and find a correctness bug.

Language trivia has value only when connected to behavior. Explain how a dangling reference occurs, why a NumPy view can mutate shared data, or when the Python GIL matters for the workload at hand.

2. Practise algorithms in a data-shaped context

Core structures still matter: arrays, hash tables, trees, heaps, graphs, queues, and sorting. Quant teams often wrap them in time-series or event-stream problems, so define ordering, duplicates, late data, and memory limits before coding.

State complexity using the right variable. A join between trades and quotes may depend on both input sizes, while a Monte Carlo engine depends on paths, time steps, and instruments. Big-O is incomplete if allocation and cache behavior dominate the real workload.

  • Maintain a rolling statistic with stable updates and explicit window boundaries.
  • Build an order-book update structure and define price-time priority.
  • Align asynchronous market series without leaking future observations.
  • Schedule dependent pricing tasks and explain error propagation.

3. Reason about performance and concurrency

Separate latency, throughput, memory footprint, and predictability. A faster average response may still be unacceptable if tail latency becomes unstable. Begin optimization with measurement, representative data, and a correctness baseline.

For concurrency, describe shared state, ownership, ordering guarantees, failure handling, and backpressure before selecting locks or lock-free structures. Know common hazards such as races, deadlocks, false sharing, oversubscription, and nondeterministic tests.

Performance questions to ask before optimizing
AreaDiagnostic questionTypical evidence
AlgorithmIs unnecessary work dominating?Input-size scaling and operation counts
CPU and memoryIs the code compute-bound or memory-bound?Profiler samples, cache misses, allocation data
ConcurrencyCan work run independently without unsafe sharing?Task graph, contention, queue depth, tail latency
I/OAre serialization, network, or storage the bottleneck?Request traces, byte counts, batching experiments

4. Protect numerical and financial correctness

Floating-point arithmetic is part of the specification. Discuss tolerances, cancellation, overflow, underflow, conditioning, deterministic seeds, and summation order. Tests should include analytical cases, limiting behavior, invariants, and comparisons with an independent implementation.

Financial conventions are another source of software defects. Dates, calendars, day-count rules, units, compounding, currency, and sign conventions should be explicit types or validated inputs rather than comments that callers can ignore.

5. Design for data, failure, and change

A system-design answer should start with users, service-level needs, data volumes, update frequency, and correctness guarantees. Draw a simple flow before naming technologies. For a risk engine, for example, show market data and positions entering a versioned calculation, results being stored, and failures being isolated and retried.

Discuss reproducibility, deployment, observability, access control, disaster recovery, and model versioning. Quant systems frequently need to explain yesterday's number after code, market data, and portfolios have changed.

  • Define the source of truth and idempotency boundary.
  • Version models, configuration, market data, and reference data together.
  • Choose batch, stream, or hybrid processing from the actual freshness requirement.
  • Include degraded modes, replay, reconciliation, and audit trails.

Check your understanding

Test yourself

Five questions, from warm-up to hard. Try each one before you open the answer.

Warm-up · Question 1

You check whether each of 1 million trade IDs appears in another collection of 1 million IDs, using Python's in on a list. Roughly how much work is that in the worst case, and what one-line change fixes it?

Show the answer

Up to about 10¹² comparisons, because each lookup scans the list. Convert the list to a set once: each lookup becomes expected O(1), so about 10⁶ steps in total.

  1. A list lookup checks items one by one: O(n) per lookup in the worst case.
  2. 1 million lookups × 1 million items ≈ 10¹² comparisons: hours, not seconds.
  3. Build a set once (O(n)), then each lookup hashes the ID: expected O(1).
  4. Total ≈ O(n + m) instead of O(n × m). Mention the extra memory for the set and that IDs must be hashable.

Warm-up · Question 2

90% of a risk job's runtime can run in parallel perfectly; the rest is serial. What is the best speed-up on 8 cores, and what is the limit with unlimited cores?

Show the answer

About 4.7× on 8 cores, from 1 / (0.1 + 0.9/8). With unlimited cores it can never beat 1 / 0.1 = 10×.

  1. Amdahl's law: speed-up = 1 / ((1 − p) + p/n) with p = 0.9.
  2. On 8 cores: 1 / (0.1 + 0.1125) = 1 / 0.2125 ≈ 4.7.
  3. As n grows, p/n → 0, so the speed-up → 1 / 0.1 = 10.
  4. Lesson: shrink the serial 10% (loading, aggregation, I/O) before asking for more cores.

Step up · Question 3

A pricing service handles 1,000 requests: 985 take 2 ms and 15 take 500 ms. Work out the mean, the median and the 99th percentile. Which number would you show the desk?

Show the answer

Mean 9.47 ms, median 2 ms, p99 500 ms. Show the tail (p99 and above): the mean and median hide that 1.5% of requests wait half a second.

  1. Mean = (985 × 2 + 15 × 500) / 1,000 = (1,970 + 7,500) / 1,000 = 9.47 ms.
  2. More than half the requests take 2 ms, so the median is 2 ms.
  3. Sort the times: the slowest 15 (1.5%) are all 500 ms, so the 99th percentile lands on 500 ms.
  4. Report the distribution, not one average, and find out why those 15 requests are slow.

Step up · Question 4

Four prices are 1,000,000,004, 1,000,000,007, 1,000,000,013 and 1,000,000,016. In float64, np.mean(x * x) − np.mean(x) ** 2 returns −128.0. What is the true variance, and why did the formula fail?

Show the answer

The true population variance is 22.5. The formula subtracts two numbers near 10¹⁸, where float64 values are 128 apart, so rounding swamps 22.5: catastrophic cancellation.

  1. Shift the data by 1,000,000,000 to get 4, 7, 13 and 16. A shift does not change the variance.
  2. Mean = 10. Squared deviations: 36, 9, 9, 36. Average = 90 / 4 = 22.5.
  3. x² is about 10¹⁸, where neighbouring float64 numbers are 128 apart, so the subtraction cannot resolve 22.5. A negative variance is the giveaway.
  4. Fix: a two-pass method (subtract the mean first, as np.var does) or Welford's online update.

Hard · Question 5

A Monte Carlo pricer gives a standard error of 0.04 with 100,000 paths in 2 s on one core. The desk needs 0.01. How many paths, and how long on 8 cores at 85% efficiency? What if a control variate removes 75% of the variance?

Show the answer

1.6 million paths: about 32 s on one core, or 4.7 s on 8 cores. Removing 75% of the variance halves the error, so 400,000 paths (about 1.2 s on 8 cores) would do.

  1. Standard error falls like 1/√N. To cut it 4×, you need 4² = 16× the paths: 1.6 million.
  2. Time scales with paths: 16 × 2 s = 32 s on one core.
  3. 8 cores at 85% efficiency act like 6.8 cores: 32 / 6.8 ≈ 4.7 s.
  4. Removing 75% of the variance halves the error (√0.25 = 0.5), so you need only 4× the paths: 400,000, about 8 s on one core or 1.2 s on 8.
  5. Then check the control variate's own cost per path, and that the price still matches a trusted benchmark.

More practice: 80 worked interview questions by topic · the daily desk question

Plain language

Words on this page

Tail latency
The slow end of response times, such as the 99th percentile (p99). An average can look fine while 1 request in 100 is painfully slow, so always report the tail.
Amdahl's law
Speed-up on n cores = 1 / ((1 − p) + p/n), where p is the share of work that runs in parallel. The serial part sets a hard ceiling, however many cores you add.
Idempotent operation
An action that gives the same result whether it runs once or many times, such as "set the result for trade 42 to X". It makes retries after a crash safe.
False sharing
When threads write to different variables that sit on the same cache line, the hardware keeps passing that line between cores, so "independent" work slows down.
Catastrophic cancellation
Loss of accuracy when you subtract two nearly equal floating-point numbers. The leading digits cancel, and the rounding errors left behind can swamp the answer.

Practise aloud

Interview drills with answer direction

Question 1

When would you choose a hash table over a balanced tree?

Answer direction: Choose from required operations and guarantees. A hash table offers expected constant-time lookup without ordering; a balanced tree gives ordered traversal and logarithmic worst-case operations. Also discuss memory, key behavior, and predictability.

Question 2

How would you speed up a Monte Carlo pricer?

Answer direction: Profile first, then consider algorithmic work reduction, contiguous data, vectorization, batching, parallel paths, variance reduction, and reuse of invariant calculations. Recheck estimator bias and confidence intervals after each change.

Question 3

How should two floating-point results be compared?

Answer direction: Use a tolerance informed by scale and error analysis, often combining absolute and relative tolerance. Handle zero, infinities, NaNs, and domain-specific materiality explicitly.

Question 4

Design an intraday risk calculation service.

Answer direction: Clarify portfolio size, latency, update triggers, consistency, and failure tolerance; outline ingestion, versioned calculations, partitioning, result storage, reconciliation, observability, and replay.

Question 5

What do you do when a parallel implementation is slower?

Answer direction: Measure task size, overhead, contention, memory bandwidth, load balance, false sharing, and oversubscription. Parallelism cannot recover time lost to coordination or a memory bottleneck.

Turn reading into practice

A focused study plan

  1. Track A

    Language

    Read and write small examples covering lifetime, semantics, exceptions, libraries, and debugging.

  2. Track B

    Algorithms

    Solve data-structure problems and adapt each one to a market-data or time-series variant.

  3. Track C

    Numerics

    Implement a pricer or simulation with analytical checks, tolerances, and benchmarks.

  4. Track D

    Systems

    Practise two architecture cases with volumes, failure modes, versioning, and observability.

Self-review

Frequent mistakes to catch early

  • Optimizing from intuition without a profile or benchmark.
  • Discussing concurrency without ownership and ordering guarantees.
  • Using exact equality or arbitrary tolerances for numerical results.
  • Designing only the happy path and ignoring replay or auditability.

Continue with structured practice

Relevant Desk2Quant resources

Keep building

Common questions

Frequently asked questions

What is asked in a quant developer interview?

Expect coding and algorithms, deep questions in C++ or Python, performance and memory, concurrency, numerical computing, testing, debugging, and system design. Some teams also test probability, derivatives, or market knowledge.

Is C++ required for quant developer roles?

It is common in pricing, execution, and latency-sensitive systems, but not universal. Python, Java, C#, Rust, and other languages appear across teams. The job description and existing stack should determine your preparation.

How much finance should a quant developer know?

Know enough to preserve the meaning of the calculation: products, cash flows, risk factors, conventions, units, and the workflow your system supports. The required modeling depth varies by team.

What project is best for a quant developer interview?

Choose a small but complete system with tests, benchmarks, failure handling, and documented trade-offs. A pricing or risk service, market-data pipeline, or simulation engine is stronger than an untested collection of scripts.