In the given assignment we suggest you to process an automatically generated JSON file with recipe data and calculated some stats.
Json fixtures file with recipe data. Download Link
Important notes
- Property value
"delivery"always has the following format: "{weekday} {h}AM - {h}PM", i.e. "Monday 9AM - 5PM" - The number of distinct postcodes is lower than
1M, one postcode is not longer than10chars. - The number of distinct recipe names is lower than
2K, one recipe name is not longer than100chars.
- Count the number of unique recipe names.
- Count the number of occurences for each unique recipe name (alphabetically ordered by recipe name).
- Find the postcode with most delivered recipes.
- Count the number of deliveries to postcode
10120that lie within the delivery time between10AMand3PM, examples (12AMdenotes midnight):NO-9AM - 2PMYES-10AM - 2PM
- List the recipe names (alphabetically ordered) that contain in their name one of the following words:
- Potato
- Veggie
- Mushroom
- The application is packaged with Docker.
- Setup scripts are provided.
- The submission is provided as a
CLIapplication. - The expected output is rendered to
stdout. Make sure to render only the finaljson. If you need to print additional info or debug, pipe it tostderr. - It should be possible to (implementation is up to you):
a. provide a custom fixtures file as input
b. provide custom recipe names to search by (functional reqs. 5)
c. provide custom postcode and time window for search (functional reqs. 4)
Generate a JSON file of the following format:
{
"unique_recipe_count": 15,
"count_per_recipe": [
{
"recipe": "Mediterranean Baked Veggies",
"count": 1
},
{
"recipe": "Speedy Steak Fajitas",
"count": 1
},
{
"recipe": "Tex-Mex Tilapia",
"count": 3
}
],
"busiest_postcode": {
"postcode": "10120",
"delivery_count": 1000
},
"count_per_postcode_and_time": {
"postcode": "10120",
"from": "11AM",
"to": "3PM",
"delivery_count": 500
},
"match_by_name": [
"Mediterranean Baked Veggies", "Speedy Steak Fajitas", "Tex-Mex Tilapia"
]
}