This assessment aims at modelling the reports, users, and loans that exist in the system and their relationship to one another, using SQLAlchemy, in less than 3 hours.
The amount of time spent on this assessment, and more, can be seen in WakaTime
See the documentation here.
The goal of this exercise is to see:
- What your "production" level code looks like (OO, Documentation, etc)
- How you ensure that the code actually works as expected (Testing)
- How you respond to tight deadlines (Which sacrifices you make)
- Your approach and creativity to crafting a solution
Model the reports, users, and loans that exist in the system and their relationship to one another, using SQLAlchemy (or any ORM you prefer). As a starting point, your PM has given you the following attributes that belong to these items:
The first and last name of the user Max 255 characters Cannot be empty
Can only have a value of USD, GBP, or JPY
The amount of money that the loan is for Must always have a value of zero or higher
A short description of the report, max 255 characters, cannot be empty
The actual report text, Max 5MB
A user who created the report, cannot be empty
A list of loans that are associated with this particular report
- N.B. A loan may be referenced by multiple reports
- Create suitable SQLA models to represent the objects listed above and their relationships to one another
- Write unit-test that seeds a database (SQLite) with sample data for each type
- Write a test case that ensures the relationships work as expected
- Write a test case for finding all reports that a loan belongs to
- Write a test case for calculating the sum of all loans that went into a specific report