Skip to content

Instantly share code, notes, and snippets.

@jtblin
Last active December 30, 2015 18:29
Show Gist options
  • Save jtblin/7868117 to your computer and use it in GitHub Desktop.
Save jtblin/7868117 to your computer and use it in GitHub Desktop.
Coding exercise

Coding exercise

Requirements:

  • The web application should have a single web page that has a form input and a button
  • When the user enters a valid us zipcode into the form and clicks the button, it should display a page with the city name, state name, and current temperature in fahrenheit.
  • If the user puts in an input that is not in the correct format for a zip code (5 numbers) the page should display an error: 'invalid zip code format'
  • If the user enters an input that is in the correct format but the zip code does not exist the page should display an error: 'zipcode not found'
  • The project should compile, run unit tests and start tomcat using maven
  • The project must contain some unit tests
  • The unit tests must cover the validation

How to get the weather data: http://www.wunderground.com/weather/api/d/docs?d=data/conditions

The API Key is: ed044d75b91fb500

Hint: The example in the docs uses q/state/city.json, but you can use q/.json instead for example:

http://api.wunderground.com/api/ed044d75b91fb500/conditions/q/94117.json http://api.wunderground.com/api/ed044d75b91fb500/conditions/q/94117.xml

You may choose to use either the JSON or XML api, but please be prepared to explain why you chose the one you did.

How to submit the code sample

  1. Create a github repository and import the code
  2. Include a README.md file that has instructions on how to compile, execute the tests, and start the application. Also document any assumptions you've made, known issues with your example, or anything about your thought process during the exercise that you'd like to share.
  3. Send me a link to the github repository
  4. Create a very simple site hosted for free on Heroku that consumes this API and displays deals in an appealing manner.
  1. Extra credit if it builds in Travis-CI: https://travis-ci.org/

How the code sample will be evaluated

  • The code sample must result in a working application by following the instructions you provide in the README file
  • The appropriate usage of the following spring annotations: @Controller, @Service, @Configuration, @Value, @RequestMapping, @Bean, @Autowired
  • The quality of the unit test. Approach to testing (TDD is ideal, but not required).
  • Coding style and readability of code.

Keep the exercise simple. This is not something that should take more than four to eight hours of effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment