Data Scientist (R) Interview Questions & Answers
40 questions for Data Scientist (R) interviews — 4 easy, 31 medium, 5 hard.
About the Data Scientist (R) role
A Data Scientist using R builds predictive models for churn, risk, demand and pricing, from feature engineering to evaluation and deployment. They use tidymodels, glmnet, ranger and forecasting packages, explain models to business teams and monitor them after launch. The role combines statistics, programming and business sense and is common in analytics consultancies, banks and e-commerce firms. Experience with SQL and cloud platforms adds further value in interviews.
How do you perform a t-test in R?
Show answer
A customer table has multiple records per customer. How do you keep only the latest record for each?
Show answer
Why do we split data into training and test sets, and what is cross-validation?
Show answer
What is the multiple testing problem and how do you correct for it?
Show answer
Your function gives correct results when you test it but wrong results in the main script. What could be the cause?
Show answer
How do you produce descriptive statistics for each group in R?
Show answer
How do you validate inputs inside an R function?
Show answer
How do you reshape data between wide and long formats in R?
Show answer
Write code using map2() and pmap() to iterate over multiple inputs.
Show answer
A manager says a test with p = 0.06 proves the change had no effect. How do you respond?
Show answer
How do you check whether data is normally distributed in R?
Show answer
Tell me about a time a model you built did not perform as expected after deployment.
Show answer
How do you calculate ROC AUC and plot an ROC curve in R?
Show answer
Your data is heavily skewed and the sample is small. Can you still use a t-test?
Show answer
Product wants to detect a lift in conversion from 5 to 5.5 percent. How many users do you need per group?
Show answer
Why should we hire you as a fresher for an R analyst role?
Show answer
You are building a fraud model where only 0.5 percent of transactions are fraud. How do you handle the imbalance?
Show answer
How do you build a logistic regression model for churn in R?
Show answer
Why is ungroup() important in dplyr?
Show answer
How does a random forest work and which R packages implement it?
Show answer
What is the difference between Pearson and Spearman correlation?
Show answer
Explain the d, p, q and r functions for probability distributions in R.
Show answer
How do you handle errors in R code?
Show answer
Write dplyr code to find total and average sales by city, sorted by total.
Show answer
What is the purrr map family?
Show answer
What are semi_join() and anti_join() used for?
Show answer
How do you apply the same transformation to many columns in dplyr?
Show answer
What is the difference between reactive(), observe() and observeEvent() in Shiny?
Show answer
What is tidymodels and how does it compare with caret?
Show answer
How do you test whether two categorical variables are related in R?
Show answer
Explain Type I and Type II errors.
Show answer
Your model has R-squared 0.92 on training data but 0.55 on test data. What do you do?
Show answer
Tell me about feedback you received in a code review and what you changed.
Show answer
Some stakeholders are colour-blind. How do you design charts for them?
Show answer
What is the difference between errors, warnings and messages in R?
Show answer
How would you compare R and Python for a data role?
Show answer
What window functions does dplyr provide?
Show answer
How do you do feature engineering with recipes in tidymodels?
Show answer
Walk me through an end-to-end machine learning project you have done in R.
Show answer
Frequently asked questions
What does a Data Scientist (R) do?
A Data Scientist using R builds predictive models for churn, risk, demand and pricing, from feature engineering to evaluation and deployment. They use tidymodels, glmnet, ranger and forecasting packages, explain models to business teams and monitor them after launch. The role combines statistics, programming and business sense and is common in analytics consultancies, banks and e-commerce firms. Experience with SQL and cloud platforms adds further value in interviews.
Which skills are tested in a Data Scientist (R) interview?
Expect questions on tidymodels, Feature engineering, Model evaluation, Forecasting, Model deployment. Most rounds also ask you to explain a project and solve one practical problem live.
How do I prepare for a Data Scientist (R) interview?
Revise Modelling and Machine Learning in R, Statistics and Hypothesis Testing, Data Wrangling with dplyr and tidyr, Functions and Functional Programming first using the topic sheets, practise the questions on this page aloud, then do one full mock interview to practise timing.