0% found this document useful (0 votes)
2K views12 pages

Amazon ML Summer School Free Resources PDF

Uploaded by

khushi gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views12 pages

Amazon ML Summer School Free Resources PDF

Uploaded by

khushi gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Amazon ML Summer School

Practice Questions Prepared by Vikram Gaur - LinkedIn Top


Voice '24 | Google Cloud Facilitator | SDE @ EY

r
au
G
The selection test will have two parts – Part A will consist of 20 MCQ on basic ML
concepts and math fundamentals on topics such as probability, statistics and linear
algebra. Part B will consist of two Programming questions. The overall test duration
am
will be 75 minutes.

Suggestions: I would suggest doing practice from sites like GeeksforGeeks and
Practice 10-15 leetcode questions before attempting the test as it will give the
confidence to solve problems.
kr

Tips: Solve the questions with a calm mind. Don’t stress yourself during the test

because you have to do 22 questions in 75 minutes. Don’t spend too much time on
Vi

any question if you are not able to do it on the first attempt.

Tips:

● Make sure you have a good understanding of the basics of machine

learning before applying for the program.

● Practice solving machine learning problems using online resources and

coding challenges.

Vikram : https://www.linkedin.com/in/vikram-gaur-0252aa185
● Be prepared to work hard and learn quickly.

● Be proactive and ask questions during the online sessions.

● Collaborate with other mentees and work on the project together.

● Make sure you have a strong resume and cover letter when applying for

the internship and full-time offers at Amazon.

Question 1:

r
Suppose 26 cola drinkers are sampled randomly to determine whether they prefer

au
regular cola or diet cola. The random sample contains 18 regular cola drinkers and
eight diet cola drinkers. Let C denote regular cola drinkers and D denote diet cola
drinkers. Suppose the sequence of sampled cola drinkers is
DCCCCCDCCDCCCCDCDCCCDDDCCC. Is this sequence of cola drinkers
evidence that the sample is not random? With n1 = 18 and n2 = 8, lower yields a
G
critical value of 7 and Upper yields a critical value of 17.

Options:
(a) Yes, the sequence is evidence that the sample is not random because the
am
number of runs is less than the lower tail critical value.
(b) No, the sequence is not evidence that the sample is not random because the
number of runs is within the critical value range.
(c) Yes, the sequence is evidence that the sample is not random because the
number of runs is more than the upper tail critical value.
(d) No, the sequence is not evidence that the sample is not random because the
kr

number of runs is greater than the lower tail critical value.

Question 2 :
Vi

A fair die is rolled repeatedly until a number larger than 4 is observed. If K is the total
number of times that the die is rolled, then P(K=4) is equal to:

Options:
(a) 16/81
(b) 8/81
(c) 8/27
(d) 16/27

Question 3 :

A company's expected EBIT is 50,000. The company has 200,000, 10% debentures.
The equity capitalisation rate is 12%. Show the effect of leverage on overall cost of
Vikram : https://www.linkedin.com/in/vikram-gaur-0252aa185
capital and the value of firm through net income approach if (i) Increase the amount
of debentures by Rs.1,00,000 and use the proceeds to retire the equity shares and
(ii) Reduce the amount of debentures by Rs.1,00,000 and a fresh issue of equity
shares is made to retire the debentures.

Options for leverage increase:


(a) The overall cost of capital will decrease and the value of the firm will increase.
(b) The overall cost of capital will increase and the value of the firm will decrease.
(c) The overall cost of capital will remain the same and the value of the firm will
remain the same.
(d) The overall cost of capital will increase and the value of the firm will remain the
same.

r
Options for leverage decrease:

au
(a) The overall cost of capital will decrease and the value of the firm will increase.
(b) The overall cost of capital will increase and the value of the firm will decrease.
(c) The overall cost of capital will remain the same and the value of the firm will
remain the same.
(d) The overall cost of capital will decrease and the value of the firm will decrease.

