Currently R, SAS and Python are the three languages ruling the analytics industry. Expertise in at least one of the three language is a must to build a competitive profile. But mastering only one language might not make you a hot selling property. Even if you are not an expert in each of the three languages, you need to know what is the arena of strength for the three languages. In some of our previous articles, we covered interview questions in R (here) and SAS ( here).
We also covered the ways to train your brain for analytical thinking (here) and framework to develop structured thinking (here). In this article, we have collected few questions to estimate your expertise level in the three languages. The scores and results will just be directional and not a comprehensive view of your skill set.
This test contains 5 questions each from the three languages. Each question carries 2 marks for being correct and no negative markings. You will need to calculate the total score in three sections and the score in the section you scored most. Following is the table you can refer to interpret the scores:
Here are a few guidelines you need to follow (to make your score more insightful):
1. You cannot use any knowledge other than yours to attempt the questions
2. You cannot use a calculator
3. The maximum time you can spend on each section cannot be more than 5 minutes.
4. The questions should be answered in an order.
5. You should not attempt questions which you are not 100% sure.
Question 1) The following program is submitted.
data WORK.TEST;
input Name $ Age;
datalines;
John +35 ;
run;
Which values are stored in the output data set?
Name Age --------------------- John 35
Name Age --------------------- John (missing value)
Name Age --------------------- (missing value) (missing value)
Question 2) You have two datasets with many to one mapping. You are trying to merge the two datasets using a Data-Merge statement (after sorting on the key). What will be the output :
A. Data error
B. Wrongly merged table
C.Merging happens fine and you get the rightly merged table
Question 3) Dataset A has 3 rows with all ids as “1” and 2 rows with “2”. Dataset B has 2 rows with all ids as “1” and 3 rows with “2” . If you merge the two tables, the resultant table will have how many rows?
A. 4
B. 5
C. 6
D. 3
Question 4) The following SAS program is submitted:
data WORK.LOOP;
X = 0;
do Index = 1 to 5 by 2;
X = Index;
end;
run;
Upon completion of execution, what are the values of the variables X and Index in the SAS data set named WORK.LOOP?
Question 5) The following SAS program is submitted:
data WORK.TEMP; Char1='0123456789'; Char2=substr(Char1,3,4); run;
What is the value of Char2?
Question 1 ) What is the difference between: import sklearn & from sklearn import datasets
a. the second statement does not work
b. Both are similar
c. First imports the entire module while the second only imports specific parts (datasets in this case) of the module and hence is more efficient
d. First statement imports modules while second imports function
e. None of the above
Question 2 ) How do you find median for a column (‘Age’) in dataframe (df) using Pandas
a. df.describe()
b. df.Age.median()
c. df[‘age’].median()
d. df[‘Age’].median()
e. median (df[‘Age’])
Question 3 ) Which of the following is not a valid data structure in Python?
a. List
b. Dictionary
c. Sets
d. Cubes
Question 4) Which of the following library – usage combination is wrong?
a. Pandas – Analysis & Handling of structured data
b. NLTK – Text Mining
c. urllib – Open a URL through your code
d. matplotlib – for creating libraries of plots
Question 5) Which of the following are valid for string representations:
a. ‘ ‘
b. “ “
c. ‘’’ ‘’’
d. All of the above
Question 1) Which of the following statistical techniques cannot be implemented on R?
A. Logistic Regression
B. CART
C. CHAID
D. Linear Regression
E. All above can be implemented on R
Question 2) What is the value of f(6) using the following code?
> y <- 3
> f <- function(x) {
+ y <- 2
+ y ^ 2 + g(x)
+ }
> g <- function(x) {
+ x * y
+ }
Question 3) What is the value of the vector d, which is defined as follows :
> a <- c(2,3,4) > b <- c(1,2)
> d <- a*b
Question 4) Library “TM” is used for?
A. Time Management
B. Time Series modeling
C. Text Mining
D. CarT Modelling
Question 5) What is the difference between the commands “install.packages” and “library”?
A. Both do the same job
B. install.packages brings file to your system and library function loads the package to current session
C.Library function brings file to your system and install.packages function loads the package to current session
D. Execution of install.packages is done only when the session starts but function “library” is executed for running sessions.
The scores will guide you directionally as to which language you need to work on. Along with the knowledge of these languages, you also need to master other skills required to solve unstructured business problems (covered in this article). To survive in this industry you need to master at least one of these languages. To be an analytics star you need to excel in one language and know basic of the other two languages. To be an analytics champion you need to master all three languages. Note that only mastering data handling language might not make you successful analyst. Also, the three languages are not substitutes for each other, but complement each other to do various analysis.You can add more questions to this bank in the comment box below. For any clarifications on the question set, you can again comment below.
What was your score in this test? What do you think about interpreting these results from the table given in the article? Do you think it ties up well to your understanding?
I got 20 , i didn't attemp SAS section.i dont know SAS, so need to work on SAS.but getting practical exposer in SAS is tought to me.we are not using SAS in our developement.give me some ideas how to start SAS.
20 is a great score. This means you have a good expertise into R and Python. The difference between SAS and R&Python is that SAS is more of analyst language and R & Python are more of coders language. Once you start using SAS, you will realize that codes in SAS are too long to do the same job you can do in a line or two in R. However, the power of SAS to handle big data is unmatchable. Now comes the most difficult bit : learning SAS. However the language is one of the easiest to code, good resources on SAS is very rare. You can have a look at the articles mentioned in this post which were published specifically for interview questions in SAS. Hope this helps. Tavish
I Scored 6 in R but failed in S A S and Python. Please Guide me or send some good tutorial and question answers on R, Python,and S A S, if possible. Your efforts will be highly appreciable.
Anoop, Score of 6 is good in R but we feel there is a scope of improvement. Identify the area in R which you can master to become an expert in R. The best part of learning R is that resources are available in plenty. On Python, again you can find good resources on web available for free. You can also have a look at the series published on Python by Kunal starting from the article (http://www.analyticsvidhya.com/blog/2014/07/baby-steps-learning-python-data-analysis/) . Now comes the most difficult bit : learning SAS. However the language is one of the easiest to code, good resources on SAS is very rare. You can have a look at the articles mentioned in this post which were published specifically for interview questions in SAS. Hope this helps. Tavish
I solved all the questions in SAS and R section correctly (didn't attempted python as I don't know that). I am very good into programming (SAS, R, SQL, Javascript, PHP) and have good understanding of statistical concepts (regression, logistic, cart), I have also completed the course "The Analytics Edge" still not able to convert any of the Analytics Inteview. Currently I am working into market research and consulting profile and have very little exposure to analytics type of work (have used regression, linear modelling at some occasions). Every time I goes into a inteview they expect some specific terms while I know the practical aspects and not the definitions or specific terms for those questions. For example recently I was asked the question on merging datasets in SAS I explained the process using set and merge statements but I feel that she was expecting the names such as one-to-one, one to many, many to many. She asked only 2 questions and it was over..... Could you help in bringing out such type of questions with expected answers?
Hi Dev, Sorry to hear about the interviews. However, you need to understand that the time available in an interview to judge a candidate is very limited. Hence, you need to work on the questions frequently asked in interviews. There are two ways to work on the same : from experience and from reading. I will recommend the later method. There are a good number of resources available on "interview question on SAS" . One of these is also mentioned in this post. Additionally, you can attempt learning Python from the series published by Kunal starting from the article (http://www.analyticsvidhya.com/blog/2014/07/baby-steps-learning-python-data-analysis/). Hope this helps. Tavish