I made up and asked this question/puzzle during a interview for senior C# software engineer.
a programmer cannot work 2 days in a row otherwise he/she will get crazy.
each day's work contribution is known.
How does the programmer schedules his/her time so that he can stay alive till the end of work-day (suppose there are n days) and meantime his/her contribution is maximized.
It turns out it is almost the same as this puzzle only the words/story are changed but the concept is the same.
https://helloacm.com/cc-coding-exercise-house-robber-dynamic-programming/