Re: [U2] [OT] Interview Questions

Kevin King <[email protected]>
Newsgroups gmane.comp.db.u2.general
Message-ID <CA+v=tEKE_=ogBWF15fHb_v_5t7Wz3xmXNU6Eh_isvVuvDLHxNQ@mail.gmail.com>
The most challenging date math we've faced recently (a real project) is the
ISO 8601 week calculation.  Extremely easy to introduce an off-by-one error!


On Sat, Dec 14, 2013 at 11:13 AM, Wols Lists <[email protected]>wrote:

> On 14/12/13 16:48, Dan Fitzgerald wrote:
> > Kevin: I'd take the month (verifying; gigo), then run it through a case
> statement to determine the number of days in that month (sounds like a
> handy subroutine to have in the toolbox). Then I'd convert to get the day
> of the week, another case statement to get the number of days past
> Thursday, do the math from the last DOM internal date, oconv the result,
> and grab a cup of dark roast. There are probably more efficient ways, but
> that's how I'd work it through my head in an interview.
>
> This is pretty much the same problem as "current week of the year" :-)
>
> Can't remember off the top of my head, but it's *extremely* easy to make
> an "off by one" error - I remember someone copying my Pickwiki code and
> getting it wrong, introducing the very error I'd fixed.
>
> Cheers,
> Wol
> _______________________________________________
> U2-Users mailing list
> [email protected]
> http://listserver.u2ug.org/mailman/listinfo/u2-users
>
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.