Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit


Assignment – Python Skills Interview

Overview: 

In this assignment, you will be provided with raw data containing stock holdings (quantity of shares) in four hypothetical trading inventories (Book 1-4) with respective prices. Data is available in two formats: 1) excel file 2) json file.  You are asked to create a small tool using Python to help visualize the total Mark-To-Market values of stock holdings.

1. 3 results are required:

a. "Mark-To-Market" aggregated by inventory

b. "Mark-To-Market" aggregated by sector

c. "Mark-To-Market" aggregated by Stock (use "simpleTicker")

2. "Mark-To-Market" = last price * quantity of shares

3. Data processing should be Python based; excel vlookup / aggregation etc. will be considered as failing the task

Evaluation:

There are several ways to complete this assignment; each is associated with a different level of proficiency as outlined in the Guidance Table below. Feel free to use any resource for self-learning and please note the task should be completed with your own effort as you will be asked to present your final work during the interview.

Evaluation Category

Leve of Proficiency

Basic

Intermediate

Advanced

Data Source

Excel file

Json files

Being able to retrieve market data from public source (i.e., Yahoo Finance API 2022-10-21 last price)

Data Processing

Panda library

Panda library

Process data using list comprehension

Data Display

CSV / Excel based output (3 separate spreadsheets for the 3 results correspondingly)

Create functions to facilitate different data aggregation, i.e., look up function for specific ticker

Fancy visualization i.e., tree map, charts, graphs (sample reference link  - you can use block size and color shading to demonstrate the magnitude of total "Mark-To-Market")

You will be measured based on the following criteria:

1. Successfully complete the task with no errors.

2. Level of proficiency demonstrated for the above categories. i.e., Basic level Data Source usage with Advanced Data Processing will score higher than Basic level on both categories.

3. Final presentation / display of the data as well as the neatness of the code structures.

4. Communication and presentation skills on the walkthrough of the final output.

Dataset:

 

Fields

Description

instrumentCode

Unique identifier for each stock

bloomberg

Bloomberg ID for each stock

simpleTicker

Naming convention 1 for each stock

shortTicker

Naming convention 2 for each stock

Sector

Sector for each stock

Inventory

Trading book names

Holdings

Quantity of shares

last

Last price as of 2022-10-21

Additional Notes:

1. Jupyter Notebook is recommended.

2. If you decide to retrieve the "Price" data from Yahoo Finance API, you can find the documentation for "yfinance" (an open-sourced yahoo finance API) here: https://pypi.org/project/yfinance/.

3. Define functions or classes when necessary is a good practice to keep your code neat and clean, compared to writing the code line by line.

4. There are plotting libraries available to assist with heat map display. Plotly is a good option to explore.