Model particle hits on a screen

Quick Overview

This question evaluates geometric reasoning and probability theory skills, specifically transformation of random variables and derivation of CDF/PDF from angular sampling, together with practical competence in Monte Carlo simulation and interpretation of numerical and visualization artifacts; domain: Software Engineering Fundamentals.

Model particle hits on a screen

Company: OpenAI

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: hard

Interview Round: Onsite

A point source at (0, 0) emits particles toward an infinite vertical screen located at x = 1. For each particle, sample an angle theta uniformly from [-pi/2, pi/2] relative to the positive x-axis, and let the particle travel in a straight line until it hits the screen. 1. Let Y be the y-coordinate where the particle hits the screen. Express Y in terms of theta. 2. Derive the CDF and PDF of Y. 3. Write a simulation that generates many particles and verifies the theoretical result by comparing a normalized histogram of the sampled hit locations with the true density. 4. Briefly explain any numerical or visualization issues you would expect in this simulation.

Quick Answer: This question evaluates geometric reasoning and probability theory skills, specifically transformation of random variables and derivation of CDF/PDF from angular sampling, together with practical competence in Monte Carlo simulation and interpretation of numerical and visualization artifacts; domain: Software Engineering Fundamentals.

|Home/Software Engineering Fundamentals/OpenAI
OpenAI logo
OpenAI
Feb 22, 2026, 12:00 AM
hardSoftware EngineerOnsiteSoftware Engineering Fundamentals
45
0

A point source at (0, 0) emits particles toward an infinite vertical screen located at x = 1. For each particle, sample an angle theta uniformly from [-pi/2, pi/2] relative to the positive x-axis, and let the particle travel in a straight line until it hits the screen.

  1. Let Y be the y-coordinate where the particle hits the screen. Express Y in terms of theta.
  2. Derive the CDF and PDF of Y.
  3. Write a simulation that generates many particles and verifies the theoretical result by comparing a normalized histogram of the sampled hit locations with the true density.
  4. Briefly explain any numerical or visualization issues you would expect in this simulation.
Loading comments...