---
# System prepended metadata

title: Test exercise for O.Dev internship
tags: [Internship, Django, O.dev, Docker, REST API, Python]

---

# Test exercise for O.Dev internship

###### tags: `O.dev`, `Django`, `Python`, `REST API`, `Docker`, `Internship`

[ToC]
#### Stack
* Python 3.7.6
* Django 2.2
* PostgreSQL 11
* Redis/Memcached
* Swagger/ReDoc

#### Task description
* Familiar yourself with service for foreign exchange rates: https://exchangeratesapi.io/
* Create REST API with Django to get different metrics on the window (range) of data
* Metrics:
    * Standard deviation
    * Average value
    * Correlation between two currency pairs in the same period
    * You are welcome to suggest your own metrics
* Example:
    * Request: **GET `.../api/start_at=2018-01-01&end_at=2018-09-01&base=USD HTTP/1.1`**
    * Response:
```jsonld=
{
    'RUS': {
        'std_dev': ...,
        'avg': ...,
    },
    'EUR': {...},
    ...
}
```
#### Requirements
* You are fully free on how to design your REST interface (endpoints, GET parameters, response etc.)
* You should use suggested stack
* You should pack all your infrastructure in docker-compose with purpose I can easily deploy it on any UNIX-system just types `docker-compose up --build`
* You should use cache (with Redis or Memcached) to decrease the number of request to external service
* You should provide the specification of your REST API using OpenAPI 3.0 standard. You can use ReDoc or Swagger
* Upload your solution on GitHub/GitLab (including `.env` file)
* Keep calm if are not able to perform one of the points it is ok, but try to do as more as possible


#### Deadline
23:59, Saturday, 25 April 2020