Wikis & learning

Choose a repeatable daily puzzle

Assign each puzzle a stable primary key and store its answer outside the public puzzle response. A release calendar maps a date to one of those keys.

Question

Choose a repeatable daily puzzle

Editorial answer

Assign each puzzle a stable primary key and store its answer outside the public puzzle response. A release calendar maps a date to one of those keys.

Read the current date using the puzzle’s configured timezone. Find the date in an indexed schedule table. Create explicit schedule entries ahead of release so a reload or a new worker never picks a different puzzle at random.

Verify the result

Test two requests in parallel, the first request after midnight and a day with no scheduled entry. A missing entry should return an explicit unavailable state.

Discussion

Sign in to participate.