← Uber Interview Insights

Uber·Data Scientist·Technical Phone Screen·Senior

SeniorPrefer not to say
Jul 2026

Summary

Interviewed for a Data Scientist role at Uber and got a pretty heavy probability and numerical methods question that felt more like a software engineering problem than anything I'd prepped for. Not a vibe check round at all.

Questions Asked (1)

Q1

Given a continuous random variable with a known probability density function, how would you construct its cumulative distribution function? Cover both the case where the PDF is in closed form and where you only have sampled (x, f(x)) pairs. Also address infinite support, piecewise PDFs, normalization, and how to ensure the result is actually non-decreasing and bounded between 0 and 1.

Algorithms & Data StructuresTechnical Trade-offsSystem Design
Author's notes

This took me a second to parse because it sounds like a stats textbook question but they really wanted code or a concrete algorithm.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the CDF as the integral of the PDF from negative infinity to x, then systematically address each aspect: closed-form integration, numerical integration for sampled data, handling infinite support and piecewise PDFs, normalization, and ensuring monotonicity and bounds. Emphasize practical implementation choices and trade-offs, such as interpolation methods and error control.

Pro tip: Mention that in practice, you would validate the CDF by checking that it is non-decreasing, bounded, and that its derivative approximates the PDF; also discuss how to handle numerical issues like underflow/overflow with infinite support by using transformations or truncation with tail bounds.

1. Define the CDF and handle closed-form PDF

State that CDF F(x) = ∫_{-∞}^x f(t) dt. For closed-form PDF, attempt analytical integration; if not possible, use numerical integration (e.g., quadrature) with error control.

2. Handle sampled (x, f(x)) pairs

For discrete samples, use numerical integration methods like trapezoidal rule or Simpson's rule to approximate the integral, ensuring the grid is fine enough. Consider interpolation (e.g., linear or spline) to evaluate f at arbitrary points.

3. Address infinite support and piecewise PDFs

For infinite support, truncate the domain at tails where probability is negligible or use transformations (e.g., logit) to map to finite interval. For piecewise PDFs, integrate each piece separately and sum, ensuring continuity at breakpoints.

4. Normalize and enforce monotonicity and bounds

Normalize the PDF if it doesn't integrate to 1 (e.g., divide by total integral). After constructing F, enforce monotonicity by taking cumulative maximum or using monotonic interpolation, and clip values to [0,1].

5. Validate and discuss trade-offs

Validate by checking F(-∞)=0, F(∞)=1, non-decreasing, and derivative approximates PDF. Discuss trade-offs between accuracy and computational cost, and mention practical considerations like vectorization for large datasets.

Key Points to Mention

  • Analytical integration when possible; otherwise numerical quadrature with error estimation.
  • Numerical integration techniques for sampled data: trapezoidal rule, Simpson's rule, and interpolation methods.
  • Handling infinite support via truncation or transformation, and ensuring tail probabilities are negligible.
  • Piecewise integration with continuity checks at breakpoints.
  • Normalization of the PDF to ensure total probability is 1, and enforcement of monotonicity and bounds [0,1].
  • Validation: checking F(-∞)=0, F(∞)=1, non-decreasing, and derivative approximates PDF; discussing computational trade-offs.

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