Sie sind auf Seite 1von 8

M.S.

Data Science Challenge Exam


Fall 2019
This is the challenge exam for your CUNY MSDS application. The questions on the exam are
designed to help the Data Science department evaluate your background and experience in a
number of areas, so that we are able to determine your level of preparedness to enter the program.

Please do your best and know that most successful MSDS candidates will not be able to answer
every question. In addition to correct answers, we’re also interested in understanding your
approach to solving problems and your ability to demonstrate that you can deliver work in agreed
upon timeframes. You may consult the Internet, calculators and textbooks, but may not ask other
people for assistance in solving the problems.

If you are unable to answer any of the questions and require recommendations on how to pick up
the skillsets required to tackle the challenge exam please send an email to
DataScience@sps.cuny.edu.
R Questions
1. A summer camp is creating groups for students and decided to put the siblings in the same
group if the age of both the kids are less or equal to five. The code is given below.
a) Find what is wrong in the code, Explain.

sblings_age <- data.frame(Sibling1 = c(5,7,4,3,3), Sibling2 = c(6, 5, 5, 4, NA) )

Both_less_than_5 = (Siblings$Sibling1 <= 5 ) && (Siblings$Sibling2 <= 5

b) Add the vector Both_less_than_5 as a new column of Siblings data frame

2. Given is a list of Scores achieved by the students:

Scores <- list(


Thomas = c(10,8,7,9),
Lily = c(6,8,10),
Ben = c(10, 9, 10, 7, 8),
Mary = c(9,10,8,7))

Use any “apply” method to get the difference between the max score and the min score of each
student:
3. Write a function in R that takes a word and checks whether the word is a palindrome or not.
Returning True if the input word is a palindrome and returning False if it is not. (Note:
Palindromes are words that read the same backwards as they do forward, e.g. civic, level)

4. Write an R function that will take two words to check whether they are the same word or not.
The checking is case insensitive. So “Hello” and “hello” will return true.
SQL Questions
1. What are the different types of SQL statements? Explain and provide one example.

2. Use the Employee Table below to answer questions a and b

Employee Table:

Employee Employee Name Department Salary


ID
1 Mary Support 50000
2 John Sales 70000
3 Mark Operations 65000
4 Susanne Support 50000
5 Michelle Support 55000
6 Ed Sales 75000
7 George Operations 68000
8 Charlotte Operations 78000
9 Patrick Sales 76000
10 Bryan Sales 80000

a) Write a SQL query to fetch the record with second highest salary.

b) Write a SQL query to fetch the average salary of each department.


3. You have the task of designing a set of tables that would represent courses being given at a local
university. Each course has a unique integer ID, a course name, the number of credits, and the
year and the semester the course will be given in. Students also have a unique integer ID, a first
and last name and a set of courses the student is currently enrolled in. Given this modeling
problem, please answer the following questions:
• Describe how you would model this situation. How many tables would you need to model
this situation? What names would you give them?
• In your implementation, what query would you write to generate a table with one row per
course and student combination, for courses being given in the Fall semester of 2019.
Math Questions
1. Probability: Given a standard deck of cards, you draw a single card. What is the probability of
drawing a 6 or a diamond?

2. Linear Algebra: What is the determinant of the following matrix?

1 4 3
[3 7 1]
2 0 3
3. System of Equations: Find a solution to the following linear equation:
x + 3y - 4z = -3
-2x + 2y + z = 0
3x - 2y + 2z = 8

4. Calculus: Integrate tan(x) dx using u-substitution. Please show all your work.
5. Bayes Theorem: Three companies A, B and C produce and supply 20%, 55% and 25% of the
widgets needed by your company. From past data, it can be shown that 4%, 3% and 1%
(respectively) of these widgets produced by these companies are defective. If a notebook was
found to be defective, what is the probability that the notebook was supplied by A?

Das könnte Ihnen auch gefallen