# Quantitative Interview questions and answers

#### WilliamRFrost

Hmmm... My TI-83 is giving me a different answer...

Edit: Nevermind, I was putting it in as sqrt(2)^sqrt(2)^sqrt(2)^sqrt(2) when I needed to do it sqrt(2)^sqrt(2) -> sqrt(2)^Ans -> sqrt(2)^Ans

Sorry.

#### Andy Nguyen

Let's have another round of these Latte questions

Problem 1

Painting a room has a linear time complexity because it will take double the time to paint an area double the size of the room. Based on this definition of time complexity the most optimum algorithm to solve a problem will be one that has:

a) exponential time complexity;
b) logarithmic time complexity;
c) parabolic time complexity;
d) None of the above;

Problem 2

The following group of objects demonstrates degeneracy

a) A point and a circle
b) A point and an ellipse
c) A point and a square
d) both (a) and (b)
e) A point and a triangle

( Hint: In math a degenerate case is a limiting case when a class of object changes its nature so as to belong to another class due to the limiting case of a variable. What happens to a circle when the radius approaches zero? Similarly, what happens to an ellipse when the eccentricity approaches zero?)

Problem 3

Which of the following polynomials have degenerate roots?

a) ((x-1)^2)
b) ((x^2+2x-1)^2)
c) (\sqrt{x-1})
d) (x^2+1)

( Hint: Roots (zeros of a polynomial) which coincide, i.e. are equal, are said to be degenerate.)

Problem 4

If (\sigma) is the standard deviation of a time series (S_i) (of asset prices) and (Max (S_i)) is the maximum value of the series and is the minimum value of (Min (S_i)) the series which has (n) observations. Range is defined as the difference of the maximum and the minimum of the series. Then which of the following holds true:

a) (\sigma = \frac{Range}{\sqrt{n}})
b) (\sigma = \frac{Range}{\sqrt{n+2}})
c) (\sigma = \frac{Range}{n})
d) None of the above;

( Hint : This is perhaps one of the most profound areas of mathematical finance, i.e. the application of probability and distribution to make trading decisions. What should matter is the expected payoff from a trade and not the respective probabilities of the up move and the down move)

Problem 5

Of the following, one pair of numbers is taxicab numbers (Hardy-Ramanujam number), i.e. the number is a sum of two cubes?

a) 81 and 459
b) 2 and 1729
c) 3 and 1165
d) 195 and 1956

(b)
(d)
(a)
(a)
(b)

Source Risk Latte

#### IlyaKEightSix

