Origin offers its users an insurance package personalized to their specific needs without requiring the user to understand anything about insurance. This allows Origin to act as their de facto insurance advisor.
Origin determines the user’s insurance needs by asking personal & risk-related questions and gathering information about the user’s vehicle and house. Using this data, Origin determines their risk profile for each line of insurance and then suggests an insurance plan ("economic", "regular", "responsible") corresponding to her risk profile.
For this assignment, you will create a simple version of that application by coding a simple API endpoint that receives a JSON payload with the user information and returns her risk profile (JSON again) – you don’t have to worry about the frontend of the application.
First, the would-be frontend of this application asks the user for her personal information. Then, it lets her add her house and vehicle. Finally, it asks her to answer 3 binary risk questions. The result produces a JSON payload, posted to the application’s API endpoint, like this example:
{
"age": 35,
"dependents": 2,
"house": {"ownership_status": "owned"},
"income": 0,
"marital_status": "married",
"risk_questions": [0, 1, 0],
"vehicle": {"year": 2018}
}
All user attributes are required:
"single" or "married").Users can have 0 or 1 house. When they do, it has just one attribute: ownership_status, which can be "owned" or "mortgaged".
Users can have 0 or 1 vehicle. When they do, it has just one attribute: a positive integer corresponding to the year it was manufactured.
The application receives the JSON payload through the API endpoint and transforms it into a risk profile by calculating a risk score for each line of insurance (life, disability, home & auto) based on the information provided by the user.
First, it calculates the base score by summing the answers from the risk questions, resulting in a number ranging from 0 to 3. Then, it applies the following rules to determine a risk score for each line of insurance*.
This algorithm results in a final score for each line of insurance, which should be processed using the following ranges:
Considering the data provided above, the application should return the following JSON payload:
{
"auto": "regular",
"disability": "ineligible",
"home": "economic",
"life": "regular"
}
You may use any language and framework, provided that you build a solid system with an emphasis on code quality, simplicity, readability, maintainability, and reliability; particularly with regards to architecture and testing. We'd prefer it if you used Python, but it's just that – a preference.
This assignment should be doable in less than one day. We expect you to learn fast, communicate with us, and make decisions regarding its implementation & scope to achieve the expected results on time.
It is not necessary to build the screens a user would interact with, however, as the API is intended to power a user-facing application, we expect the implementation to be as close as possible to what would be necessary in real-life.
Content type
Image
Digest
Size
343.3 MB
Last updated
over 6 years ago
docker pull marlom1012/insurance_app