Design a random number generator that does not output a number that has already been generated.
Anonymous
You could fiddle around with data structures (my initial implementation was using a hashmap for the generated numbers and checking it), but a good solution that I found out after the interview was that you can generate an array with all the numbers up to the max you want to generate, and then just shuffle it.
Check out your Company Bowl for anonymous work chats.