← Openai Interview Insights

Openai·Machine Learning Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
Jul 2026Remote

Summary

Went through a technical phone screen for an ML Engineer role at OpenAI that was pretty heavy on statistics and Bayesian inference. The whole thing felt like a grad-level probability exam more than a typical ML interview, which I wasn't fully expecting.

Questions Asked (4)

Q1

Given n Bernoulli trials with k successes, derive the maximum likelihood estimator for the success probability p and describe its asymptotic variance.

Technical Trade-offsAlgorithms & Data Structures
Author's notes

The MLE derivation itself is straightforward, k/n, anyone who's taken a stats course gets there.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by writing the likelihood function for n Bernoulli trials with k successes, then derive the MLE by maximizing the log-likelihood. Next, compute the asymptotic variance using the Fisher information or the known variance of the MLE for a proportion, and mention its practical implications.

Pro tip: Connect the MLE and its variance to real-world ML scenarios, such as estimating click-through rates or model calibration, to show practical understanding beyond the math.

1. Define the likelihood

Write the likelihood function L(p) = p^k (1-p)^(n-k) and explain that it represents the probability of observing k successes in n trials.

2. Log-likelihood and derivative

Take the natural log to get l(p) = k log p + (n-k) log(1-p), then compute the derivative with respect to p and set it to zero.

3. Solve for MLE

Solve the equation to find p_hat = k/n, and verify it's a maximum by checking the second derivative or boundary conditions.

4. Compute asymptotic variance

Use the Fisher information I(p) = n/(p(1-p)) to get the asymptotic variance of p_hat as p(1-p)/n, or equivalently Var(p_hat) ≈ p_hat(1-p_hat)/n.

5. Discuss implications

Mention that the variance decreases with n, and relate to confidence intervals and hypothesis testing for proportions.

Key Points to Mention

  • Likelihood function for Bernoulli trials
  • Log-likelihood maximization
  • MLE formula: p_hat = k/n
  • Fisher information and asymptotic variance
  • Variance formula: p(1-p)/n
  • Connection to confidence intervals and standard error

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

Q2

With a Beta(alpha, beta) prior on p, derive the posterior distribution and compute the posterior predictive probability of success on the next trial.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This is where things got interesting.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by stating the Beta-Bernoulli conjugacy, then derive the posterior by multiplying the prior and likelihood and recognizing the kernel of a Beta distribution. Finally, compute the posterior predictive probability using the law of total probability or the mean of the posterior, and mention its practical implications.

Pro tip: Emphasize that the posterior predictive is not just the posterior mean but an integral over the posterior, which for Beta-Bernoulli simplifies to (alpha + successes) / (alpha + beta + trials). This shows you understand the distinction between parameter estimation and prediction.

1. State the model and prior

Define the Bernoulli likelihood for the data and the Beta(alpha, beta) prior on p. Mention that the Beta is the conjugate prior for the Bernoulli/binomial likelihood.

2. Derive the posterior

Multiply the prior and likelihood, ignore constants, and identify the resulting kernel as a Beta distribution with updated parameters alpha + successes and beta + failures.

3. Compute the posterior predictive

Use the law of total probability: integrate the likelihood of the next trial over the posterior. Since the posterior is Beta, the integral yields the mean of the posterior, (alpha + successes) / (alpha + beta + n).

4. Discuss implications and extensions

Explain how the prior acts as pseudo-counts, how the predictive probability balances prior and data, and mention potential extensions like hierarchical models or non-conjugate priors.

Key Points to Mention

  • Conjugacy of Beta and Bernoulli/binomial distributions
  • Posterior parameters: alpha' = alpha + number of successes, beta' = beta + number of failures
  • Posterior predictive probability formula: (alpha + successes) / (alpha + beta + n)
  • Interpretation of alpha and beta as prior pseudo-counts
  • Difference between posterior mean and posterior predictive probability
  • Practical use in online learning, A/B testing, and Thompson sampling

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

Q3

Construct a 95% confidence interval for p using a normal approximation, and separately a 95% credible interval from the posterior. Walk through both.

A/B Testing & ExperimentationTechnical Trade-offs
Author's notes

Standard Wald interval for the frequentist side.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly defining the problem: you have binomial data and want to estimate p. For the frequentist approach, use the normal approximation to the binomial to construct a Wald confidence interval. For the Bayesian approach, choose a Beta prior, update to a Beta posterior, and compute the equal-tailed credible interval (or highest posterior density). Walk through the formulas, assumptions, and interpretation, highlighting the differences in philosophy and practical implications.

