0% found this document useful (0 votes)
21 views4 pages

Take Home Task - Senior Software Engineer

The document outlines requirements for developing a policy management service API including endpoints for creating policies, modifying policies, and retrieving policy information. The API should support creating policies with a future start date and insured persons. It should allow modifying policies by adding or removing insured persons with a future effective date. It should also return the current policy state based on the request date.

Uploaded by

Gyan Prakash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views4 pages

Take Home Task - Senior Software Engineer

The document outlines requirements for developing a policy management service API including endpoints for creating policies, modifying policies, and retrieving policy information. The API should support creating policies with a future start date and insured persons. It should allow modifying policies by adding or removing insured persons with a future effective date. It should also return the current policy state based on the request date.

Uploaded by

Gyan Prakash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Take home task for Senior Software Developer

You have to develop a policy management service. So far we are going to support only policies with monthly
payments. This service is in the early stage of development and so far has to cover three main responsibilities:

Creation of the policy


The API should allow the creation of the policy with a start date that could only be in the future starting from the
current date. All the insured persons should be listed in the request. The ids of insured persons in the response
should be unique within one policy.

Policy creation request

{
"startDate": "15.07.2022",
"insuredPersons": [
{
"firstName": "Jane",
"secondName": "Johnson",
"premium": 12.90
},
{
"firstName": "Jack",
"secondName": "Doe",
"premium": 15.90
}
]
}

Policy creation response

{
"policyId": "CU423DF89",
"startDate": "15.07.2022",
"insuredPersons": [
{
"id": 1,
"firstName": "Jane",
"secondName": "Johnson",
"premium": 12.90
},
{
"id": 2,
"firstName": "Jack",
"secondName": "Doe",
"premium": 15.90
}
],
"totalPremium": 28.80
}

Modification of the policy


The API should allow modification of the policy with an effective date when the changes should be applied to the
policy. The effective date is should be in the future starting from today.
For existing insured persons modification is not necessary.
If the person is not listed in the payload, it should be removed.
A new insurance person could be added by adding to the payload without an id.

Policy modification request


{
"policyId": "CU423DF89",
"effectiveDate": "12.09.2022",
"insuredPersons": [
{
"id": 1,
"firstName": "Jane",
"secondName": "Johnson",
"premium": 12.90
},
{
"firstName": "Will",
"secondName": "Smith",
"premium": 12.90
}
]
}

Policy modification response


{
"policyId": "CU423DF89",
"effectiveDate": "12.09.2022",
"insuredPersons": [
{
"id": 1,
"firstName": "Jane",
"secondName": "Johnson",
"premium": 12.90
},
{
"id": 3,
"firstName": "Will",
"secondName": "Smith",
"premium": 12.90
}
]
"totalPremium": 25.80
}

Information about the policy


The API should allow fetching of the policy state based on the request date. If the request date is not provided, the
policy state should be fetched on the current date. Each insured person has a name and monthly premium that is
provided by an external calculation service.

Policy information request


{
"policyId": "CU423DF89",
"requestDate": "03.08.2022"
}

Policy information response


{
"policyId": "CU423DF89",
"requestDate": "03.08.2022",
"insuredPersons": [
{
"id": 1,
"firstName": "Jane",
"secondName": "Johnson",
"premium": 12.90
},
{
"id": 2,
"firstName": "Jack",
"secondName": "Doe",
"premium": 15.90
}
],
"totalPremium": 28.80
}
Summary
The service you develop should be production ready with some admissions:
● You can use in-memory mock db
● You don’t have to take care about authentication/authorization
● The API calls samples for the endpoints are below:

It is preferable to use kotlin as a programming language, but if you want, you can use java as well. You are free to
choose any framework you are familiar with.

Happy coding!

You might also like