Question 4 :
G
Given the Boolean function
am
𝐹(𝑥,𝑦,𝑧)=𝑥𝑦′𝑧+𝑥′𝑦′𝑧+𝑥𝑦𝑧𝑎, simplify the expression using Boolean algebra and identities.

Options:

(a) 𝑥𝑧(𝑦′+𝑦′𝑎+𝑦)
(b) 𝑧(𝑦′+𝑥′)+𝑥𝑦𝑧𝑎
kr

(c) 𝑧(𝑦′+𝑥′)+𝑥𝑦𝑧𝑎
(d) 𝑧(𝑥+𝑦′)+𝑥𝑦𝑧𝑎

Question 5 :Consider the following system of equations:


Vi

2x + y + z = 1, x - 2y + z = -2, x + y + λz = 4 (where λ is an unknown constant)

For what value of λ will this system of equations have NO solutions?

A. λ = 3

B. λ = -2

C. λ = -1

D. λ = 2

Question 6

Vikram : https://www.linkedin.com/in/vikram-gaur-0252aa185
If Rank (A) = 2 and Rank (B) = 3, then Rank (AB) is __________.

a)6 b)5 c)3 d)Data inadequate

Question 7

Suppose you have m=14 training examples with n=3 features (excluding the

additional all-ones feature for the intercept term, which you should add). The normal

equation is θ=(XTX)−1XTy. For the given values of m and n, what are the

r
dimensions of θ, X, and y in this equation?

au
● X is 14×3, y is 14×1, θ is 3×3

● X is 14×4, y is 14×4, θ is 4×4

● X is 14×4, y is 14×1, θ is 4×1

● X is 14×3, y is 14×1, θ is 3×1


G
am

Question 8 : Domain of the Gas Tank Function

Given the function g(x) = -(1)/(25)m+20, which describes the amount of gas

remaining in a car's gas tank after mis miles have been driven, determine the
kr

greatest value of the domain for this situation.

(a) 500 miles


Vi

(b) 250 miles

(c) 400 miles

(d) 600 miles

Question 9 : The mean of the observations of the first 50 observations of a process

is 12. if the 51st observation is 18, then, the mean of the first 51 observations of the

process is

Vikram : https://www.linkedin.com/in/vikram-gaur-0252aa185
(a) 12

(b) 12.12

(c) 12.36

(d) 18

Question 10 :

r
A fair coin is flipped twice and it is known that at least one tail is observed. The

au
probability of getting two tails is :

(a) 1/2

(b) 1/3
G
(c) 2/3
am

(d) 1/4

Part B Programming questions ( This time there is


kr

no programming language compulsion )


Vi

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.

Vikram : https://www.linkedin.com/in/vikram-gaur-0252aa185
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

r
au
the other if it comes before the other string in the dictionary.

Non-overlapping Intervals

G
Given an array of intervals intervals where intervals[i] = [starti, endi], return the
am
minimum number of intervals you need to remove to make the rest of the intervals

non-overlapping.
kr

Example 1:

Input: intervals = [[1,2],[2,3],[3,4],[1,3]]


Vi

Output: 1

Explanation: [1,3] can be removed and the rest of the intervals are non-overlapping.

Example 2:

Input: intervals = [[1,2],[1,2],[1,2]]

Output: 2

Explanation: You need to remove two [1,2] to make the rest of the intervals

non-overlapping.

Vikram : https://www.linkedin.com/in/vikram-gaur-0252aa185
Example 3:

Input: intervals = [[1,2],[2,3]]

Output: 0

Explanation: You don't need to remove any of the intervals since they're already

non-overlapping.

r
Constraints:

au
● 1 <= intervals.length <= 105

● intervals[i].length == 2
G
● -5 * 104 <= starti < endi <= 5 * 104

Find Median from Data Stream


am

The median is the middle value in an ordered integer list. If the size of the list is

even, there is no middle value, and the median is the mean of the two middle values.
kr

● For example, for arr = [2,3,4], the median is 3.

● For example, for arr = [2,3], the median is (2 + 3) / 2 = 2.5.


Vi

Implement the MedianFinder class:

● MedianFinder() initializes the MedianFinder object.

