• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Quantitative Interview questions and answers

Andy,
Do you know the answer to this? Its been quite a while and I do not think I have been able to make much progress... answer please
I know the answer now, of course. When I was asked the question then, I tried everything but couldn't get the answer.
If you live in New York City and don't own a car, you probably will know the answer. That's the hint.
 
I know the answer now, of course. When I was asked the question then, I tried everything but couldn't get the answer.
If you live in New York City and don't own a car, you probably will know the answer. That's the hint.
Aha, I found a wonderful link, thanks to this problem. It seems as if over a million integer sequences are stored in the Sloane Encyclopedia (link:http://www.research.att.com/~njas/sequences/) and if you give it a subset it will give the entire sequence with the accompanying reason. As expected 183,... didn't yield any result. So I guess the sequence is not a mathematically significant subset of a seqn.
 
for that A = M*M thing,
observe that A is real symmetric. with 8, 2 as its eigenvalues.
so A is unitarily diagonalizable.
i.e. A = UDU* for diagonal matrix ({8,0},{0,2})
Now, M = U (root D) U* = U ({root 8, 0} , {0 , root 2}) U *
works!
 
the dice and the liar question is as follows

the prob it is a 6 and he is telling the truth is (1/6)*(3/4)
the prob it is not a 6 and he is lying that it is a 6 is (5/6)*(1/4)*(1/5)
where the 5/6 is not a 6, 1/4 is prob he's lying, and 1/5 is for since we know he's lying, he has 5 #s to choose from, and he chooses 6 (assuming he lies about each # the same % of the time)

add these two independent events together to get a final prob of 1/6
 
I would agree with nbz's answer.


shoot, I misinterpreted the question. I agree with nbz's approach, but not the denominator.

"Given he told us it's a 6" drives the denominator (all the times he would tell us it's a 6)

that is 3/4*1/6 + 1/4*5/6*1/5

3/4*1/6 I think we all agree on

the second part is when would he lie to us that it's a 6. that's 1/4 of the time he's lying, 5/6 of the time it's not a 6, and then he has to choose to lie to us that it's a 6 which is 1/5 of those times

the numerator is 3/4*1/6

this all reduces to a final answer of 3/4

thoughts?
 
Here's a list of programming questions from a quantitative prop trading company in London. Credit for VNQF
  1. Write a function to print the first N Fibonacci numbers
  2. You have an ordered, doubly-linked list. Write a function to insert a new, arbitrary element into the list, maintaining the order of the list. Assume the comparison operators “<” and “>” correctly compare elements of the list.
  3. How can you prevent deadlocks in a multi-threaded application?
  4. Describe the similarities and differences between blocking and asynchronous I/O.
  5. Given an array of 1002 numbers in the range of 1-1000 with two numbers duplicated, write pseudo-code with the following characteristic to determine the duplicate numbers (for clarity, there are two different numbers that appear twice in the array). It is fine to alter the array.
    • Optimized for speed
    • Optimized for memory
    • What is the efficiency of each of your two algorithms (Big-O notation)?
  6. On an analog clock, how many degrees are between the big hand and the little hand when the time is 5:15? At what point (to the nearest fraction of a minute) will the hands next meet?
  7. Write a function to print out the data in a binary tree, level by level, starting at the top.
  8. Write a function to determine if there is a cycle anywhere in a linked list.
  9. Describe the similarities and differences between TCP and UDP.
  10. There is a series of numbers in ascending order. All these numbers have the same number of binary 1s in them. Write a function f(m, n) that returns the nth number in the ascending series of numbers with m 1-bits set. For example, f(1, 2) is 2.
  11. Describe the similarities and differences between a “thread” and a “process”.
  12. Java: How are “synchronized”, “wait”, and “notify” used?
  13. Write a function to convert a string into a signed integer (not using library functions).
  14. Write a function to convert a signed integer into a string (not using library functions).
  15. Write pseudo-code to sort a file containing up to 10 million records where each record is a unique 7-digit integer.
  16. In general, how would you describe your own code?
 
Interesting questions. Just need to have some clarification:

Number 5, should I interprete this way: At the expirary, look at the history of the stock from the start of the contract, count number of times the stock crosses the $40 mark, Ncross. The payoff would be Ncross dollars?

Thanks.

1. (BOfA, ML) There are a cup of milk and a cup of water. Take one teaspoon of milk,
put into the water cup; mix well. Take one teaspoon of the mixture in the water cup and put into the milk cup then mix well.
Which is higher: the percentage of water in the milk cup or the percentage of milk in the water cup ?

2. (Barclays, ML) (W_t) is brownian motion. N is cdf of normal (N(0,1)). Calculate (E(N(W_t))).

3. (GS) There are 5 thieves numbered 1,..,5 trying to divide 100 gold coins using this algorithm: the number 1 will come up with a way to divide money, if there is more than 50% agreement among them about his method (including the dividing thief) then it's done. If not, then they will kill the first thief and the second thief will divide money coming up with his own method. If you are the first one, what method you will use to divide money ?

4. (SG) There is a cubic cheese 3x3x3. There is a rat eating this cheese in the following manner: it east a corner (1x1x1) of the cubic the first day. The next day, it will eat another 1x1x1 cell which has the same outer face as the one it eats the day before. Find an algorithm so that the rate can eat the center cell the last day.

5. (ML, LB, SG, Bear, DB) The today price of a certain stock is 20$. Here is an option: if the stock reaches 40$ then the payoff is 1$. Price this option.

6. (SG) (t < T). W is brownian motion. Calculate (E(W_T|W_t), E(W_t|W_T), E(W_t| |W_T| )) ((W_t) conditioning to the absolute value of (W_T))

7. (JPM) There are parallel lines with distance d lying on the same 2-D plane. There is a line segment with length l>d. Find probability that this line segment not crossing any other lines.

8. (ML) (T_1 < T_2). Pricing forward-start option (E(\frac{S_{T_2}}{S_{T_1}}-K)^{+})
 
Question number 13: What is the definition of max(x, y) over [0,1]x[0,1]? Is that just a constant 1. So max(x_1, x_2, ..., x_n) =1 over [0,1]x[0,1]x...x[0,1]. And so does min(x_1, x_2, ..., x_n)=0 over [0,1]x[0,1]x...x[0,1].

So the answer should be 1 in both cases.

It really does not look like a intelligent question.
 
Answer to question number 13

Question number 13: What is the definition of max(x, y) over [0,1]x[0,1]? Is that just a constant 1. So max(x_1, x_2, ..., x_n) =1 over [0,1]x[0,1]x...x[0,1]. And so does min(x_1, x_2, ..., x_n)=0 over [0,1]x[0,1]x...x[0,1].

So the answer should be 1 in both cases.

It really does not look like a intelligent question.

These are questions asked at some banks for front office or research quant position.

1.If a is a column vector, then how many non-zero eigenvalues does the matrix aa' have? what are the eigenvalues? What are the corresponding eigenvectors? What are the eigenvectors corresponding to the zero eigen values?
2. if w is an standard brownian motion, is w^3 a martingale?
3. prove that the price of a call option is a convex function of the strike price.
4. Suppose you are throwing a dart at a circular board. What is your expected distance from the center? Make any necessary assumptions. Suppose you win a dollar if you hit 10 times inside a radius of R/2, where R is the radius of the board. You have to pay 10c for every try. If you try 100 times, how much money would you have lost/made in expectation? Does your answer change if you are a pro and your probability of hitting inside R/2 is double of hitting outside R/2?
5. Suppose you have an old machine, which does not have a capability to multiply two numbers, but does have a capability to square a number. It also has addition and bit shift operators. Implement multiplication and division (integer division only)
6. Again the previous question, now you dont even have the squaring capability, but only bit shift, and addition. Implement multiplication
7. what do you know about const.
8. What is the problem with virtualization from the point of view of optimization. What can a compiler do when a function is not virtualized?
9. How is virtuality implemented in C++
10. integrate log^n x.
11. prove, from first principles, the differential of e^cos(x).
12. given the matrix A=(5 -3;-3 5), find a matrix M, such that A=M*M. Now find a matrix M such that A=M'*M
13. Suppose x_1, x_2...x_n are IID from [0,1] uniform interval. What is the expected value of the maximum. What is the expected value (max-min).
14. Suppose I have a routine that can sort n numbers in O(n) time. Prove me wrong.
15. Suppose you have the implied vol curve for call options. What is the arb free price of a digital struck at k given this implied vol curve.
16. Pricing a barrier option with a discrete barrier.
17. Distribution of the max of a brownian motion. Use it to price digital american and european call options.
18. Explain put call parity.
19. At one interview, I was asked to explain, in great detail, whatever I knew about the current credit problem (for about 25 mins). I did well only because I was reading the WSJ.
20. Given a fair coin, what is the expected number of trials you need to go to get 2 consecutive heads. 3 consecutive heads. generalize to N.
21. What is the variance on the number of trials in the question above?
 
Question 13

CDF for max : (F(M) = Pr(max(x_1,x_2,...,x_n)<=M) = M^n) (for (0<=M<=1))
PDF for max : (f(M) = nM^{(n-1)})

(E[M] = \int _0^1 nM^{(n-1)} dM = n/(n+1))

Similarly, (E[M-m]=(n-1)/(2n)).

Should use above pdf + probability of minimum conditional on maximum.
 
A puzzle

Let (Y_{n}) be the sum of numbers on the upper faces in (n) independent rolls of a fair die. Find lim n--> inf P( (Y_{n}) is a multiple of 13)
 
Let (Y_{n}) be the sum of numbers on the upper faces in (n) independent rolls of a fair die. Find lim n--> inf P( (Y_{n}) is a multiple of 13)
Aye!
We will start by defining a markov process and use stationary distributions:
Define
(X_{i}) to the be event that (Y_{n}) mod 13 == i.
0<= i <= 12
Now clearly P((X_{i})) -> P((X_{j})) =1/6 iff j<= i + 6 (mod 13)
And P((X_{i})) -> P((X_{j})) =0 iff j> i + 6 (mod 13)
In this fashion for a transition probability matrix, having dimension 13X13. Observe that the process has a row sum as well as the column sum one. Thus the matrix is doubly stochastic and since it has finite number of states the answer is 1/13(using properties of doubly stochastic processes with finite states. The system is recurrent and irreducible and therefore a stationary distribution exists.Figure the rest out.)
 
Sample Question #273 (brainteaser)

A geeky quantitative finance society in Manhattan has 500 members. One day the steering committee decides to throw a dance party to welcome the new members. At the party (which only members can attend), new members pay only $14 for tickets whereas long-time members pay $20. As a result, all of the new members attend but only 70% of the old members attend.

How much ticket revenue is collected at the party?

[Source: adapted from The Mensa Puzzle Calendar 2008]
 
Ans -> 7000.

say O nber old, N nber new members , then 500 = O + N
say party generated R = 14*n + 20*o where n nber of New member (o for Old members) who participated. with n = N and o = 0.7*O .
Then R = 14*N+14*O = 14*500
 
This reminds me of a simple interview question asked in a telephonic interview.
Given an array of 49 numbers between 1-50, all unique you need to find the missing number? Optimize for speed and memory.
 
This story is so inspiring it has to be shared here
After 38 years, Israeli solves math code - Yahoo! News
Trahtman's solution: http://arxiv.org/abs/0709.0099

JERUSALEM - A mathematical puzzle that baffled the top minds in the esoteric field of symbolic dynamics for nearly four decades has been cracked — by a 63-year-old immigrant who once had to work as a security guard.
Avraham Trahtman, a mathematician who also toiled as a laborer after moving to Israel from Russia, succeeded where dozens failed, solving the elusive "Road Coloring Problem."
The conjecture essentially assumed it's possible to create a "universal map" that can direct people to arrive at a certain destination, at the same time, regardless of starting point. Experts say the proposition could have real-life applications in mapping and computer science.
The "Road Coloring Problem" was first posed in 1970 by Benjamin Weiss, an Israeli-American mathematician, and a colleague, Roy Adler, who worked at IBM at the time.
For eight years, Weiss tried to prove his theory. Over the next 30 years, some 100 other scientists attempted as well. All failed, until Trahtman came along and, in eight short pages, jotted the solution down in pencil last year.
"The solution is not that complicated. It's hard, but it is not that complicated," Trahtman said in heavily accented Hebrew. "Some people think they need to be complicated. I think they need to be nice and simple."
Weiss said it gave him great joy to see someone solve his problem.
Stuart Margolis, a mathematician who recruited Trahtman to teach at Bar Ilan University near Tel Aviv, called the solution one of the "beautiful results." But he said what makes the result especially remarkable is Trahtman's age and background.
"Math is usually a younger person's game, like music and the arts," Margolis said. "Usually you do your better work in your mid 20s and early 30s. He certainly came up with a good one at age 63."
Adding to the excitement is Trahtman's personal triumph in finally finding work as a mathematician after immigrating from Russia. "The first time I met him he was wearing a night watchman's uniform," Margolis said.
Originally from Yekaterinburg, Russia, Trahtman was an accomplished mathematician when he came to Israel in 1992, at age 48. But like many immigrants in the wave that followed the breakup of the Soviet Union, he struggled to find work in the Jewish state and was forced into stints working maintenance and security before landing a teaching position at Bar Ilan in 1995.
The soft-spoken Trahtman declined to talk about his odyssey, calling that the "old days." He said he felt "lucky" to be recognized for his solution, and played down the achievement as a "matter for mathematicians," saying it hasn't changed him a bit.
The puzzle tackled by Trahtman wasn't the longest-standing open problem to be solved recently. In 1994, British mathematician Andrew Wiles solved Fermat's last theorem, which had been open for more than 300 years.
Trahtman's solution is available on the Internet and is to be published soon in the Israel Journal of Mathematics.
Joel Friedman, a math professor at the University of British Columbia, said probably everyone in the field of symbolic dynamics had tried to solve the problem at some point, including himself. He said people in the related disciplines of graph theory, discrete math and theoretical computer science also tried.
"The solution to this problem has definitely generated excitement in the mathematical community," he said in an e-mail.
Margolis said the solution could have many applications.
"Say you've lost an e-mail and you want to get it back — it would be guaranteed," he said. "Let's say you are lost in a town you have never been in before and you have to get to a friend's house and there are no street signs — the directions will work no matter what."
 
Question number 3( 5 thieves to share 100 coins)

I think

I would give 1 coin to the 4th and 1 coin to the 5th and keep 98 for me.
But if you want to be 100% you will survive then keep 96 for you and give 2 coins to the 4th and 5th guys.

Regards
 
Back
Top