Giter VIP home page Giter VIP logo

weathercodechallenge's Introduction

Weather Code challenge

The solution has to determine if a city is having good weather or bad weather and when is bad weather also get details about it.

The output should be clearly defined by the candidate and should be reflected in the tests OpenWeatherMapClientTests (that is incompleted).

The solution must be and API with one endpoint and two methods GET & POST

POST:

  • To process a petition for obtaining the city weather information the candidate have access to an OpenWeatherMap API to make a request and gather the parameters (aka sensors) about the weather.
  • The solution has an incomplete service WeatherDetectorService that should take sensors to determine if is having good or bad weather and including the detailed reason if bad weather.
  • The weather information must be stored on a repository (preferably in Entity Framework Core, using an in-memory option database will be enough).

GET:

  • Returns a string indicating the last weather. For example, if we want to look at the weather of Barcelona city, and is raining, the expected output should be something like this:

    "Bad weather in Barcelona because is raining". 
    
  • The information should be obtained from a repository.

An incompleted solution is provided to the candidate that should be finished connecting incomplete parts, taking into account:

  1. Define model Weather properties needed to store all the data.
  2. Implement interface IWeatherClient to make the calls to OpenWeatherMap API
  3. Implement interface IWeatherRepository to store the defined model Weather
  4. Complete the endpoints GET and POST from WeatherController

Weather API OpenWeatherMap.org

Example api call to obtain weather from Barcelona
HTTP GET Request https://api.openweathermap.org/data/2.5/weather?q=barcelona&units=metric&APPID=1b9c96d2448f9204d210ddd5ac192dc1
Response
{ 
"coord": { ... },
"weather": [{
"id": 801,
"main": "Clouds",
"description": "few clouds",
"icon": "02d"
}],
"base": "stations",
"main": { ... },
"visibility": 10000,
"wind": { ... },
"clouds": { ... },
"dt": 1618228232,
"sys": { ... },
"timezone": 7200,
"id": 3128760,
"name": "Barcelona",
"cod": 200
}

Goals to evaluate

  • How the candidate focus the solution
  • How you approach the project
  • Design and architecture
  • How the code is writed
  • Solution testing

Please do not hesitate to contact [email protected] or [email protected] if any doubt

weathercodechallenge's People

Contributors

macalbert avatar

Watchers

 avatar  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.