The motivation behind the coding test is the measurement of the qualification and testing the learning attitude of the candidate.
Create a pseudorandom number generator based on Linear Congruential Generator algorithm. Pick one and use any of the following languages, and please do NOT use any library you can find on the internet.
- C
- C++
- Rust
This should be a sandalone library with a single public function. The function should be the following (Note: The function definition doesn't follow any language syntax):
Rand(min int, max int) int
This function accept two integer az input parameters and returns one output. This should determine the range I want to generate random number.
Test scenarios:
min=1; max=200 => should generate a number between 1 and 200
min=1000; max=9999 => should generate a number between 1000 and 9999
Validate when the max is smaller than min. Validate the possible integer overflow.