● void addNum(int num) adds the integer num from the data stream to the data

structure.

● double findMedian() returns the median of all elements so far. Answers within

10-5 of the actual answer will be accepted.

Example 1:

Input
Vikram : https://www.linkedin.com/in/vikram-gaur-0252aa185
["MedianFinder", "addNum", "addNum", "findMedian", "addNum", "findMedian"]

[[], [1], [2], [], [3], []]

Output

[null, null, null, 1.5, null, 2.0]

Explanation

MedianFinder medianFinder = new MedianFinder();

r
medianFinder.addNum(1); // arr = [1]

au
medianFinder.addNum(2); // arr = [1, 2]

medianFinder.findMedian(); // return 1.5 (i.e., (1 + 2) / 2)

medianFinder.addNum(3);
G
// arr[1, 2, 3]

medianFinder.findMedian(); // return 2.0


am

Constraints:

● -105 <= num <= 105


kr

● There will be at least one element in the data structure before calling

findMedian.

● At most 5 * 104 calls will be made to addNum and findMedian.


Vi

Follow up:

● If all integer numbers from the stream are in the range [0, 100], how would

you optimize your solution?

● If 99% of all integer numbers from the stream are in the range [0, 100], how

would you optimize your solution?

Number of Islands

Vikram : https://www.linkedin.com/in/vikram-gaur-0252aa185
Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's

(water), return the number of islands.

An island is surrounded by water and is formed by connecting adjacent lands

horizontally or vertically. You may assume all four edges of the grid are all

surrounded by water.

Example 1:

r
Input: grid = [

au
["1","1","1","1","0"],

["1","1","0","1","0"],

["1","1","0","0","0"],
G
["0","0","0","0","0"]
am

Output: 1
kr

Example 2:
Vi

Input: grid = [

["1","1","0","0","0"],

["1","1","0","0","0"],

["0","0","1","0","0"],

["0","0","0","1","1"]

]
Vikram : https://www.linkedin.com/in/vikram-gaur-0252aa185
Output: 3

Constraints:

● m == grid.length

● n == grid[i].length

● 1 <= m, n <= 300

r
● grid[i][j] is '0' or '1'.

au
3Sum (expected time complexity O(n²)

Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such
G
that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.

Notice that the solution set must not contain duplicate triplets.
am

Example 1:

Input: nums = [-1,0,1,2,-1,-4]


kr

Output: [[-1,-1,2],[-1,0,1]]
Vi

Explanation:

nums[0] + nums[1] + nums[2] = (-1) + 0 + 1 = 0.

nums[1] + nums[2] + nums[4] = 0 + 1 + (-1) = 0.

nums[0] + nums[3] + nums[4] = (-1) + 2 + (-1) = 0.

The distinct triplets are [-1,0,1] and [-1,-1,2].

Notice that the order of the output and the order of the triplets does not matter.

Vikram : https://www.linkedin.com/in/vikram-gaur-0252aa185
Example 2:

Input: nums = [0,1,1]

Output: []

Explanation: The only possible triplet does not sum up to 0.

r
Example 3:

au
Input: nums = [0,0,0]

Output: [[0,0,0]]
G
Explanation: The only possible triplet sums up to 0.

Constraints:
am

● 3 <= nums.length <= 3000

● -105 <= nums[i] <= 105


kr

Hint 1

So, we essentially need to find three numbers x, y, and z such that they add up to
Vi

the given value. If we fix one of the numbers say x, we are left with the two-sum

problem at hand!

Hint 2

For the two-sum problem, if we fix one of the numbers, say x, we have to scan the

entire array to find the next number y, which is value - x where value is the input

parameter. Can we change our array somehow so that this search becomes faster?

Hint 3

Vikram : https://www.linkedin.com/in/vikram-gaur-0252aa185
The second train of thought for two-sum is, without changing the array, can we use

additional space somehow? Like maybe a hash map to speed up the search?

r
au
G
am
kr
Vi

Vikram : https://www.linkedin.com/in/vikram-gaur-0252aa185

You might also like