Given the following function definition: (4 min, score = 3)
result = 1
For i from 1 to x (inclusively):
result = result + i
How many additions will take place while evaluating f(f(f(3)))?
A stock’s price fluctuates every day by going up exactly 5% or going down exactly 5%. Assume that each direction is equally likely. Assume zero trading cost, zero interest rate, and no dividends and splits. What strategy is most likely to be profitable after 100 days?
(3 min, score = 3)
A. Buy or sell will produce same profitable
B. Cannot know / no strategy can be profitable
C. Buy the stock
D. Sell the stock
Below is a list of asymptotic complexities of 8 functions, each with length N input:
O(N * log(N))
Please sort the functions by order of growth, with slower growing functions first. (your answer shall be a sequence of letters, for example “BACDFHGE”)
(4 min, score = 3)
- What is the maximum possible variance of a random variable taking values in the interval [0, 10]?
(2 min, score = 2)
Half is , half is .
- How many integers such that is a perfect square are there in range [100: 400]?
(5 min, score = 4)
If is even, , then , so it’s a perfect square.
If is odd, , then , it’s a perfect square if and only if is a perfect square.
So there are 5 odds that meet the condition, .
- Assume there are three random variables . All pairwise correlations are equal: . What is the range of possible values of ? (list a range, like , for example)
(6 min, score = 12)
So the range of possible values of is .
- Assume there are three random variables . We would like to use one number to describe their relations, just like the pairwise correlation of 2 variables . We need the number to be normalized. Please list the possible mathematical formulas to calculate such number, the more the better.
(6 min, score = 12)
- Triangle ABC has sides of length 45, 60 and 75. A point is placed randomly and uniformly inside the triangle. What is the expected value of the sum of perpendicular distance from point X to this triangle’s three sides?
(9 min, score = 10)
It’s easy to know, triangle ABC is a right triangle.
- Please list one of your most “strange” or “crazy” idea to predict stock’s return. You can assume you have all available public data and strong computing power. The answer shall be as “strange” as possible.
(6 min, score = 10)
Use the stock code to select stocks. If the stock code is a prime number, buy it and hold. The strategy is pretty strange because there should be no useful information in the stock code.