Learn everything about Analytics

Test your level of expertise with SAS/R/Python

, / 16

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.

Analytics and Big Data Salary Report



Section 1 : SAS

Question 1) The following program is submitted.


input Name $ Age;


John +35 ;


Which values are stored in the output data set?

  1. Name              Age
    John               35
  2. Name              Age
    John              (missing value)
  3. Name              Age
    (missing value)   (missing value)
  4. The DATA step fails execution due to data errors.

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:

  X = 0;
  do Index = 1 to 5  by  2;
    X = Index;

Upon completion of execution, what are the values of the variables X and Index in the SAS data set named WORK.LOOP?

  1. X = 3, Index = 5
  2. X = 5, Index = 5
  3. X = 5, Index = 6
  4. X = 5, Index = 7

Question 5) The following SAS program is submitted:


What is the value of Char2?

  1. 23
  2. 34
  3. 345
  4. 2345

Section 2 : Python

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

Section 3: R

Question 1) Which of the following statistical techniques cannot be implemented on R?

A. Logistic Regression



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.



End Notes

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?

If you like what you just read & want to continue your analytics learningsubscribe to our emailsfollow us on twitter or like our facebook page.


  • sravan says:

    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.

    • Tavish Srivastava says:

      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.

  • Anoop says:

    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.

    • Tavish Srivastava says:

      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.

  • Dev says:

    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?

    • Tavish Srivastava says:

      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.

  • Chaitanya Prabhu says:

    Good to undergo these (sas) short test to know the depth of our understanding.
    Presently i am learning Sas since 4 months. Attempted only Sas and scored 6.
    Thank you

  • Deval says:

    I attempted and cleared all 5 questions in SAS. But I couldn’t attempt other questions in R and Python as I am currently working on SAS(retail) and have only knowledge on SAS. My concern is about R and Python. How equally important is R and Python in Analytics? and does it help in Clinical domain, too? Can you also guide on one more query. Which one is better Clinical or non Clinical (like Retail, financial sectors) to work in long terms.


    • Tavish says:


      You have raised multiple queries in your comment. Let me address them one by one as per by best knowledge. R and Python are becoming more and more important with time. The reason being we no longer do only basic data mining. Advanced analytics are very handy on R and Python. In clinical domain currently SAS is the most widely used language. R and Python might play a role later in time but not used much currently. Coming to your last query, it all depends on your interest. Work in non-clinincal sector is more about building marketing strategy and risk analysis. Whereas Clinical trials is more about data handling.

      Hope this helps.

  • Akshay says:

    I have started working on R in last week(using R tutorials on youtube), since its freeware & material is easily available.
    I scored 8 in R.
    I decided to concentrate more on R and statistics theory + applications & get mastery in R + Stats.
    Another reason, not going for SAS & Python, is that these sofwares are not easily available for practise.

    Questions : 1.Suggest me whether my approach is correct or not?
    2.Where can I find systematic material for R which I can follow?

    • Tavish says:


      That is fair approach. But I will first like to know the objective you wish to achieve before making any kind of recommendations. Coming to your 2nd question, you can take one of the coursers offered on Coursera on R. It is one of the best freely available resources. This is a beginners level course and will help you build a strong foundation. You need to first define the objective of your career before taking any of the advanced R courses.

      Hope this helps.

  • Atreya Biswas says:

    I scored 20 marks and attempted only the R and Python part.
    Can you suggest some materials where I can got through the basics in SAS ?
    Thanks and Regards,

    • Tavish Srivastava says:

      Hi Atreya,
      Congrats for the great score.The language SAS is one of the easiest to code, but 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. You can also do few trainings offered by SAS institute and Jigsaw to learn SAS.

      Hope this helps.

  • Nitesh says:

    Hi Tavish ,

    Thanks for giving the opportunity test these skill(especially for those aspiring analyst,like me ) . I have scored 16/20 from SAS and R .I don’t have any idea of Python .How you see my score as an analyst.

    I am trying to shift my career to analytics field and I have done certification in SAS and R , also working on kaggle competition .I have 2+ yrs professional background in Business Analysis and Business Process .I am not getting any interview call .Because for every opening they are looking for experienced candidate from same background . How should I ahead to get my first break .


Leave A Reply

Your email address will not be published.

Join world’s fastest growing Analytics Community
Receive awesome tips, guides, infographics and become expert at: