No description
Find a file
2024-07-19 01:11:03 +02:00
.woodpecker ci: Deploy stage removed 2024-07-15 23:01:42 +02:00
schema fix: Entry renamed to Average 2024-07-18 02:36:59 +02:00
src fix: Map key comparison, preventing NPE 2024-07-19 01:11:03 +02:00
util feat: File processing. 2024-07-18 02:51:32 +02:00
.editorconfig Initial commit 2024-07-15 22:13:45 +02:00
.gitattributes Initial commit 2024-07-15 22:13:45 +02:00
.gitignore feat: DataProperties 2024-07-16 22:34:22 +02:00
example_file.csv docs: Readme & example 2024-07-15 22:51:05 +02:00
pom.xml feat: Schema 2024-07-15 23:33:57 +02:00
readme.md feat: DataProperties 2024-07-16 22:34:22 +02:00

Large file reading challenge

Welcome in the recruitment challenge. Write an application that, at the endpoint specified by you, returns the yearly average temperatures for a given city in the format array of objects with the following fields: year, averageTemperature.

Assumptions

  • CSV file with data is no less than 3GB in size.
  • The file represents temperature measurements in the format city;yyyy-mm-dd HH:mm:ss.SSS;temp
  • The content of the source file may change during the application's running

Example source file

example_file.csv

Response

Schema

response_schema

Example

[
    {
        "year": "2021",
        "averageTemperature": 12.1
    },
    {
        "year": "2022",
        "averageTemperature": 11.1
    },
    {
        "year": "2023",
        "averageTemperature": 14.1
    }
]

Configuration

property description default
data.file-url path to file with temperatures data/temperatures.csv

Usage

Temperature statistics endpoint: /api/temperatures/{city} Returns HTTP 200 when city is found, 404 otherwise.