Background
My Objective is I am basically trying to create an end point where a user calls the get_word() function and they get back a word. The requirement is every single user that calls the get_word() function should get back the same word on a given day. No words should repeat until we have cycled through all the words.
So for example let's assume we have a array of words.
words = ["lebron","kobe","jordan","durant","pipen"]
day 1 and users call the function get_word() they get back lebron
day 2 and users call the function get_word() they get back kobe
day 3 and users call the function get_word() they get back jordan
day 4 and users call the function get_word() they get back durant
day 5 and users call the function get_word() they get back pipen
day 6 and users call the function get_word() they get back lebron
day 7 and users call the function get_word() they get back kobe
The goal is to have list of 500 unique words and on a given day every user should get the same word back. I would also want the ability to add more words in the future.
Solution
One very naive solution i am able to think of is i can generate a dictionary with everyday of the year as a key and words as the value. The issue with this is we only have 365 days in a year so i can only store 365 words but not 500.
I appreciate any thoughts or feedback on how i can come up with a better solution here.
This problem is language agnostic hence the java and python tag.