Question: (Java) Its your first day at DataCom, and youre in charge of writing the logic to send invitations to a special two-day event in each

(Java)

Its your first day at DataCom, and youre in charge of writing the logic to send invitations to a special two-day event in each country for DataCom's partners in those countries. We need to find the dates thatll work best based on survey results that partners have sent in and determine how many people can attend.

Youre provided with an API that gives you a list of partners, their countries, and which dates theyre available in ISO 8601 format.

Another team will send out the invitations, but you need to tell them when we should host the event and who should attend by POSTing to an API.

The date you send in for the country should be the starting date of the two day period where the most partners can make it for both days in a row. In case of multiple dates with the same number of partners, pick the earlier date. If there are no two days in a row when any partners can make it, return null.

Here's a sample response :

(Java) Its your first day at DataCom, and youre in charge of

POST a JSON body to:

https://candidate.hubteam.com/candidateTest/v2/results?userKey=bb3599218d2c71a97c9ea94a06b8

For the list of partners above, the proper API response to send would look like this:

writing the logic to send invitations to a special two-day event in

If your answer is correct, the API will return 200 OK. If the request is malformatted or incorrect, the API will return 400 along with a message indicating if the response is of the wrong structure or incorrect.

"partners": [ "FirstName":"Darin", "lastName":"Daignault", "email": "ddaignault@hubspotpartners.com", "country":"United States" "availableDates": [ "2017-05-03" "2017-05-06" "firstName":"Crystal", "lastName": "Brenna", "email": "cbrenna@hubspotpartners.com" "country":"Ireland", "availableDates": "2017-04-27", "2017-04-29" "2017-04-30" "FirstName" "Janyce", "lastName": "Gustison", "email": "jgustison@hubspotpartners.com", "country"Spain", "availableDates": 2017-04-29" 2017-04-30" 2017-05-01" "partners": [ "FirstName":"Darin", "lastName":"Daignault", "email": "ddaignault@hubspotpartners.com", "country":"United States" "availableDates": [ "2017-05-03" "2017-05-06" "firstName":"Crystal", "lastName": "Brenna", "email": "cbrenna@hubspotpartners.com" "country":"Ireland", "availableDates": "2017-04-27", "2017-04-29" "2017-04-30" "FirstName" "Janyce", "lastName": "Gustison", "email": "jgustison@hubspotpartners.com", "country"Spain", "availableDates": 2017-04-29" 2017-04-30" 2017-05-01

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!