Over 100 Data Science Interview Questions
A fresh scrape from Glassdoor gives us a good idea about what applicants are asked during a data scientist interview at some of the top companies. Unfortunately for us, almost every company has their interviewees sign NDAs. Since Glassdoor allows anonymity, a few brave souls have given us some fantastic examples of what they were asked during the interview process at top companies like Facebook, Google, and Microsoft.
If you'd like to share your answer(s) to any of the questions, leave a comment and I'll add the top ones to the post. Just make sure to comment with your real name so I can give you credit!
Also, if you don't see a particular question on this list that you've been asked, or you know of one that's asked a lot, comment below. I'd love to add it.
Suppose you’re given millions of users that each have hundreds of transactions and these millions of transactions are for tens of thousands of products. How would you group the users together in meaningful segments?
Describe a project you’ve worked on and how it made a difference.
How would you approach a categorical feature with high-cardinality?
What would you do to summarize a Twitter feed?
What are the steps for wrangling and cleaning data before applying machine learning algorithms?
How do you measure distance between data points?
Describe the differences between and use cases for box plots and histograms.
What features would you use to build a recommendation algorithm for users?
Pick any product or app that you really like and describe how you would improve it.
How would you find an anomaly in a distribution ?
How would you go about investigating if a certain trend in a distribution is due to an anomaly?
How would you estimate the impact Uber has on traffic and driving conditions?
What metrics would you consider using to track if Uber’s paid advertising strategy to acquire new customers actually works? How would you then approach figuring out an ideal customer acquisition cost?
Machine Learning Questions
Why do you use feature selection?
What is the effect on the coefficients of logistic regression if two predictors are highly correlated? What are the confidence intervals of the coefficients?
What’s the difference between Gaussian Mixture Model and K-Means?
How do you pick k for K-Means?
How do you know when Gaussian Mixture Model is applicable?
Assuming a clustering model’s labels are known, how do you evaluate the performance of the model?
What’s an example of a machine learning project you’re proud of?
Choose any machine learning algorithm and describe it.
Describe how Gradient Boosting works.
Data Mining Describe the decision tree model.
Data Mining What is a neural network?
Explain the Bias-Variance Tradeoff
How do you deal with unbalanced binary classification?
What’s the difference between L1 and L2 regularization?
What sort features could you give an Uber driver to predict if they will accept a ride request or not? What supervised learning algorithm would you use to solve the problem and how would compare the results of the algorithm?
How do you prevent overfitting?
How do you deal with outliers in your data?
How do you analyze the performance of the predictions generated by regression models versus classification models?
How do you assess logistic regression versus simple linear regression models?
What’s the difference between supervised learning and unsupervised learning?
What is cross-validation and why would you use it?
What’s the name of the matrix used to evaluate predictive models?
What relationships exist between a logistic regression’s coefficient and the Odds Ratio?
What’s the relationship between Principal Component Analysis (PCA) and Linear & Quadratic Discriminant Analysis (LDA & QDA)
If you had a categorical dependent variable and a mixture of categorical and continuous independent variables, what algorithms, methods, or tools would you use for analysis?
Business Analytics What’s the difference between logistic and linear regression? How do you avoid local minima?
What data and models would would you use to measure attrition/churn? How would you measure the performance of your models?
Explain a machine learning algorithm as if you’re talking to a non-technical person.
How would you build a model to predict credit card fraud?
How do you handle missing or bad data?
How would you derive new features from features that already exist?
If you’re attempting to predict a customer’s gender, and you only have 100 data points, what problems could arise?
Suppose you were given two years of transaction history. What features would you use to predict credit risk?
Design an AI program for Tic-tac-toe
Explain overfitting and what steps you can take to prevent it.
Why does SVM need to maximize the margin between support vectors?
How would you use Map/Reduce to split a very large graph into smaller pieces and parallelize the computation of edges according to the fast/dynamic change of data?
Data Engineer Given a list of followers in the format:123, 345234, 678345, 123…Where column one is the ID of the follower and column two is the ID of the followee. Find all mutual following pairs (the pair 123, 345 in the example above). How would you use Map/Reduce to solve the problem when the list does not fit in memory?
Data Engineer What is Hadoop serialization?
Explain a simple Map/Reduce problem.
Data Engineer Explain how RDDs work with Scala in Spark
Statistics & Probability Questions
Explain Cross-validation as if you’re talking to a non-technical person.
Describe a non-normal probability distribution and how to apply it.
Data Mining Explain what heteroskedasticity is and how to solve it
Given Twitter user data, how would you measure engagement?
What are some different Time Series forecasting techniques?
Explain Principle Component Analysis (PCA) and equations PCA uses.
How do you solve Multicollinearity?
Analyst Write an equation that would optimize the ad spend between Twitter and Facebook.
What’s the probability you’ll draw two cards of the same suite from a single deck?
What are p-values and confidence intervals?
Data Analyst If you have 70 red marbles, and the ratio of green to red marbles is 2 to 7, how many green marbles are there?
What would the distribution of daily commutes in New York City look like?
Given a die, would it be more likely to get a single 6 in six rolls, at least two 6s in twelve rolls, or at least one-hundred 6s in six-hundred rolls?
What’s the Central Limit Theorem, and how do you prove it? What are its applications?
Programming & Algorithms
Data Analyst Write a program that can determine the height of an arbitrary binary tree
Create a function that checks if a word is a palindrome.
Build a power set.
How do you find the median of a very large dataset?
Data Engineer Code a function that calculates the square root (2-point precision) of a given number. Follow up: Avoid redundant calculations by now optimizing your function with a caching mechanism.
Suppose you’re given two binary strings, write a function adds them together without using any builtin string-to-int conversion or parsing tools. For example, if you give your function binary strings 100 and 111, it should return 1011. What’s the space and time complexity of your solution?
Write a function that accepts two already sorted lists and returns their union in a sorted list.
What’s the computational complexity of finding a document’s most frequently used words?
If you’re given 10 TBs of unstructured customer data, how would you go about finding extracting valuable information from it?
Data Engineer How would you ‘disjoin’ two arrays (like JOIN for SQL, but the opposite)?
Create a function that does addition where the numbers are represented as two linked lists.
Create a function that calculates matrix sums.
How would you use Python to read a very large tab-delimited file of numbers to count the frequency of each number?
Write a function that takes a sentence and prints out the same sentence with each word backwards in O(n) time.
Write a function that takes an array, splits the array into every possible set of two arrays, and prints out the max differences between the two array’s minima in O(n) time.
Write a program that does merge sort.
Data Analyst Define and explain the differences between clustered and non-clustered indexes.
Data Analyst What are the different ways to return the rowcount of a table?
Data Engineer If you’re given a raw data table, how would perform ETL (Extract, Transform, Load) with SQL to obtain the data in a desired format?
How would you write a SQL query to compute a frequency table of a certain attribute involving two joins? What changes would you need to make if you want to ORDER BY or GROUP BY some attribute? What would you do to account for NULLS?
Questions sourced from Glassdoor
Don't see a particular question? Know an answer to a question above? Comment below and I'll add it!
- K-Means & Other Clustering Algorithms: A Quick Intro with Python
- Predicting Housing Prices with Linear Regression using Python, pandas, and statsmodels