Pro tip: Emphasize that the Wald interval can perform poorly for small samples or extreme p, while the Bayesian credible interval with a weakly informative prior often has better frequentist properties. Mention that in A/B testing, the choice between them depends on whether you want to incorporate prior knowledge and how you interpret probability.

1. Set up the problem and notation

Define p as the true conversion rate, n as sample size, and X as number of successes. State that X ~ Binomial(n, p) and that you observe x successes.

2. Construct the 95% confidence interval using normal approximation

Compute the sample proportion p_hat = x/n. The standard error is sqrt(p_hat(1-p_hat)/n). The 95% CI is p_hat ± 1.96 * SE. Discuss assumptions: np_hat ≥ 10 and n(1-p_hat) ≥ 10 for validity.

3. Construct the 95% credible interval from the posterior

Choose a Beta(α, β) prior (e.g., Beta(1,1) for uniform). The posterior is Beta(α + x, β + n - x). Compute the 2.5th and 97.5th percentiles of this Beta distribution to get the equal-tailed credible interval.

4. Compare and interpret the intervals

Explain that the confidence interval is a frequentist interval: 95% of such intervals cover p in repeated sampling. The credible interval is a Bayesian interval: given the data and prior, there is a 95% posterior probability that p lies in the interval. Discuss practical differences, especially for small samples or extreme proportions.

5. Discuss trade-offs and when to use each

Mention that the normal approximation is simple but can be inaccurate for small n or p near 0 or 1. The Bayesian approach allows incorporating prior knowledge and provides a direct probability statement, but requires choosing a prior. In A/B testing, Bayesian methods are often preferred for their interpretability and ability to handle sequential analysis.

Key Points to Mention

  • Normal approximation assumptions: np ≥ 10 and n(1-p) ≥ 10 (or similar rule of thumb).
  • Wald interval formula: p_hat ± z_{α/2} * sqrt(p_hat(1-p_hat)/n).
  • Beta-Binomial conjugacy: prior Beta(α, β) + binomial data yields posterior Beta(α + x, β + n - x).
  • Equal-tailed credible interval: quantiles 0.025 and 0.975 of the posterior Beta distribution.
  • Interpretation difference: confidence interval is about long-run frequency, credible interval is about posterior probability.
  • Limitations of Wald interval for small samples or extreme p; alternatives like Wilson score interval or Bayesian methods.

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

Q4

When is each type of interval actually reliable, and how does sample size change the picture for both frequentist and Bayesian inference?

A/B Testing & ExperimentationTechnical Trade-offs
Author's notes

This was the part I fumbled most.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the two main types of intervals (confidence intervals and credible intervals) and their theoretical guarantees. Then discuss how sample size affects their reliability, emphasizing the asymptotic behavior and practical considerations. Finally, compare and contrast frequentist and Bayesian perspectives, highlighting when each is more appropriate.

Pro tip: Mention that in large samples, frequentist and Bayesian intervals often coincide numerically, but their interpretations differ fundamentally—this shows deep understanding. Also, note that Bayesian intervals can be reliable even with small samples if priors are well-calibrated, which is crucial for online experimentation.

1. Define interval types and their guarantees

Explain that frequentist confidence intervals have coverage probability guarantees over repeated sampling, while Bayesian credible intervals provide posterior probability statements about the parameter given the data and prior.

2. Discuss sample size effects on frequentist intervals

Describe how confidence intervals rely on asymptotic normality (CLT) for validity; with small samples, they may undercover unless using exact methods (e.g., t-intervals, bootstrap). Larger samples tighten intervals and improve coverage.

3. Discuss sample size effects on Bayesian intervals

Explain that Bayesian credible intervals are valid for any sample size if the model and prior are correct; as sample size grows, the likelihood dominates the prior, and intervals converge to frequentist ones. Small samples require careful prior selection.

4. Compare reliability and practical implications

Highlight that frequentist intervals are reliable when assumptions hold and samples are large; Bayesian intervals are reliable when priors are justified and can be more informative in small samples. In A/B testing, both can be used, but Bayesian methods allow direct probability statements.

5. Conclude with recommendations for ML engineering

Suggest that for large-scale experiments, both approaches yield similar results; for small samples or sequential testing, Bayesian methods with informative priors may be preferable. Emphasize checking assumptions and using simulations to validate interval coverage.

Key Points to Mention

  • Coverage probability vs. posterior probability interpretations
  • Central Limit Theorem and asymptotic normality for frequentist intervals
  • Role of priors in Bayesian inference and sensitivity analysis
  • Convergence of Bayesian and frequentist intervals as sample size increases
  • Small sample challenges: exact methods, bootstrap, and prior influence
  • Practical considerations in A/B testing: sequential analysis, decision-making, and error control

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