Generate 7 integers with equal probability from a function which returns 1/0 with probability p and (1-p)

Data Scientist

Microsoft

Adobe

Autodesk

Databricks

LinkedIn

Careem

  • Can you create a method to produce seven integers with equal likelihood using a binary function with probabilities p and 1-p?
  • Can you devise a way to obtain seven integers with uniform probability from a function that has a probability p of returning 1?
  • Could you design a scheme to produce seven integers of equal probability from a biased binary function?
  • Generate 7 integers with equal probability from a function which returns 1/0 with probability p and (1-p)
  • How can you derive seven equally likely integers from a function that returns binary outcomes with certain probabilities?
  • How can you manipulate a binary function with specific probabilities to yield seven integers with equal chances?
  • How would you use a binary function to generate seven equally probable integers?
  • If you have a function that outputs 1 or 0 with given probabilities, how would you generate seven equal-probability integers?
  • Using a binary function with probabilities p and (1-p), how could you generate seven numbers with uniform probability?
  • What algorithm might you use to generate seven integers with equal probability from a function that outputs 1 or 0 with known probabilities?
  • What approach would you take to generate seven numbers with equal probability from a binary function?

Interview question asked to Data Scientists interviewing at Mastercard, Microsoft, NerdWallet and others: Generate 7 integers with equal probability from a function which returns 1/0 with probability p and (1-p).