← Walmart questions

Random number generator

Filed under Walmart · Also reported at DE Shaw

Given a random number generator function rand5() that yields integers 1 through 5 uniformly at random, write a function rand7() that generates integers 1 through 7 uniformly at random.

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 Walmart questions

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