R Programming – Data Science Interview Questions and Answers

Q1: Explain R, what is R?

A: R programming language is used for data analysis and to develop statistical software. R programming language is also used for machine learning purpose and applications.

Q2: List out some of the function that R provides?

A: The function that R provides are

  • Mean
  • Median
  • Distribution
  • Covariance
  • Regression
  • Non-linear
  • Mixed Effects
  • GLM
  • GAM. etc.

Q3: How R commands are written?

A: By using # at the starting of the line of code like #division commands are written.

Q4: Write syntax for R programming or R commands?

A: writing R command you should start the line with #, like the commands are written as #division.

Q5: What is data import in R language?

A: The user can import data in R language. R commander GUI is used to type the commands, also known as Rcmdr, which is like a console.

Q6: What is the power analysis?

A: We can use it for experimental design. Also, use to determine the effect of given sample size.

Q7: What is iPlots?

A: It is a package which provides bar plots, mosaic plots. Also, it provides box plots, parallel plots, scatters plots and histograms.

Q8: What is root cause analysis?

A: Root cause analysis was initially developed to analyze industrial accidents but is now widely used in other areas. It is a problem-solving technique used for isolating the root causes of faults or problems. A factor is called a root cause if its deduction from the problem-fault-sequence averts the final undesirable event from reoccurring.

Q9: What are covariances in R?

A: Covariance is a measure of how changes in one variable are associated with changes in a second variable. In general, it measures the degree to which two variables are linearly associated.

Q10: Explain what is transpose.

A: Basically, we use it for reshaping of the data. That further can use for analysis. Also, we can perform transpose by using t() function.

Q11: What is the goal of A/B Testing?

A: This is a statistical hypothesis testing for randomized experiments with two variables, A and B. The objective of A/B testing is to detect any changes to a web page to maximize or increase the outcome of a strategy.

Q12: What is the difference between the data frame and a matrix in R?

A: Data frame can contain heterogeneous inputs while a matrix cannot.

matrix– store only similar data type

data frame–  can be different data types like characters, integers or other data frames.

Q13: What are co-relations in R?

A: We use functions cor() or cor.test() to compute it:

For Example:

  • cor() computes the correlation coefficient.
  • cor.test() test for association/correlation between paired samples.

Q14: What is the goal of A/B Testing?

A: This is a statistical hypothesis testing for randomized experiments with two variables, A and B. The objective of A/B testing is to detect any changes to a web page to maximize or increase the outcome of a strategy.

Q15: Explain star schema.

A: It is a traditional database schema with a central table. Satellite tables map IDs to physical names or descriptions and can be connected to the central fact table using the ID fields; these tables are known as lookup tables and are principally useful in real-time applications, as they save a lot of memory. Sometimes star schemas involve several layers of summarization to recover information faster.

Q16: What are Eigenvalue and Eigenvector?

A: Eigenvectors are for understanding linear transformations. In data analysis, we usually calculate the eigenvectors for a correlation or covariance matrix. Eigenvalues are the directions along which a particular linear transformation acts by flipping, compressing or stretching

Q17: What is reshaping of data in R?

A: In R the data objects can be converted from one form to another. For example we can create a data frame by merging many lists. This involves a series of R commands to bring the data into the new format. This is called data reshaping.

Q18: Is an array a matrix or a matrix an array?

A: Every matrix can be called an array but not the reverse. Matrix is always two dimensional but array can be of any dimension.

Q19: Define MATLAB package.

A: Basically, it includes wrapper functions and variable. Also, these functions are used to replicate Matlab function calls.

Q20: What are the different data objects in R?

A: There are 6 data objects in R. They are vectors, lists, arrays, matrices, data frames and tables.

Q21: Explain BOR function?

A: Basically, it is a bitwise logical operation. Also, used to return bitwise logical OR between two statements.

Q22: How to obtain the transpose of a matrix in R?

A: The function t() is used for transposing a matrix. Example – t(m) , where m is a matrix.

Q23: Explain survivorship bias.

A: It is the logical error of focusing aspects that support surviving some process and casually overlooking those that did not because of their lack of prominence. This can lead to wrong conclusions in numerous different means.

Q24:What is the use of apply() in R?

A: It is used to apply the same function to each of the elements in an Array. For example finding the mean of the rows in every row.

Q25: What is the use of abline() function?

A: abline() function adds the reference line to a graph.

Syntax:-

abline(h=yvalues, v=xvalues)

Q26: What is lazy function evaluation in R?

A: The lazy evaluation of a function means, the argument is evaluated only if it is used inside the body of the function. If there is no reference to the argument in the body of the function then it is simply ignored.

Comments are closed.