GithubHelp home page GithubHelp logo

jaysu-github / hubspot-coding-solution Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexxugl/hubspot-coding-solution

0.0 1.0 0.0 7 KB

Sample Java solution to one of the programming questions.

Java 100.00%

hubspot-coding-solution's Introduction

HubSpot-Coding-Solution

Sample Java solution to one of the programming questions.

You’re provided with an API that gives you a list of partners, their countries, and which dates they’re 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. API Docs and Example To get the list of partners, send an HTTP GET to:

https://candidate.hubteam.com/candidateTest/v3/problem/dataset?userKey=81f395bc9ac3c8ff5d53d518000f

Here’s a sample response with 10 partners:

{ "partners": [ { "firstName": "Darin", "lastName": "Daignault", "email": "[email protected]", "country": "United States", "availableDates": [ "2017-05-03", "2017-05-06" ] }, { "firstName": "Crystal", "lastName": "Brenna", "email": "[email protected]", "country": "Ireland", "availableDates": [ "2017-04-27", "2017-04-29", "2017-04-30" ] }, { "firstName": "Janyce", "lastName": "Gustison", "email": "[email protected]", "country": "Spain", "availableDates": [ "2017-04-29", "2017-04-30", "2017-05-01" ] }, { "firstName": "Tifany", "lastName": "Mozie", "email": "[email protected]", "country": "Spain", "availableDates": [ "2017-04-28", "2017-04-29", "2017-05-01", "2017-05-04" ] }, { "firstName": "Temple", "lastName": "Affelt", "email": "[email protected]", "country": "Spain", "availableDates": [ "2017-04-28", "2017-04-29", "2017-05-02", "2017-05-04" ] }, { "firstName": "Robyn", "lastName": "Yarwood", "email": "[email protected]", "country": "Spain", "availableDates": [ "2017-04-29", "2017-04-30", "2017-05-02", "2017-05-03" ] }, { "firstName": "Shirlene", "lastName": "Filipponi", "email": "[email protected]", "country": "Spain", "availableDates": [ "2017-04-30", "2017-05-01" ] }, { "firstName": "Oliver", "lastName": "Majica", "email": "[email protected]", "country": "Spain", "availableDates": [ "2017-04-28", "2017-04-29", "2017-05-01", "2017-05-03" ] }, { "firstName": "Wilber", "lastName": "Zartman", "email": "[email protected]", "country": "Spain", "availableDates": [ "2017-04-29", "2017-04-30", "2017-05-02", "2017-05-03" ] }, { "firstName": "Eugena", "lastName": "Auther", "email": "[email protected]", "country": "United States", "availableDates": [ "2017-05-04", "2017-05-09" ] } ] } POST a JSON body to:

https://candidate.hubteam.com/candidateTest/v3/problem/result?userKey=81f395bc9ac3c8ff5d53d518000f

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

{ "countries": [ { "attendeeCount": 1, "attendees": [ "[email protected]" ], "name": "Ireland", "startDate": "2017-04-29" }, { "attendeeCount": 0, "attendees": [], "name": "United States", "startDate": null }, { "attendeeCount": 3, "attendees": [ "[email protected]", "[email protected]", "[email protected]" ], "name": "Spain", "startDate": "2017-04-28" } ] }

hubspot-coding-solution's People

Contributors

vikassivaravindran avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.