← Citadel Interview Insights

Citadel·Software Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
May 2026

Summary

Citadel quant engineer interview with a heavy focus on probabilistic simulation. The core question was about generating normal samples from uniform random numbers, and they wanted actual code plus a real explanation of why the math works.

Questions Asked (1)

Q1

You have a uniform random number generator. How would you use it to produce samples from a standard normal distribution? Walk through multiple approaches and implement one.

Technical Trade-offsAlgorithms & Data Structures
Author's notes

This one has layers.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by outlining multiple methods to transform uniform random variables into normal samples, such as inverse transform, Box-Muller, and Ziggurat. Compare their trade-offs in terms of computational efficiency, accuracy, and implementation complexity. Then, implement one method (e.g., Box-Muller) with clear, efficient code, explaining each step.

Pro tip: Mention that while inverse transform is conceptually simple, it requires the inverse CDF, which is computationally expensive; Box-Muller is a good balance for interviews, but for high-performance applications like trading systems, the Ziggurat algorithm is preferred due to its speed.

1. Clarify requirements and constraints

Ask about performance needs, accuracy, and whether the normal generator will be used in a latency-sensitive context. This shows you consider practical trade-offs.

2. Outline multiple approaches

Describe inverse transform, Box-Muller, and Ziggurat (or Marsaglia polar) methods. Briefly explain how each works and their pros/cons.

3. Compare trade-offs

Discuss computational complexity, memory usage, and ease of implementation. For example, inverse transform is O(1) but slow due to erfinv; Box-Muller is O(1) and fast but uses trig functions; Ziggurat is fastest but complex.

4. Select and implement one method

Choose Box-Muller for its balance of simplicity and efficiency. Implement it in code, explaining the transformation and how to handle the two independent normals.

5. Test and validate

Mention how you would verify the output: check mean, variance, and perhaps run a normality test like Kolmogorov-Smirnov. This shows attention to correctness.

Key Points to Mention

  • Inverse transform method: uses the inverse CDF (probit function), which is computationally expensive but exact.
  • Box-Muller transform: generates two independent standard normals from two uniforms using log, sqrt, cos, and sin.
  • Marsaglia polar method: a rejection-based variant of Box-Muller that avoids trigonometric functions.
  • Ziggurat algorithm: a fast rejection sampling method used in high-performance libraries (e.g., NumPy, GSL).
  • Trade-offs: speed vs. simplicity vs. accuracy; Box-Muller is a good interview compromise.
  • Implementation details: caching the second normal from Box-Muller to avoid waste, and ensuring thread safety if needed.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.