← Goldman Sachs Interview Insights

Goldman Sachs·Software Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
Apr 2026

Summary

Technical screen for a quant engineer role at Goldman, two parts back to back. First half was conceptual, second half was live coding and it got weird fast.

Questions Asked (2)

Q1

Walk through the main methods for sampling from a target probability distribution. What are the trade-offs and when would you actually use each one?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

This part went fine.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Structure your answer by grouping sampling methods into families (e.g., inverse transform, rejection, MCMC, and approximate methods), then for each family explain the core idea, trade-offs, and typical use cases. Emphasize practical considerations like dimensionality, computational budget, and whether you need exact or approximate samples.

Pro tip: In finance, low-discrepancy sequences (quasi-Monte Carlo) often outperform plain Monte Carlo for pricing high-dimensional derivatives, so mention them as a practical alternative when discussing trade-offs.

1. Categorize the methods

Briefly list the main families: inverse transform, rejection sampling, importance sampling, Markov Chain Monte Carlo (MCMC), and approximate methods like variational inference. This shows you can organize the landscape.

2. Explain each method's mechanics

For each family, describe the core algorithm in 1-2 sentences, focusing on how it generates samples and any key assumptions (e.g., need for CDF, proposal distribution, or Markov chain).

3. Discuss trade-offs

Compare methods on dimensions like computational cost, accuracy, ease of implementation, and scalability. Highlight when each method struggles (e.g., rejection sampling in high dimensions, MCMC burn-in).

4. Match methods to use cases

Give concrete examples where each method shines, especially in a software engineering or finance context (e.g., inverse transform for simple distributions, MCMC for Bayesian inference, quasi-Monte Carlo for option pricing).

5. Conclude with practical guidance

Summarize a decision framework: consider dimensionality, available compute, need for exactness, and whether you can leverage existing libraries. This shows you can apply the knowledge.

Key Points to Mention

  • Inverse transform sampling: simple, exact, but requires invertible CDF and can be slow for complex distributions.
  • Rejection sampling: easy to implement, exact, but inefficient in high dimensions due to low acceptance rates.
  • Importance sampling: useful for variance reduction and rare events, but requires a good proposal distribution.
  • MCMC (e.g., Metropolis-Hastings, Gibbs): handles complex, high-dimensional distributions, but samples are correlated and require burn-in.
  • Quasi-Monte Carlo and low-discrepancy sequences: often used in finance for faster convergence in high dimensions.
  • Variational inference: approximate but fast, good for large datasets and when exact sampling is infeasible.

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

Q2

Write a sampler on the spot for a biased random walk on a manifold like a sphere or torus. How do you parameterize positions, propose steps that stay tangent to the surface, apply a bias toward a target region, and handle accept/reject?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This one genuinely surprised me.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the manifold and target distribution, then outline a Metropolis-Hastings sampler with a tangent-space proposal and a bias term. Emphasize parameterization, projection to the manifold, and the accept/reject step with the correct acceptance ratio.

Pro tip: Mention that the proposal distribution must be symmetric in the tangent space to simplify the acceptance ratio, and that the bias can be incorporated via a potential function in the target density.

1. Clarify the problem and assumptions

Ask about the specific manifold (sphere, torus), the target region, and whether the bias is a drift or a modification of the stationary distribution. Confirm the need for a Metropolis-Hastings algorithm.

2. Parameterize positions and tangent spaces

For a sphere, use spherical coordinates or unit vectors; for a torus, use angles (θ, φ). At each point, compute the tangent basis (e.g., via derivatives of the parameterization or Gram-Schmidt).

3. Propose a step in the tangent space

Draw a random vector from a symmetric distribution (e.g., Gaussian) in the tangent space, then map it to the manifold via exponential map or retraction. Optionally add a bias vector toward the target region.

4. Compute acceptance ratio and accept/reject

Calculate the target density ratio (including bias) and the proposal density ratio (if not symmetric). Accept the new point with probability min(1, ratio); otherwise stay at the current point.

5. Validate and discuss trade-offs

Mention burn-in, mixing, and computational cost. Discuss alternative parameterizations (e.g., quaternions for sphere) and the effect of bias strength on exploration.

Key Points to Mention

  • Metropolis-Hastings algorithm and detailed balance
  • Tangent space and exponential map/retraction for manifold steps
  • Symmetric proposal distribution simplifies acceptance ratio
  • Bias via potential function or drift term in target density
  • Parameterization choices: spherical coordinates, unit quaternions, or angle pairs for torus
  • Numerical stability and handling of boundaries (e.g., wrapping angles on torus)

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