0% found this document useful (0 votes)
6 views3 pages

Updated Quant Assignment

Uploaded by

Sagar Kadam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Updated Quant Assignment

Uploaded by

Sagar Kadam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Quant Assignment

Instructions:

 Duration: 30 minutes
 The set of questions below is expected to be completed in 30 min. Try to keep
the answers brief & concise.
 For Coding Questions, more memory & time efficient solutions are preferred. The
coding language is Python.

Attempt any two Python Questions out of the given four questions. The rest of the
questions are mandatory.

Python Questions:

1) What would be the most optimum way to create a Fibonacci Sequence of


length “n” (Basic definition: The first two numbers of this series are 0 & 1.
Subsequent numbers in the series would be the sum of the last two elements
of the series. E.g.: 0,1,1,2,3,5,8,13,21…….) in Python? How would you code
it?

2) You are given two string variables a1 and a2. Your task is to find the length of
the longest common substring amongst the given strings. E.g.

Input: a1 = "ABCDGH”; a2 = "ACDGHR";


Output: 4
Explanation: The longest common substring is "CDGH" with a length of 4.

3) “IBM/GOLDMAN/MORGAN STANLEY/CREDIT SUISSE/SHEARSON LOEB


RHODES”
“EBAY/GOLDMAN/DLJ”
“CSCO/MORGAN STANLEY/SHEARSON LEHMAN/CREDIT SUISSE”
“YHOO/CREDIT SUISSE/MORGAN STANLEY/DLJ/GOLDMAN/PAINE WEBBER”
“FLR/PAINE WEBBER”

The above text resides in a file called tickers.txt. It contains a ticker


(Company Symbol) followed by a sequence of the company’s brokers. Write
code that reads in the text file and produces the following dataframe:

TICKER BROKER
CSCO MORGAN STANLEY
CSCO SHEARSON LEHMAN
CSCO CREDIT SUISSE
EBAY GOLDMAN
EBAY DLJ
FLR PAINE WEBBER
IBM GOLDMAN
IBM MORGAN STANLEY
IBM CREDIT SUISSE
IBM SHEARSON LOEB RHODES
YHOO CREDIT SUISSE
YHOO MORGAN STANLEY
YHOO DLJ
YHOO GOLDMAN
YHOO PAINE WEBBER

4) Below we have the current year monthly returns for France and United
Kingdom in a dataframe (“Initial_df”). Calculate the yearly Cumulative
Returns for each country and store it in a dataframe (“Final_df”). The format
& values of the output should match with “Final_df” dataframe given below.
Note: a) The returns should be compounded geometrically by taking (1+Rt)-1.
b) The “Obs” & “Year_Month” columns are of “int” type.
c) The “Monthly Return” & “Country” columns are of “str” type.
d) The bracket indicates negative. E.g., A monthly return of “(3.26%)” indicates -
3.26% return for that month.

Initial_df:

Year_Mo Count Monthly


Obs nth ry Return
1 200301 FR (3.26%)
2 200302 FR (5.31%)
3 200303 FR (4.14%)
4 200304 FR 12.48%
5 200305 FR 2.29%
6 200306 FR 2.48%
7 200301 UK (8.98%)
8 200302 UK 2.47%
9 200303 UK (0.92%)
10 200304 UK 9.33%
11 200305 UK 3.99%
12 200306 UK 0.17%

Final_df:

Year-to-Date
Obs. Country Return
1 FR 3.54%
2 UK 5.24%
Quant, Statistics & Portfolio Questions:

5) Could you briefly explain the cause of the collapse of Credit Suisse?

6) Let’s say you have a dataset(ordinal) with large outliers. How would you
handle them & what type of ML models can be used?

7) Let’s say a time series dataset has seasonality in it, how would you address it
and what type of time series models would you use?

8) Let’s say you have a Markowitz Portfolio setup, and have plotted the Returns
& Risk (Variance) in a graph y(Risk) vs x(Return) of multiple portfolios (in
another words, you have an Efficient Frontier), how would you pick the most
optimum portfolio (Assume that you know the risk-free rate)?

9) Define the factors of the Fama-French 3-Factor Model.

10) Explain why the Value factor is generally used to mitigate risks derived
from the Momentum factor. Explain by fundamentally explaining both the
factors and how these two factors operate in different market conditions.

You might also like