This take-home assessment is designed to gauge your proficiency in Python and programming, as these are key aspects of OilDesk Intern role. The assessment consists of 4 questions, each increasing in complexity. Aim to answer as many as you can, and ensure that your code is clean, well-commented, and accompanied by explanations of your approach and reasoning.
- Python 3.11.X
- Jupyter Notebook
- Pandas
- SQLAlchemy or any other SQL toolkit
- Fork this repository to your GitHub account.
- Clone the forked repository and create a
solutions/
directory. - Answer the questions listed below in a Jupyter Notebook under the
solutions/
directory. - Ensure that all code is clean, well-commented, and accompanied by explanations of your approach and reasoning.
- Each question should be answered in a separate Jupyter Notebook.
- Any packages you use, MUST be added to the
requirements.txt
file - Push the completed Notebook back to your GitHub repository.
- Share the GitHub link with us by the deadline provided.
- You are free to use any Python libraries you wish, the requirements above are purely a suggestion.
- You may find it useful to create an SQLITE database to store the data for the SQL questions. (Do not commit the database file!)
Objective: Demonstrate basic Python skills and data manipulation using Pandas.
Task:
- Load a given CSV file containing metal prices into a Pandas DataFrame.
- Filter the data to include only 'Copper' and 'Zinc' for the year 2021.
- Calculate the average price per month for each metal and plot it.
Objective: Basic SQL Server interactions.
Task:
- Create an SQL table schema to store time-series metal prices. Include fields like
Date
,Metal
,Price
. - Demonstrate basic CRUD operations
Objective: Show understanding of creating data pipelines and transformations.
Task:
-
Using the CSV file from Question 1, filter the data to include only 'Copper' and 'Zinc' for the year 2020 & 2021.
-
Calculate MACD (slow/medium/fast) and RSI for each metal historically.
-
Use SQL inserts to populate the SQL table created in Question 2 with this generated data.
-
Demonstrate the use of a decorator to log the execution of the SQL inserts.
Objective: Demonstrate understanding of how to implement and backtest a trading strategy.
- Backtest either: RSI or MACD strategies .
- Show PnL, annualised sharpe ratio, and drawdown over time.
- Make your code as effieicent (vectorized) as possible.
- Modify Question 3 to write data to the database asynchronously .
- Read from the database 5 times concurrantly using async (hint:
asyncio.gather()
)
- Ensure that all code is clean, well-commented, and accompanied by explanations of your approach and reasoning.
- Make your git commit history make sense.
- Commit your Jupyter Notebook and any auxiliary files to your forked GitHub repository.
- Submit the GitHub repository URL through email, to rkhanna@hartreepartners.com , by the deadline provided.
Good luck!