- #1
Taylor_1989
- 402
- 14
- TL;DR Summary
- Disclaimer : The is a technical assessment sent to me by a potential employer, so I am not looking for any kinda of answer to the question more of guidance to a particular question I have with regards to the question. For full transparency to given employer I will link this thread so they can view the thread if they want.
The question is as follows :
''Given that January 1st, 2018 is a Saturday, write an algorithm to determine the day of the week for a given date provided as an input. The input to the algorithm should be in the format YYYYMMDD, where March 21st 2018 is written as 20180321''
My issue is as follows, looking through some algorithms on wiki https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week. My inital through were to implement one of the given on this page, but with further reading I realized this cannot be done for this question imo without modifications that I am not sure are possible. The reason being is that the given start date they have given is incorrect, in that 1st, 2018 is a Saturday which is not, and it is actually on a Monday which is the issue.
The given algorithms will given the true date, based on the Gregorian calendar and as the start date day is wrong I done believe I can use these type of algorithms and makes me think that I should not be looking at the general case but rather the specific case for that particular year, which I believe can be done.
If Admin deem this in appropriate question please remove thread.
''Given that January 1st, 2018 is a Saturday, write an algorithm to determine the day of the week for a given date provided as an input. The input to the algorithm should be in the format YYYYMMDD, where March 21st 2018 is written as 20180321''
My issue is as follows, looking through some algorithms on wiki https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week. My inital through were to implement one of the given on this page, but with further reading I realized this cannot be done for this question imo without modifications that I am not sure are possible. The reason being is that the given start date they have given is incorrect, in that 1st, 2018 is a Saturday which is not, and it is actually on a Monday which is the issue.
The given algorithms will given the true date, based on the Gregorian calendar and as the start date day is wrong I done believe I can use these type of algorithms and makes me think that I should not be looking at the general case but rather the specific case for that particular year, which I believe can be done.
If Admin deem this in appropriate question please remove thread.