Got 4 of those right, except the time-series one (haven't taken a course on TS yet). I like these questions.

#### quantyst

Look at Problem 2. Tell me what happens to the limiting case of a triangle when all its sides with the same rate approach a length zero. You get a point, just as you'd get the same thing when the radius of a circle approaches zero. I don't see a difference between a circle, triangle, ellipse, or anything else for that matter.

What is the significance of Problem 5? Yes, it is neat, has some historical relevance, etc. But why is it challenging? I somehow miss the point of it.

Look at Problem 3. Last I checked choice (c) is not a polynomial. Also it is obvious that both choices (a) and (b) have repeated roots (i..e., degenerate roots), 1 in the case of (a) and 1/3 in the case of (b). So, the answer given for Problem 3, namely (a), is wrong.

#### Mr Doe

Haha, look at number 4.
Suppose we have time series of just two observations (X_1=1,X_2=2), range is then (Range=1). So, standard deviation should be (\frac{1}{\sqrt{2}}). But this is clearly not the case! They haven't defined standard deviation but lets assume they meant (\sigma=\sqrt{\frac{1}{n-1}\sum_{k=1}^n (X_k-\overline{X})^2} ) where (\overline{X}) is the mean of time series (if we want it to be unbiased). Then we get (\sigma=\sqrt{2}\cdot0.5), if the actually meant (\sigma=\sqrt{\frac{1}{n}\sum_{k=1}^n (X_k-\overline{X})^2}), the we get (\sigma=0.5).

And yet, they claim the answer is (a).

Edit: HAhaha, I get it, the first three choiches are all (a), so actually the answer their is correct!

#### koupparis

##### Carpe noctum
Last I checked (\frac{1}{\sqrt{2}} = \sqrt{2} \cdot .5). So answer (a) is correct. (b) and (c) are not the same as (a).

#### IlyaKEightSix

Look at Problem 2. Tell me what happens to the limiting case of a triangle when all its sides with the same rate approach a length zero. You get a point, just as you'd get the same thing when the radius of a circle approaches zero. I don't see a difference between a circle, triangle, ellipse, or anything else for that matter.

What is the significance of Problem 5? Yes, it is neat, has some historical relevance, etc. But why is it challenging? I somehow miss the point of it.

Look at Problem 3. Last I checked choice (c) is not a polynomial. Also it is obvious that both choices (a) and (b) have repeated roots (i..e., degenerate roots), 1 in the case of (a) and 1/3 in the case of (b). So, the answer given for Problem 3, namely (a), is wrong.

I'm guessing that Problem 3's choice b is a typo and that first x should be x^2.

As for problem 2, I'm guessing that as the angles approach zero or only one of those set of sides approach zero that you get a line, not a point. A circle certainly gives you a point though, so it seemed the safe choice. But it seems whichever company is making these questions needs lessons on question clarity.

#### Mr Doe

Last I checked (\frac{1}{\sqrt{2}} = \sqrt{2} \cdot .5). So answer (a) is correct. (b) and (c) are not the same as (a).

Indeed, I have made a mistake, but no the answer is not correct!
I will correct my counterexample; let (X_1=0,X_2=X_3=\dots=X_7=1,X_8=2), we have (\overline{X}=\frac{0+6\cdot 1+2}{8}=1), range this time equals (2), again we compute stan. deviation, we have (\sigma^2=\frac{1}{7}(6\cdot (1-1)^2+(2-1)^2+(0-1)^2)=\frac{2}{7}), so (\sigma=\sqrt{\frac{2}{7}}).
But we find that (\frac{\operatorname{Range}}{\sqrt{8}}=\frac{2}{\sqrt{2^3}}=\frac{1}{\sqrt{2}}).hope no mistakes this time

But you have to admitt, it would be pretty spectacular, if the standard deviation would depend only on the most extreme values and not on the values in between!!!!

#### koupparis

##### Carpe noctum
Indeed, I stand corrected.

#### quantyst

You wrote:

"I'm guessing that Problem 3's choice b is a typo and that first x should be x^2."

Assuming you are correct, then the situation would be worse, not remedied. If the choice (b) of Problem 3 is [(x^2)+2x-1]^2, then it would have two repeated (degenerate) roots, namely, -1+rad(2) and -1-rad(2). Again, this is a bad question, bad taste.

I'm guessing that Problem 3's choice b is a typo and that first x should be x^2.

As for problem 2, I'm guessing that as the angles approach zero or only one of those set of sides approach zero that you get a line, not a point. A circle certainly gives you a point though, so it seemed the safe choice. But it seems whichever company is making these questions needs lessons on question clarity.

#### IlyaKEightSix

Well, writing x+2x makes no sense...otherwise, it would simply have been 3x, wouldn't it? I guess after seeing so many perfect squares that I'm just too used to seeing x^2+2x-1 or something silly like that.

#### chaoticrambler

Dunrewpp said:
There are 2n ants, A(-n), , A(-1), A(1), , A(n), each moving at constant speed 1 along the real line. At time t=0, the ants are located at positions -n, -(n-1), -(n-2), , -2, -1, 1, 2, , (n-2), (n-1), n on the number line. At time t=0, the ants on the negative side of the real line move in the positive direction, and those on the positive side move in the negative direction. Every time two ants come in contact, they instantaneously reverse direction and continue to move at their previous speeds. Find the position P(i,t) of each ant A(i) as a function of time t. Also determine the time when there will be no ants between the points -(n+1) and (n+1). Now answer the same questions if the speed of the ants A(-n), , A(-1) is v where v>1.

Well, the time when there will be no ants between -(n+1) and (n+1) is simply 2n+2 .
Lets say you don't need to keep track of where each ant is...then you can assume when the ants collide, they just go through each other without changing direction...this doesn't change the basic problem ..so now all we need to know is how much time the ant at one end takes to go over the other end ...so from -(n+1) to + (n+1) at speed 1 => time is 2n+2

#### chaoticrambler

Nifty question. My gut was to say that the answer here is (\frac{1}{4}), since we're conditioning on the report of the roll, which gives us more information to work with. A closer look shows that this is a reasonable answer to the question, but not the only possible one....

This is actually a conditional probability:

(P(rolls 6 | reports 6) = \frac{P(rolls 6, reports 6)}{P(reports 6)})

Here's where the assumptions begin to come in. For one thing, we assume that the roll and the decision to lie are independent; under this assumption, the numerator is easy:

(P(rolls 6, reports 6) = P(rolls 6, tells the truth) = \frac{1}{6}*\frac{1}{4} = \frac{1}{24})

The denominator is trickier. This is where the biggest assumptions come in.

(P(reports 6) = P(rolls 6, tells the truth) + P(rolls non-6, lies, reports 6))

We've already computed the first term, but how do we compute the second? We have to know something about how the person lies.

Are the person's lies always plausible? (That is, would the person lie by saying a 3.4 had been rolled, or a 529?) Given that they're always plausible, are they "fair?" (That is, is the person's lying strategy to choose a plausible lie at random with an equal probability of each lie, or is there some other distribution to the lies? Is the lie even random, aside from the initial throw of the die?)

For the sake of convenience, let's assume that, when the person lies, he or she does so by reporting some other plausible result at random, with equal probability of each lie. Then:

(P(reports 6) = \frac{1}{24} + \frac{5}{6}*\frac{3}{4}*\frac{1}{5}=\frac{1}{24}+\frac{1}{8}=\frac{1}{6})

Overall, then:
(P(rolls 6 | reports 6) = \frac{\frac{1}{24}}{\frac{1}{6}} = \frac{1}{4}), as expected.

For the sake of illustration, though, let's work the problem under a different lying strategy: suppose the person always says "6" when lying about a non-6. (We don't really care what he does when lying about a 6.) Then:

(P(reports 6) = \frac{1}{24} + \frac{5}{6}*\frac{3}{4}*1 = \frac{1}{24} + \frac{5}{8} = \frac{2}{3})

Under this alternative assumption:

(P(rolls 6 | reports 6) = \frac{\frac{1}{24}}{\frac{2}{3}} = \frac{1}{16})

As you can see, how you assume the person lies can have a rather dramatic impact on the answer....

Is it typo that you have taken P(tells truth)=1/4 rather than 3/4 ....

if the decision to lie is independent of the roll, then Numerator= P(rolls 6 And report 6)=P(rolls 6)P(reports 6)=(1/6)(3/4)=1/8

Denominator=P(reports 6)=1/6

so P(rolls 6 | reports 6)= (1/8)/(1/6)=3/4 ????

So in your first assumtion, does the answer turn out to be 3/4 after being corrected for typo.

#### chaoticrambler

ue and Bob take turns rolling a 6-sided die. Once either person rolls a 6 the game is over. Sue rolls first, if she doesn't roll a 6, Bob rolls the die, if he doesn't roll a 6, Sue rolls again. They continue taking turns until one of them rolls a 6.
Bob rolls a 6 before Sue.
What is the probability Bob rolled the 6 on his second turn?

(5/6*5/6*5/6*1/6)/(5/6*1/6+5/6*5/6*5/6*1/6+ infinite series)
=Probability of Bob winning in second turn/Probability of Bob winning
=25/144

For the ants I can only come up with the idea of uniformly distributing 100 ants all through the stick and pitting pairs of them in opposite directions.

I think there is an error in the calculation.

The answer I get is 275/1296

#### Andy Nguyen

Hmmm... My TI-83 is giving me a different answer...

Edit: Nevermind, I was putting it in as sqrt(2)^sqrt(2)^sqrt(2)^sqrt(2) when I needed to do it sqrt(2)^sqrt(2) -> sqrt(2)^Ans -> sqrt(2)^Ans

Sorry.
A similar question that you can solve in the same fashion
Prove (\sqrt{a+\sqrt{a+\sqrt{a+...}}}=\frac{1+\sqrt{1+4a}}{2})

One more question looking for answer:

A man speaks the truth 3 out of 4 times. He throws a die and reports it to
be a 6. What is the probability of it being a 6?
--

I think it should be:

0.75 + 0.25*0.20 = 0.8.

What are other people's thoughts?

#### Mr Doe

Undefined. Suppose he's lying, that is the number shown is not 6, you don't know the probability of choosing 6 as an answer.

Undefined. Suppose he's lying, that is the number shown is not 6, you don't know the probability of choosing 6 as an answer.

Right exactly: I assumed uniform for choosing wrong answer. You're right: I should have spelled out that assumption. But after making that assumption, is my answer correct?

#### goodstudent

A similar question that you can solve in the same fashion
Prove (\sqrt{a+\sqrt{a+\sqrt{a+...}}}=\frac{1+\sqrt{1+4a}}{2})

Let (x=\sqrt{a+\sqrt{a+\sqrt{a+...}}}), then
(x^2=a+\sqrt{a+\sqrt{a+...}}})<br>
(x^2-a=\sqrt{a+\sqrt{a+\sqrt{a+...}}}})
(x^2-a=x).

