We're going to create a system that will use the USGS Earthquake public data set to show us where the nearest earthquake above a 5.0 was in relation to one of the following cities, between 2 dates that the user specifies:
- Los Angeles, CA
- San Francisco, CA
- Tokyo, Japan
The result returned should show something like:
Result for Los Angeles between June 1 2021 and July 5 2021 : The closest Earthquake to Los Angeles was a M 5.7 - South of Africa on June 30
The application should also save the results every time we run the search, and allow us to view the results again as quickly as possible.
If no results were found during those dates, simply show a “No results found”
The system will consist of the following:
- An endpoint to create a new city
- An endpoint for us to search for earthquakes including: start date for the search and end date for the search
- A results JSON of current results of the search
This project should form the basis of how you would approach building a real app and backend where this data was needed by our team.
We know this is something of a toy challenge, but we've found writing "real" code is very helpful in seeing how someone actually works and thinks.
- Correctness: How well does your code adhere to the specifications.
- Implementation: How are you storing the data? Are you caching it, or running the query every request? What are you using for data storage?
- Documentation: Can we easily set this up ourselves? Do you call out your assumptions and your tradeoffs? Feel free to use any packages such as scipy, numpy, etc to help with the challenge.
- Language/framework choice: For this challenge please use Django and Python for the backend. Bonus points if you are able to use React or Vue Js for the frontend (optional)
- Database: Feel free to use any database for this challenge
USGS provides urls for you to query from them for free here: https://earthquake.usgs.gov/earthquakes/search/
An example of using the URL: https://earthquake.usgs.gov/fdsnws/event/1/query.geojson?starttime=2021-06-07&endtime=2021-07-07&minmagnitude=4.5&orderby=time
Feel free to make any assumptions you want along the way, just document them in a README. If you have a question you want an answer to, send an email to your contact.
When you're done, create a zip file with the project contents and e-mail it to your contact. We'll take a look pretty quickly... we're always excited to see new solutions!