Meta interview question

Date structure related code and query