Preparing your design workspace

Loading the problem and your saved attempt…

Design a Pluggable Random Value Library

Design a testable random-value library with interchangeable generators and useful operational metrics.

For this exercise, assume an application library exposes functions that produce a uniformly sampled integer within an inclusive range and select one value from a caller-supplied weighted list. Callers can request a default source of randomness or inject a seeded source for repeatable tests.

Invalid ranges and nonpositive weights produce explicit errors. The library should allow a new generation policy without changing its public caller API.

Design the objects, interfaces, and interactions, then explain which usage, latency, error, and output-quality signals you would monitor without recording generated values. Cryptographic security, distributed coordination, and a production alerting service are outside this exercise.