PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCareers
|Home/Coding & Algorithms/LinkedIn

Sample uniformly from a circle’s area

Last updated: Mar 29, 2026

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.

  • medium
  • LinkedIn
  • Coding & Algorithms
  • Machine Learning Engineer

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.

Related Interview Questions

  • Count Trips From Vehicle Logs - LinkedIn (easy)
  • Design O(1) Randomized Multiset - LinkedIn (easy)
  • Process Mutable Matrix Sum Queries - LinkedIn (medium)
  • Design a Randomized Multiset - LinkedIn (medium)
  • Can You Place N Objects? - LinkedIn (medium)
LinkedIn logo
LinkedIn
Feb 18, 2026, 12:00 AM
Machine Learning Engineer
Onsite
Coding & Algorithms
10
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).

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More LinkedIn•More Machine Learning Engineer•LinkedIn Machine Learning Engineer•LinkedIn Coding & Algorithms•Machine Learning Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • Careers
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.