Then use pathagorean. And since it cant be a negative number so it has to be:
(\frac{1+\sqrt{1+4a}}{2})

---------- Post added at 11:19 AM ---------- Previous post was at 10:50 AM ----------

I think it should be:

0.75 + 0.25*0.20 = 0.8.

What are other people's thoughts?

Looks likes a Bayes Theorem question.
I got something weird. Not sure if it's right.

(P(Report6)=3/4*1/6+1/4*1/6=1/6)
(P(Report6|Truth)=1/6) (assuming they are independent)
(P(Truth)=3/4)
(P(Truth|Report6)=P(Report6|Truth)*P(Truth)/P(6)=3/4)

Of course, assuming that theres equal chance in him picking any number to lie.

#### APalley

Nifty question. My gut was to say that the answer here is (\frac{1}{4}), since we're conditioning on the report of the roll, which gives us more information to work with. A closer look shows that this is a reasonable answer to the question, but not the only possible one....

This is actually a conditional probability:

(P(rolls 6 | reports 6) = \frac{P(rolls 6, reports 6)}{P(reports 6)})

Here's where the assumptions begin to come in. For one thing, we assume that the roll and the decision to lie are independent; under this assumption, the numerator is easy:

(P(rolls 6, reports 6) = P(rolls 6, tells the truth) = \frac{1}{6}*\frac{1}{4} = \frac{1}{24})

