Test for junior python developer Company: airsorted
You are free to use your language of choice, but we would prefer you to use either Python or Ruby. There are no restrictions aside from those specified within the task description.
If you have any questions about the task, please ask b efore you start!
Implement a method which accepts a list of booking start and end dates, along with a specific month, and returns a list of all the days within that month that aren’t already booked. You should also provide a way to test the method.
This task is intended to assess your problem solving ability, coding style, code reusability, and approach to program flow. As such please do not exceed the one hour time limit as it will usually be obvious. If you choose to implement this in Python, we would prefer that you did not use the builtin library calendar module, as it detracts from the problem solving and data structure elements of the task. If you have time to spare then you might consider the bonus question(s) after this one, or spend the time improving your existing solution.
The input data for bookings might be a list of associative arrays, or possibly a multidimensional list, please specify the expected format in your notes. For example, it might be a list of dictionary objects, each one containing a “start” and “end” key: [ { “start”: “20150601”, “end”: “20150615” }, { “start”: “20150618”, “end”: “20150627” } ]
Return a list of strings, in the format “YYYYmmdd” of all the dates within the specified month that are available for booking, e.g. [ “20150616”, “20150617”, “20150628”, “20150629”, “20150630” ]
In order to obtain bonus points within the allowed hour, you may consider some (or all!) of the following bonus point tasks (in order of awesome). Please remember to consider coding style, and design when considering bonus points.
-
- Don’t use python library’s builtin calendar module.
-
- Raise an exception when a date is double booked the method may cease processing at this point.
-
- An extra method (or extend the original) that will either print out, or return a list, of all dates within the input list that are “double booked”.
-
- A method to print out the a $cal style calendar for the specific month.
-
- A method to print out a full year $ cal output for the input data specified including all bookings.
Both 3 and 4 may output in HTML format, if necessary.
Install requeriments:
pip install -r ./requeriments.txt
Execute tests with nosetests:
nosetests -v tests/tests.py
Jose Bermudez [email protected]