- Fork and clone this repo
- Optionally setup a virtual environment (use Python3)
- Install requirements
pip install -r requirements.txt
- Run django migrations
python payroll/manage.py migrate
- Create a superuser
python payroll/manage.py createsuperuser
- Load initial data
python payroll/manage.py loaddata payroll_loader
- Start Django server
python payroll/manage.py runserver
- Browse to
http://127.0.0.1:8000/payroll_loader/
- Or the server address chosen when starting server
- Click
Upload Payroll CSV
- Click
Browse
and select payroll file to upload - Click
Upload
- If upload completes, you will automatically be taken to the payroll report
This was a great challenge. I decided to use Django as it seems like the more ubiquitous and robust framework for Python. I considered Flask but felt that Django would make the application stronger and more scalable.
I also designed the model with scalability in mind, so that the scope of the payroll application can be extended to include features such as an employee profile management feature. The pay cheque (pay amounts by pay period per employee) was added to the models so period pay amount only needed to be calculated once as the data was loaded into the application. Employees and job groups were stored separately as one employee can belong to multiple job groups (e.g. an employee is promoted) and many employees can be members of a single job group.
The templates are the weakest portion of the application, and the area I have the least experience in. However, front-end design is something I would like to become proficient in aim of becoming a full stack developer.
The payroll report is ordered by pay period is that the most recent pay cheques appear at the top, which is likely how most users would like the data ordered. I would probably replace this simple template with something a bit more robust so that users could sort directly on the page.
Applicants for the Software developer role at Wave must complete the following challenge, and submit a solution prior to the onsite interview.
The purpose of this exercise is to create something that we can work on together during the onsite. We do this so that you get a chance to collaborate with Wavers during the interview in a situation where you know something better than us (it's your code, after all!)
There isn't a hard deadline for this exercise; take as long as you need to complete it. However, in terms of total time spent actively working on the challenge, we ask that you not spend more than a few hours, as we value your time and are happy to leave things open to discussion in the on-site interview.
Please use whatever programming language and framework you feel the most comfortable with.
Feel free to email [email protected] if you have any questions.
Imagine that this is the early days of Wave's history, and that we are prototyping a new payroll system with an early partner. Our partner is going to use our web app to determine how much each employee should be paid in each pay period, so it is critical that we get our numbers right.
The partner in question only pays its employees by the hour (there are no salaried employees.) Employees belong to one of two job groups which determine their wages; job group A is paid $20/hr, and job group B is paid $30/hr. Each employee is identified by a string called an "employee id" that is globally unique in their system.
Hours are tracked per employee, per day in comma-separated value files (CSV). Each individual CSV file is known as a "time report", and will contain:
- A header, denoting the columns in the sheet (
date
,hours worked
,employee id
,job group
) - 0 or more data rows
- A footer row where the first cell contains the string
report id
, and the second cell contains a unique identifier for this report.
Our partner has guaranteed that:
- Columns will always be in that order.
- There will always be data in each column.
- There will always be a well-formed header line.
- There will always be a well-formed footer line.
An example input file named sample.csv
is included in this repo.
We've agreed to build the following web-based prototype for our partner.
- Your app must accept (via a form) a comma separated file with the schema described in the previous section.
- Your app must parse the given file, and store the timekeeping information in a relational database for archival reasons.
- After upload, your application should display a payroll report. This report should also be accessible to the user without them having to upload a file first.
- If an attempt is made to upload two files with the same report id, the second upload should fail with an error message indicating that this is not allowed.
The payroll report should be structured as follows:
- There should be 3 columns in the report:
Employee Id
,Pay Period
,Amount Paid
- A
Pay Period
is a date interval that is roughly biweekly. Each month has two pay periods; the first half is from the 1st to the 15th inclusive, and the second half is from the 16th to the end of the month, inclusive. - Each employee should have a single row in the report for each pay period
that they have recorded hours worked. The
Amount Paid
should be reported as the sum of the hours worked in that pay period multiplied by the hourly rate for their job group. - If an employee was not paid in a specific pay period, there should not be a row for that employee + pay period combination in the report.
- The report should be sorted in some sensical order (e.g. sorted by employee id and then pay period start.)
- The report should be based on all of the data across all of the uploaded time reports, for all time.
As an example, a sample file with the following data:
date | hours worked | employee id | job group |
---|---|---|---|
4/11/2016 | 10 | 1 | A |
14/11/2016 | 5 | 1 | A |
20/11/2016 | 3 | 2 | B |
should produce the following payroll report:
Employee ID | Pay Period | Amount Paid |
---|---|---|
1 | 1/11/2016 - 15/11/2016 | $300.00 |
2 | 16/11/2016 - 30/11/2016 | $90.00 |
Your application should be easy to set up, and should run on either Linux or Mac OS X. It should not require any non open-source software.
There are many ways that this application could be built; we ask that you build it in a way that showcases one of your strengths. If you enjoy front-end development, do something interesting with the interface. If you like object-oriented design, feel free to dive deeper into the domain model of this problem. We're happy to tweak the requirements slightly if it helps you show off one of your strengths.
Please modify README.md
to add:
- Instructions on how to build/run your application
- A paragraph or two about what you are particularly proud of in your implementation, and why.
- Clone the repository.
- Complete your project as described above within your local repository.
- Ensure everything you want to commit is committed.
- Create a git bundle:
git bundle create your_name.bundle --all
- Email the bundle file to [email protected]
Evaluation of your submission will be based on the following criteria.
- Did you follow the instructions for submission?
- Did you document your build/deploy instructions and your explanation of what you did well?
- Were models/entities and other components easily identifiable to the reviewer?
- What design decisions did you make when designing your models/entities? Are they explained?
- Did you separate any concerns in your application? Why or why not?
- Does your solution use appropriate data types for the problem as described?