Sample uniformly from a circle’s area

Quick Overview

This question evaluates understanding of continuous probability distributions and geometric random sampling, testing whether a candidate recognizes how area-weighted uniformity differs from naive radial choices.

Sample uniformly from a circle’s area

Company: LinkedIn

Role: Machine Learning Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

How would you generate a point `(x, y)` uniformly at random from the *area* of a circle of radius `R` centered at the origin? - Explain why naive choices (e.g., choosing radius uniformly in `[0,R]`) are not uniform over area. - Provide a correct sampling method (math + pseudocode).

Quick Answer: This question evaluates understanding of continuous probability distributions and geometric random sampling, testing whether a candidate recognizes how area-weighted uniformity differs from naive radial choices.

|Home/Coding & Algorithms/LinkedIn
LinkedIn logo
LinkedIn
Feb 18, 2026, 12:00 AM
mediumMachine Learning EngineerOnsiteCoding & Algorithms
17
0

How would you generate a point (x, y) uniformly at random from the area of a circle of radius R centered at the origin?

  • Explain why naive choices (e.g., choosing radius uniformly in [0,R] ) are not uniform over area.
  • Provide a correct sampling method (math + pseudocode).

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...