News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
PHP Job Interview Task Day of Week Calculation
January 09, 2014 @ 12:14:56

Sometimes during an interview it's difficult to determine the skill set of the person on the other side of the table. One solution to this that's become popular is asking the developer to perform a task of your choosing and watching how they work out the problem. In this new post to the SitePoint PHP blog Bruno Skvorc shares one suggestion for this kind of test - a day of week calculation.

Not so long ago, I was given a job interview task. I was to write a function which deduces the day of the standard 7-day week of ANY calendar (even an imaginary one), provided I know how often leap years happen, if at all, how many months their year has, and how many days each month has. This is a fairly common introductory job-interview task, and in this article I'll be solving and explaining the math behind it.

His task was, given any kind of calendar definition (not necessarily the Gregorian), figure out what day of the week a certain month/day/year combination would fall on. He walks through the entire code to solve the problem, including a bit to output the resulting calendar to an HTML table for each month.

0 comments voice your opinion now!
interview task dayofweek calculation tutorial

Link: http://www.sitepoint.com/php-job-interview-task-day-week-calculation

blog comments powered by Disqus

Similar Posts

Jonathan Snook's Blog: Elemental: Conditional Content with CakePHP

Zend Developer Zone: The Storage Medium

PHPFreaks.com: Sessions and cookies: Adding state to a stateless protocol

NETTUTS.com: Can You Hack Your Own Site? A Look at Some Essential Security Considerations

Sameer Borate's Blog: Read the version of a PDF in PHP


Community Events





Don't see your event here?
Let us know!


list security composer release library interview artisanfiles version series tool language introduction symfony laravel voicesoftheelephpant opinion podcast conference framework community

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework