Apple Interview Question

Implement a random number generator in c++ and reduce the complexity, asked me to write the code