← Google Interview Insights

Google·Data Scientist·Technical Phone Screen·Senior

Senior
May 2026

Summary

Google data scientist interview with a statistics-heavy question on truncated distributions. Nothing behavioral, just pure probability theory under mild pressure. The question had multiple parts so it felt like it kept going after I thought I was done.

Questions Asked (1)

Q1

If you only keep samples from a normal distribution where the value is greater than 1, what is the resulting distribution called, what is its formal PDF and CDF, and how would you generate random samples from it using at least two different methods?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

The name came to me quickly (truncated normal) but writing out the formal PDF tripped me up a bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the truncated normal distribution and its parameters, then derive the PDF and CDF using the standard normal PDF and CDF. For sampling, describe at least two methods: inverse transform sampling and rejection sampling, and discuss their trade-offs.

Pro tip: Mention that the truncation point is in standard deviation units if the original distribution is standard normal; otherwise, standardize first. Also, note that the truncated normal is often used in Bayesian inference and survival analysis.

1. Identify the distribution

State that the resulting distribution is a truncated normal distribution, specifically left-truncated at 1 (or right-truncated if considering the upper tail).

2. Derive the PDF and CDF

Write the PDF as f(x) = φ((x-μ)/σ) / (σ * (1 - Φ((a-μ)/σ))) for x > a, where a=1, and the CDF as F(x) = (Φ((x-μ)/σ) - Φ((a-μ)/σ)) / (1 - Φ((a-μ)/σ)) for x ≥ a.

3. Describe sampling method 1: Inverse transform

Generate u ~ Uniform(Φ((a-μ)/σ), 1), then set x = μ + σ * Φ^{-1}(u). This is efficient and exact.

4. Describe sampling method 2: Rejection sampling

Sample from the original normal distribution and reject any sample ≤ a. Repeat until the desired number of samples is obtained. This is simple but may be inefficient if the truncation probability is high.

5. Discuss trade-offs and alternatives

Compare the methods: inverse transform is exact and efficient but requires the inverse CDF; rejection sampling is easy but can be slow. Mention other methods like Gibbs sampling or specialized algorithms if needed.

Key Points to Mention

  • Definition of truncated normal distribution
  • PDF and CDF formulas with proper normalization
  • Inverse transform sampling using the inverse CDF
  • Rejection sampling and its efficiency considerations
  • Trade-offs between sampling methods
  • Applications or contexts where truncated normal arises

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