Back to Data Engineering Interview
Data Engineering Interview

Data Engineering Interview

23 of 73 Completed

Bernoulli Sample
Go to question details page

Write a function to get a sample from a Bernoulli trial.

Input:

def bernoulli_sample(p):
    pass

Output:

1 with probability p or 0 with probability 1-p.

Good job, keep it up!

31%

Completed

You have 50 sections remaining on this learning path.

Loading pricing options