The denominator is trickier. This is where the biggest assumptions come in.

(P(reports 6) = P(rolls 6, tells the truth) + P(rolls non-6, lies, reports 6))

We've already computed the first term, but how do we compute the second? We have to know something about how the person lies.

Are the person's lies always plausible? (That is, would the person lie by saying a 3.4 had been rolled, or a 529?) Given that they're always plausible, are they "fair?" (That is, is the person's lying strategy to choose a plausible lie at random with an equal probability of each lie, or is there some other distribution to the lies? Is the lie even random, aside from the initial throw of the die?)

For the sake of convenience, let's assume that, when the person lies, he or she does so by reporting some other plausible result at random, with equal probability of each lie. Then:

(P(reports 6) = \frac{1}{24} + \frac{5}{6}*\frac{3}{4}*\frac{1}{5}=\frac{1}{24}+\frac{1}{8}=\frac{1}{6})

Overall, then:
(P(rolls 6 | reports 6) = \frac{\frac{1}{24}}{\frac{1}{6}} = \frac{1}{4}), as expected.

For the sake of illustration, though, let's work the problem under a different lying strategy: suppose the person always says "6" when lying about a non-6. (We don't really care what he does when lying about a 6.) Then:

(P(reports 6) = \frac{1}{24} + \frac{5}{6}*\frac{3}{4}*1 = \frac{1}{24} + \frac{5}{8} = \frac{2}{3})

Under this alternative assumption:

(P(rolls 6 | reports 6) = \frac{\frac{1}{24}}{\frac{2}{3}} = \frac{1}{16})

As you can see, how you assume the person lies can have a rather dramatic impact on the answer....

The assumption of how the person lies can have a dramatic impact, however, the question implies that the person is a pathological liar, who statistically lies 1/4 of the time.

Therefore, one can solve this problem with some basic reasoning: if he reported a 6, and he lies 1/4 of the time, then in a large sample, 3/4 of the time that he reports a 6 he will actually have rolled a 6!

Replies
0
Views
4K
Replies
2
Views
88K
Replies
2
Views
5K
Replies
11
Views
9K
Replies
24
Views
18K