真的!獨家! | 關於Quant/Trader求職分享(附真實試題)
標星★公眾號 愛你們 ♥
作者:辰 | 公眾號特約作者
近期原創文章:
♥ 基於無監督學習的期權定價異常檢測(程式碼+資料)
♥ 5種機器學習演算法在預測股價的應用(程式碼+資料)
♥ 深入研讀:利用Twitter情緒去預測股市
♥ Two Sigma用新聞來預測股價走勢,帶你吊打Kaggle
♥ 利用深度學習最新前沿預測股價走勢
♥ 一位資料科學PhD眼中的演算法交易
♥ 基於RNN和LSTM的股市預測方法
♥ 人工智慧『AI』應用演算法交易,7個必踩的坑!
♥ 神經網路在演算法交易上的應用系列(一)
♥ 預測股市 | 如何避免p-Hacking,為什麼你要看漲?
♥ 如何鑑別那些用深度學習預測股價的花哨模型?
♥ 優化強化學習Q-learning演算法進行股市
本文來自紐約大學金融數學2018級畢業的寬客,也是公眾號一位特別可愛的、特別nice的忠實粉絲 。為我們獨家分享關於Quant/Trader求職經驗,包括大神級的買方2 sigma一類。
真的很乾哦,也希望對大家在未來的求職中有所幫助!
從2018暑假接到第一個來自Jane Street的面試,我找工作這場仗,一直打到了2019的4月,終於簽了一個小quant shop的全職。持續一年多的生存之戰中,我面過大大小小一系列專項不同的崗位:traditional trader,marketmaker,quant trader,quant researcher(front desk & risk),甚至quant developer。從面試說話緊張結巴、一被問演算法題會矇蔽的狀態,(對方:Just start from brutal force solution.. then wecan talk about optimization)我逐漸學會了和電話線那一端的聽眾分享我的思路,甚至期待與面試官聊天(友道:“有面試是好事!”)。這個過程中,我不斷接到拒信不斷地碰壁,一次、兩次失敗的時候,我覺得不合適罷了,是一個一個的學習機會,沒什麼不自信的。次數多了,心理陰影面積也冪次數增長了。事後通常會反省自己,好抓住下一個機會:綠書還是沒好好掌握,說話應該要沉穩、語速放慢,簡歷就像分享故事一樣說出來。過程中學習的各種知識點多起來了,面試被問到的問題重複的概率也大了。
我面了~30來家買方賣方,整理部分問題出來。滿滿都是乾貨。
1. 基礎知識
買方賣方側重點不同。 比如賣方側重定價和結構化產品,買方會問機器學習和brainteaser 。概率都是重點。題目包括:stochastic calculus,統計題,regression,econometrics,finance包括options和對Black Scholes理解,portfolio management,machinelearning等等方面。大多從綠書,150題和glassdoor上可以找到。
2. 簡歷
第一個實習經歷特別重要。跟面試官說的時候,先是big picture first:做了什麼,為什麼做這個project(model),解釋模型的input output,最後公司怎麼用這個模型。還有深入的細節,比如建模型時候遇到什麼困難,怎麼克服的,處理了什麼資料。最好說說business和technical上遇到的挑戰、具體的例子。
3. Project涉及的理論知識和業界理解
比如monte carlo simulation的variancereduction techniques,具體應該怎麼做;SABR怎麼調參的,資料是什麼,還有SABR 怎麼運用在金融產品中。準備時候多問問自己為什麼,為什麼這麼做/涉及到的model的優劣勢一類的。
4. 和麵試官的溝通真的非常非常重要
他從中可以瞭解你的性格,是不是一個好的,他喜歡的合作伙伴,想問題時候是不是思維敏捷,說話是不是有條理,能不能把他說懂(口頭表達能力),以及對業界的瞭解(是不是有熱情真想幹這行)。Behavioral喜歡問職業規劃和teamwork。
平等交流最重要,你也在面試這家公司,看企業文化、崗位、同事合不合得來。
5. Interview的功利性刷題和實際的功力有不同
比如針對性地學習 “ Python面試大全“,“Java常見面試題”的概念,和刷常問的演算法(二分,sort search,資料結構常問題)。可能並不能真正體現程式設計能力。但面試官測試你能力,也只能用這種應試方式。綠書可以面試前兩天狂刷刷,很多還靠平時積累,比如怎麼處理資料的問題。我主要針對綠書涉及的知識點,上google搜資料,補充學習。比如一些小的知識點decompose matrix和uniform random variable transform 到normalrandom variable。
6. 臨場發揮很重要
問到接觸過、掌握的東西,和麵試官正好聊的來,他想找你這樣的人,就是運氣好。有的trading firm,和HR聊的很好。他說“get back to you”,卻一直沒get回來。這時候我就給自己分析原因。很可能有更合適的人,比如本科畢業背景更好有交易經驗的,或者校友內推,並不一定是自己的個人問題。而當遇到知識點盲區,我覺得謙虛和展現有一定的基礎都很重要。
比如和Barclays聊天,面試官問到我有沒有用過KB test BP test,是用來測試homoskedasticity的,我反應說不太有印象,但在R package裡曾經用過;後面她提及logistic model,我說我學過,是binary classification model,是判斷0和1的,這時面試官說嚴格的說,你要是學過logistic model,就知道output是(0,1),而不是0、1。我說對,你說的對,我的意思是這個模型判斷是0、1,但區間是在(0,1)之間。這時我感覺到我們之間聊天就不是很融洽,我當時的態度是不想犯錯誤,但真誠度和謙遜程度在面試官看來可能就不夠了。Candidates眾多的情況下,她就傾向於回答滿分、同時聊天也其樂融融的candidate。
JaneStreet: Operation(career ladder up to trader)
Five coin tosses, the probability that you get three headsupward?
Forall numbers from 1-100, how many 9s are there in tens and digits?
時鐘夾角問題
簡歷: machine learning
DRW: Quantitative Researcher
綠書的籃球問題,綠書上Markov Chain的問題,feature selection(特徵工程,與簡歷有關)
GroupOne Trading: Junior Trader (NYU on campus)
先是一輪速算,包括二位數乘法,小數加減等等。
Introduction, Why group one, why trader, hobby, firstinternship experience, what if that company gives you offer?
Radix Trading: Quantitative Research(onsite)
Twocoding questions: 簡歷上概念(比如VaR),leetcode的題目
Given a collection of boxes, find the biggest chain of them thatcan be nested one inside another in order.
找一個array中最大和最小值
SIG: Trader
Introduction, Whysig
Background: GPA,GRE
What do you valuethe most in your job?
First Internshipexperience, hobby, strategies game
Optiver: Trader(passedtest, phone screening: 說話抖音了)
First internship experience, introduction, what if give youreturn offer? Why optiver? Why trading? Teamwork and how you split the work?
FlowsTrader: Trader(passedtest, phone screening)
Internship experiences, What courses take, hobby, why flowstrader(how did you know), challenge, enjoy pressure environment? Receivecriticism and improve?
HudsonRiver Trading: Quant Researcher
Monte Carlo simulation tech: antithetic variates
Statistics problems: toss a coin for 1000 times, what is the probability that 600heads upward?
…..記不清題目了
Crossriver bank: Quantitative Researcher
Transition matrix,how to perform decomposition
ABS的問題,關於poolingand tranche
Bond:duration meaning,convexity,which one influenced by small change of interest rate more?
Bermuda: Quantitative Researcher
Explain greeks, swaps, monte carlo simulation
linear regression, ols, mle and Bayseian
MIO: Trader
HR經典問題,GPA,why MIO,do you follow the market:30 year bond yield?
CBOE(Onsite@NYC)
Options:
UseMonte Carlo Simulation:
Application:
I think in theindustry, for option pricing people tend to use the numerical method: MonteCarlo simulation. It’s good for high-dimension. For path-dependent’s exoticoptions and multiasset options, it is effective. In monte carlo, pathssimulated are independent and can be calculated using multithreading, so it canproduce precise results.
The other model: Black Scholes model has a weakness ofconstant volatility. It assumes the volatility to be constant, and there is nojump in the asset price, which is not so realistic. It also cannot captureearly exercise feature of American style option, so BS is better used forEuropean style options and American options that will be not early exercised (like All Ordinaries Share Price Index options on futures, because of its marginrequirement and non-dividend paying).
BS gives a goodway for getting implied vol, and Greeks for hedging: e.g. a delta neutralportfolio.
Inreality,price of options are determined by demand and supply under no-arbitrageconditions, (also influenced by implied vol). Models are a way for prediction,and can be adjusted according to historical data.
Futures: describe a trading strategy
1 million Futurestrading strategy:
As I mentioned, Iwill look at the term structure offutures and market conditions(contango or backwardation). I would like to do acalendar rolling strategy.
I would like tolong VIX futures when prices are low because VIX usually has a bottom of howlow it can be, but there is no limitation of how high it can be(even though itcan not stay long at high level):
For the calendar rolling strategy, Irebalance the strategy at the end of each month to sell to open thesecond-month contract and buy to close the position at the end of next month. Ican size VIX futures strategy to have equity like volatility with -100 basispoints of vega notional per dollar of capital( = -10 contracts for every$1,000,000 of capital).
I can also holdthe first-month contract and rolls its intra-month and rebalanced only atmonth-end to target the desired vega notional.
If multiplefutures are allowed in my portfolio, I can use VXX(two month VIX futures) andVIX futures for long and short.
I can also short UVXY and short SPX for hedging.In history, there is a negative correlation between VIX futures and returns ofSP500. The issue is VIX index and SPX index is not linearly related. When Ishort UVXY, and when UVXY goes up high, I probably need to short large amountsof SP500 to cover loss.
Howdid you calibrate SABR?
Makingproducts with SABR:
It is a stochasticvolatility model and can fit the volatility smile. It expressed the impliedvolatility in terms of the model’s parameters. So the model is more consistentwith entire volatility surface.
Howto imbed it into pricing: gives different volatilities fordifferent maturities, so it can be used to fit to the volatility smile foroptions with different maturities.
Practitionerscan buy SABR model: give them the flexibility to useintuition regarding market dynamics. Financial institutions can manage risksentailed by positions in derivatives. It treats Vol as a function of time, sopeople can use the model to know the vol smile and skew for options withdifferent maturities. as I mentioned, I think it has tractable pricing abilityto capture the correct shape of the smile and dynamic of the vol smile(assetprice is not log-normal distributed as assumed. So the model can capture thefat tail of the distribution, and the probability of people exercising OTM andITM options, so the pricing of options at the both end can be more accurate ).
CalibrationSABR:
(Spline mentioned in the interview: I guess itis a way to get linear interpolation between calculated volatilities?)
In my project, Iused market data for EURUSD from 15-Jan-2016. ATM: delta-neutral straddle,market RR and BF, the spot rate is 1.1 USD per EUR. Use a constant USD interestrate of 0.4%.
Given a fixedvalue of Beta, changing other parameters will yield different option valuesacross different tenors/expired and across different valuation dates.
Basically Iminimized the error between points as observed implied volatilities and thepoints that are fitted by SAR model for corresponding strikes. I pre-determinedbeta, that depend on a priori belief about the forward process, and set beta tobe 0.5. So the volatility term is multiplied by the square root of the currentlevel of forward(stochastic CIR model).
Then I estimatealpha, rho and vega use Newton-Raphson method by minimizing errors(volatilitiesare calculated using Hetson model).
VIXproducts:
VIX futuresprovide clean exposure to future implied volatility of SP 500.
Short volatilityon SP 500 has a positive risk premium, as implied volatility has a strongtendency to be higher than realized volatility. I think some products includinginverse volatility ETFs are very interesting, such as SVXY, VMIN and ZIV.
I mentionednotional in our conversation, and I noticed mini-VIX futures has a veganotional of 100 but it currently traded with very little volume compared withthe bigger contract.
JPMorgan machine learning(Test):
-
揹包硬幣問題
-
JP JavaDeveloper(passed first round, onsite):
-
Google到的java的面試題,資料結構
-
Stringbuilder,stringbuffer
-
Swap two elements(綠書)
-
Private constructor怎麼call object
-
Detect circular linkedlist
-
Final finally finalize
-
Multithreading多執行緒保證安全性
-
怎麼讓class static,解釋staticfunction
-
Decorator pattern
-
Overload
-
Immutable的資料結構
-
Generic
MSCI
Give you ten yearsof equity prices, how to analyze the data? Give specific steps.
Time seriesanalysis.
Probability ofarranging 26 letters so that letters x, y, z is in this order but not need tobe consecutive.
Career ladder: What quant:price quant, trader?
What kind of Person:science person or art person?
2sigma data analysis
Fivenormal standard random variables, any two of them has the same correlation, sowe want to know the range of the correlation?
Answer: The problem can be solved using the positivesemidefiniteness property of the correlation matrix.
Let thecorrelation between x1, x2; x1, x3; x1, x4…. be .
Thenthe correlation matrix for x1, x2, x3, x4, x5 is
M =
Add allthe rest columns to the first column to get M1, which has the same determinantas M:
M1 =
Det(M1)=(
M2 =
Subtractthe first row from the rest of rows:
M3=
Thendet(M3) =
Det(M2)= det(M3)=
Det(M1)=(1+4)
So 1+4
When1+4
So theminimum is -0.25.
Also,any principal submatrix of M is semipositive definite:
1-,(1+3), (1+2), (1+)
So,-0.25
Twotime series daily return, we calculated annual correlation, which is positive;and their monthly correlation. Is it possible for all monthly correlationnegative?
Yes.
If wedefine the monthly correlation as the correlation between monthly returns, notaccumulated returns between each day returns in a month.
Consider:
where is the sum of month return(annual return), and is the sum of month return(annual return).
= >0
Consideran example, x1 = 10%, y1 = -20%; x2= -5%, y2 = 10%; x3 = 4%, y3 = -6%; x4 = -3%, y4 = 5%; x5=-2%, y5 = 12% ...x1, y1; x2, y2; x3, y3; x4, y4, and x5, y5 are negativelycorrelated,
X6 =-2%, y6 = 5%; x7= 1%, y7 = -5%; x8= 3%,y8= -4%; x9= 5%, y9 = 3%; x10 =-2%, y10 =
3%...x1, y1; x2, y2; x3, y3; x4, y4, and x5, y5 are negatively correlated but
X =(X1,X2) and Y=(Y1, Y2) are positively correlated.
The same argumentholds for 12 month. It is possible for pairwise returns to be negativelycorrelated for each individual months, but in annual terms, the totalcovariance to be positive (the denominator should be positive) and socorrelation to be positive.
Hong Kong Symmetry Investments
Projects, numerical methods, programming
Monte carlo simulation
Expected payoff of options iscalculated by taking average of these payoffs at the maturity date, thendiscounted back to present.
Three interfaces:
One receives uniform randomvariables from random variable generator and changes it to normal random variables.
One receives the normal randomvariable, and returns a path(make it more generic, not to stick with the GBMassumption in this project).
One for payouts: receives a stockpath, and returns a payout for the option (for Vanilla and for Asian options).
Importance sampling: (change ofmeasure): is use to estimate properties of aparticular distribution, h(x) To get E(h(x)), not draw x from the distributionof interest f(x), but draw x from g(x) and estimate E(ℎ( ) ( ) ( )).
In our example, for out of themoney European call option with strike price K and maturity T. If we samplevalues for the underlying asset price at T in the usual way, most paths willlead to zero payoff.
Research done on NumericalMethod for many parameters:
I mentioned Powell method, which isa bi-directional line search along each search vector.
For n search vectors, we passed aninitial point x0, and ai is the scalar determined during search along eachsearch vector. The update x with 1= 0+Σ =1, and Σ =1 is a new search vector added to the original n search vectors.The search vector that contributes the most to Σ =1 delete from the original list. The algo iterates until noimprovement is done.
Other root finding algos includebisection method, Brent’s method, secant method and inverse quadraticinterpolation. I think in industry, people use secant method a lot:
Let 0= ( 1)− ( 2) 1− 0( − 1)+ ( 1)
Solution is: = −1− ( −1) −1− −2 ( −1)− ( −2)
Other numerical methods to minimizethe function (such as the difference between the real value and estimated valueas a function of parameters ) including descent algorithm, linear search,second order optimization methods including Newton’s method, quasi-newtonmethod(which updates the approximation to the Hessian, I think it is lessexpensive to compute this way for many parameters),
Programming challenges:
A perfect number is defined as: n = 3+ 3= 3+ 3
Prime numbers in arange
UBS:
Futures andforward
Programming: adataframe with a colume called “a”, now want to use method and lambda functionto let every element of column “a” plus 1.
What is OOP? Datastructure: list and arraylist
What’s binarysearch and it’s time cost
If the underlyingstocks have dividends, impact on future price?
Wienner processand usefulness in finance.
Useof Brownian motion:
可以根據W(t)構造martingale(鞅),比如是個鞅。根據鞅的停時定律,判斷W(t)是那麼時候達到一定的值. 它是一個股價模型中的random source, 在資產定價基本定理中可運用,當股價是一個布朗運動,存在一個獨特的風險中性測度。這個市場理論上沒有套利活動。
一維布朗運動走勢和價格曲線走勢相似,在任意長度為t是分佈均值為0方差為t的正態分佈。當前值包含對未來做預測所需要的全部資訊。
1. 軌跡穿越時間軸t。
2. B(t)不會偏離B(0)+-
3.M(t) 為0到t的布朗運動最大值,M(t)不小於任意值等於B(t)不小於任意值概率的兩倍。可以量化股價極值的概率分佈。
4. 連續不可微分。
1.2:股價很大概率在開盤價上下波動,隨著交易時間推移,在t時刻股票價格不會偏離開盤價+-*價格波動標準差。
幾何布朗運動:
股票價格的連續複利收益率近似服從正態分佈。走勢主要由漂移向控制,即在慢牛中我們可以考慮價值投資,長期持股。衍生品價格,是股票價格的函式,可利用伊藤引理來定價。
股票可以用布朗運動描述,衍生品價格是隨機過程的函式.
Optimization:
在mean-variance optimization中運用,常用線性代數進行矩陣分解(市場的協方差矩陣)。
Optimization還包括了一些iterative methods,比如EM algorithm,gradient descent
Difference betweenR^2 and adjust R^2
Avoid overfittingin machine learning? Validation set
Pick top largest100 stocks in SP, use 30-year historical data to get alpha, is it good to tradealpha?
100 data pointsfor regression, if replicate 100 data points and use this 200 for regression,what’s difference between results?
What’s meanvariance optimization? If we have 100 stocks, given a specified risk level, howto construct the portfolio to maximize the return?
Machine learningproject, linear products: delta one
Future and forward prices: 期貨高於現貨,市場狀況是期貨升水和現貨貼水(contango),應該是市場預期有關。是各期貨投機者之問相互對賭的結果,像我們討論的套利機會不會存在很久,因為套利很快讓價格均衡。做空期貨賣開倉只有在買家看漲的情況下願意簽訂合約,不容易借到,期貨價格和現貨價格差別我覺得還跟場上參與者、莊家控制走勢有關。另外期貨和現貨兩者的關係還依賴於股指本身和市場上的利息變動。
Citiphone
1. Girsanov theorem
Whychange of measure
Risk
How toprice options, etc.
2. F-K equation
3. Forward measure
4. Ways to get BS differential equations(riskneutral and heat equation)
5. Quadratic variation
6. Dynamic binding
7. Shallow copy deep copy
8. Monte carlo variance reduction
9. Finite difference methods
Dynamic binding. Itmeans the codes that will be executed with reference to a method call is onlyknown during running time. When multiple classes contain differentimplementations of same method, a function will be selected from multiplefunction alternatives. In java, we usually declares object and in cpp we usevirtual function.
I have used it in method overriding--inpricing options with Monte Carlo simulation, I built a class for Europeanoptions by extending a payOff interface with a Price function. I wrote thePrice function differently with certain formula in the European options class.Later when I want to get the price of European options at a certain time, thefunction in European option class will be called. Doing so allows me to pricedifferent types of options with different payoff functions.
Citi Onsite
FX:interest rate parity
Currencyconversion
Decideforeign exchange rate
Python: List and tuple
Multithreading
Seed: setthe initial integer value at the start of algorithm that generates randomnumbers. Once set, we can generate the same random numbers each time. If notset, then the system will choose the value automatically and so random numberswill be different based on different times.
Static:non-access modifier in java for blocks, variables, methods, and nested classes.It means there will be only one instance of that object in the class. When avariable is static, it is a class variable, and gets memory only once in theclass area at the time of class loading. If any object changes the value of thevariable, it will retain its value. Similarly, a static method belongs to theclass rather than the object of a class, can access static data member and canchange the value of it.
VaR
Put call parity
Implied vol andwhy
Martingale, superand submartingale
Statistics:you toss a dice,initial have $2, gets 6 can toss again, gets other numbers lose money, how muchare you willing to toss?
Socks: pigeon holequestion.
Taylor expansion:
Finra:
Euclidean distanceand manhattan
Lasso and ridgeregression
Decision Tree
Logisticregression
kaggle
Axioma: Client Supportrole(Quantitative Financial Solutions).
Replicateportfolio, and report
Factor models andoptimization
Chicago Trading Company
Behavioralquestions:
Solve challengesin a team
Conflict withteammates
OOPin python:
Inheritance:subclass inherits superclass, as I mentioned in our conversation that overridea method can be an example. Subclass use methods of superclass and makemodifications of it to behave differently.
There are alsopolymorphism and encapsulation. For encapsulation, we can restrict access tomethods and variables. In my projects in java, I have built private, public andprotected classes; in python, I used underscore such as single “_” or double“__”.
For polymorphism,I used classes to implement interfaces.
Mergetwo files with keys
Listand tuple, when to use
Generatorand example
Largedataset read and shut down
Environmentof python, problem using the notebook
Readtype of data except for csv
Problemwhen output files are messy
Packagesin python, numpy, pandas, Dataframe
Sqlin python
Whento use np array and dataframe
Decorator:wrapper
老東家(不透露名字了)
Internship:machine learning
Stochasticgradient descent v.s. gradient descent
KKN, Kmeans, PCAprinciple
Linear regressionand assumptions
Monte Carlosimulation: accuracy
VAR: three waysand disadvantages and advantages
Statistics方面:
Poisson process,exponential distribution
conditionalvariance and variance
GARCH, ARCH
homoskedasticity
autoregression
jointdistribution: p(x,y) = kxy, x can be 1, 2, 3, and y can be 1, 2, 3, P(x +y)>=5
Sharpe ratio
Binomial tree
和Trader 聊天:
Introduction,internship: how markov chain works, many states: initial values S andindependent transient probability
Implementation ofmodel for SVM: what if price goes up 10bps many times, but ends up the day at -30bps
Options:American options and European options; values of American options always largerthan European options, never early exercise options: intrinsic values + timevalues
When will you exerciseAmerican options early
Convexity: mu E(X)> E(mu X)
Straddle: what isthat?
Statistics: howlong it decays, how many lasers decay in a certain time period use what models
Expectation ofrolling a die and get values on it. Roll it twice and roll it three times
Number of rolls toget HH (犯了弱智錯誤,少了一個state,給了hint,很快反應過來),HHH… distributionof times of rolling(exponential distribution).
Brainteasers(反應迅速很重要,感謝我有段時間狂練二位數乘法)
0’s in 100!,depends on # of 5(我說:我可以寫個algo嗎,trader:comeon,you don’t evenneed a paper)
0‘s in 800!
Drop eggs(150題)
請給小姐姐打賞吧!
—End—
量化投資與機器學習微信公眾號,是業內垂直於 Quant 、 MFE 、 CST 等專業的主流自媒體。公眾號擁有來自 公募、私募、券商、銀行、海外 等眾多圈內 10W+ 關注者。每日釋出行業前沿研究成果和最新資訊。