Understanding Uniform Distribution (and Cracking the Data Science Interview)

CppCodingZen
Level Up Coding

--

We are continuing our series on cracking Data Science interviews. So far, we have worked out a few examples on Maximum Likelihood Estimator (MLE). In this short post, we are going to solve a few problems involving Uniform Distribution. Uniform Distribution is yet another favorite of many interviewers, and nailing any problems involving Uniform Distribution really makes your candidacy stand out 🙂

First and Foremost, the Definition…

A uniform distribution over the bounds a and b has the following probability density function:

Here is the curve for the pdf from Wikipedia:

Recall that the Cumulative Distribution Function (CDF) of a uniform distribution is given by

Cumulative Distribution Function of Uniform Distribution

We are going to use the CDF (instead of PDF) a lot in this post! Make sure you understand the formula above.

--

--

Solutions to programming interview questions at some of the top companies in the world: cppcodingzen.com