Amazon ML Summer School Previous Year Questions
Amazon ML Summer School Previous Year Questions
1. Two squares are chosen at random on a chessboard. What is the probability that they
have a side in common?
a) 8/13
b) 17/18
c) 5/13
d) 1/18
2. The police plans to enforce speed limits during morning rush hour on four different
routes into the city. The traps on routes A, B, C, and D are operated 40%, 30%, 20%,
and 30% of the time, respectively. Biff always speeds to work, and he has probability
0.2, 0.1, 0.5, and 0.2 of using those routes. What is the probability that he'll get a
ticket on any one morning?
Select an option:
a) 0.27
b) 0.93
c) 0.73
d) 0.07
a) 1/2
b) 1/4
c) 1/3
d) None of the above
4. You have two coins. One of them is fair and comes up heads with probability 1/2 and
the other is biased and comes up heads with probability 3/4. You randomly pick a coin
and flip it twice. You get heads both times. What is the probability that you picked the
fair coin?
a) 13/32
b) 4/13
Select an option
a) 0
b) 1
c) Inf
d) Can't be determined
7. A 3-input neuron has weights 1, 4 and 3. The transfer function is linear with the
constant of proportionality being equal to 3. The inputs are 4, 8 and 5 respectively.
What will be the output?
Select an option
a) 51
b) 153
c) 54
d) 160
Select an option
a) we would choose a higher p-value
b) we would choose a lower p-value
9. When classifying data with logistic classification, what is the upper bound of the
likelihood in the maximum likelihood method? Is this value attainable?
a) 1, Yes
b) e, No
c) 1, No
d) 0, Yes
10. Let M and S2 be the mean and variance of a random sample of size > 1 respectively
from a normal population with an unknown mean μ and unknown finite variance
σ2>0. Consider the following statements:
Select an option
a) rank(B) = 3
b) rank(B) <= 3
c) rank(8) >= 3
d) data insufficient
Select an option
a) -3
b) 3
c) -4
d) 4
a) Gradient descent, since inverse(XTX) will be very slow to compute in the normal
equation.
b) Gradient descent, since it will always converge to the optimal Θ.
c) The normal equation, since it provides an efficient way to directly find the solution.
d) The normal equation, since gradient descent might be unable to find the optimal Θ
14. The eigen values of a 4x4 square matrix having 0's as the diagonal elements and 1's
on the off diagonal elements is
a) 2, -2, 0, 0
b) 1, -1, 1, -1
c) 3, -1, -1, -1
d) 4, 0, 0, 0
15. Let A be the 2 x 2 matrix with elements a11 = a12 = a21 = +1 and a22 = -1. Then the
eigenvalues of the matrix A19 are:
Select an option
a) 1024 and -1024
b) 1024√2 and -1024√2
c) 4√2 and -4√2
d) 512√2 and -512√2
Select an option
a) 4(1+log2)
b) 4(2+log2)
c) 4
d) 8
Select an option
a) A-1 does not exist
b) A-1 exists but cannot be determined from the data
c) A-1 = A - I
d) A-1 = A + 1
Select an option
a) Bias(M1) ≤ Bias(M5), Variance(M1) ≤ Variance(M5).
b) Bias(M1) ≥ Bias(M5), Variance(M1) ≤ Variance(M5).
c) Bias(M1) ≤ Bias(M5), Variance(M1) ≥ Variance(M5).
d) Bias(M1) ≥ Bias(M5), Variance(M1) ≥ Variance(M5).
1.
There are three robots named Ray, Ben and Kevin. Initially Ray has a string S of length N.
while the other two robots have empty strings. We can make either of the following moves:
Move 1: Remove the first character from Ray's string and append it
to Ben's string.
Move 2: Remove the last character from Ben's string and append it
to Kevin's string.
You must perform either of the two moves mentioned above in such a way that the strings left
with Ray and Ben are empty and the string left with Kevin is lexicographically the smallest.
Your task is to return this lexicographically smallest string that Kevin has after completing
this activity.
Note: For any two given strings, a string is said to be lexicographically smaller than the other
if it comes before the other string in the dictionary
You are required to fill in a function that takes as inputs an integer' input1' (1) <= input1 <=
1000) and an integer array input2[], containing 'input1'
integers, and returns output1 as the mean, output2 as the median and output3 as the mode.
The mean and median must be correct to six decimal places.
Mean:
Defined as the average of all numbers in the array
Median:
Note: For finding the median, elements in the array have to be listed in numerical order from
smallest to largest
Mode:
Defined as the number in the array with the highest frequency.
If many numbers have the same highest frequency, then the mode is calculated by breaking
ties in favour of the smallest of the numbers.
Input Specification:
input1: Integer in the range of 1 <= input1 <= 1000, denoting length of
input array.
input2: Integer input array
Output Specification:
Return output1 (double) variable as the mean
Return output2 (double) variable as the median.
Return output3 (int) variable as the mode.
Example 1:
input1: 3
input2: {1,2,3}
Output: 2.000000, 2.000000, 1
Example 2:
input1: 5
input2: (41,18467,6334,26500,19169}
Output: 14102.200000, 18467.000000, 41
Note:
• The number of cities is always greater than 3.
• Assume 1 based indexing.
Input Specification:
input1: An integer value N, representing the number of cities.
input2: An integer array A, representing the cost of tickets to reach the ith a city.
Output Specification:
Return the minimum possible cost of flight ticket required to reach the city N.
Example 1:
input1: 4
input2: (1,4,5,2)
Output: 1
Explanation:
Example 2:
input1: 6
input2 (4,12,13,18,10,12)
Output: 10
Explanation:
George takes a flight in the below optimal manner: From city 1 to city 2, the cost will be |4-
12| = 8
• From city 2 to city 3, the cost will be |12-13| = 1
. From city 3 to city 6, the cost will be |13-12| = 1
Therefore, the total cost is 8 + 1 + 1 = 10. Hence, 10 is returned as the output.
FAQs
3. Are Amazon’s past, current and incoming interns eligible to participate in this program?
Yes, Amazon’s past, current and incoming interns are eligible to participate in this program.