As the next step in the interview process for the Software Engineer job at Reel, we will ask you to complete this project. We will use your solution to the project to get a better understanding of your technical abilities and how you approach a technical challenge. Your solution will also be the starting point for our subsequent technical interview. The project is intended to be a small representation of the kind of work we do at Reel.
We receive electricity consumption data in a json format from a third party source. This data is used on our platform to analyse consumption patterns and to help companies get a better understanding of the emissions related to their consumption. To map this data to our internal consumption data format, we need a parser. Your task is to write this parser, as specified in the next section.
We have set up this project and written a few helper functions so you can focus on developing the parser itself.
We expect the project to take 2-3 hours to complete. You are always more than welcome to reach out to us if something needs clarification.
The function parse/1 is defined in the Parser module at 'lib/parser.ex'. A sample of json consumption data is read and passed to parse/1 by the existing helper functions. The data contains hourly consumption readings from a single metering point for a 48 hour period. You can inspect the sample data at 'data/consumption_data.json'.
We want you to write the code to parse the sample data provided to this function. The parse/1 function is just a starting point - you can add functions and/or modules as you wish.
The output of the parse/1 function needs to contain the 48 consumption readings from the sample data in the following format:
[
%{
quantity: 0.1,
metering_point_id: "927613927390263674",
interval_start: "2021-12-31T23:00:00Z",
interval_end: "2022-01-01T00:00:00Z"
},
%{
quantity: 0.08,
metering_point_id: "927613927390263674",
interval_start: "2022-01-01T00:00:00Z",
interval_end: "2022-01-01T01:00:00Z"
}
...
%{
quantity: 0.06,
metering_point_id: "927613927390263674",
interval_start: "2022-01-02T22:00:00Z",
interval_end: "2022-01-02T23:00:00Z"
}
]
Write tests in 'test/parser_test.exs'. Write as many or as few tests as you see fit to make you feel comfortable in the correctness of your solution. However, we only expect you to test the parser itself.
Write a short (1200 characters max) explanation of how your solution works and why you chose that particular solution.
- Make sure you have Elixir installed (see https://elixir-lang.org/install.html)
- Start an iex session (interactive Elixir shell)
$ iex -S mix
- Call the
run/0function from within the iex sessioniex> Parser.run()
- Run your tests
$ mix test
- Clone this repository locally
- Create and switch to a local branch for development
- Develop your solution
- Once you're done, create zip of the main folder an name it
<your_name>.zip - Send the following to [email protected]
- The zip file
- The description of your solution in pdf or md format
We focus on three main points in our evaluation:
- The output of the
parse/1function is correct. That is, the timestamps, quantity, and metering_point_id of each consumption reading matches the corresponding reading in the input data. Further, the format of the output is as described in the previous section. - How you solved the task. There are many ways to approach a task like this.
- Your reasoning about choosing this solution.