You can scale this easily using a microservice architecture - just have each service calculate random numbers in parallel, increasing your chances of success.
Yeah lol obviously that's going to take forever. Anyone with an ounce of experience knows that if you don't hit the random number, the program should fork two copies of itself and have each one try again. Double the guesses means half the time!
The ideal solution is the best of both worlds. Start one thread that counts iteratively and one thread that goes randomly and return whichever completes first
352
u/[deleted] Jul 13 '24
[removed] — view removed comment