← Microsoft questions
CodingReported in a candidate post, Oct 2021

Random number generation

Filed under Microsoft · Also reported at Paytm, Svaya Robotics

Given a function rand7() that returns a uniform random integer from 1 to 7, implement a function rand10() that returns a uniform random integer from 1 to 10.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Microsoft questions

Collected from public candidate posts and coding forums. Updated Nov 2026.