Skip to content
tezvyn:

Top 30 Data science Interview Questions and Answers

30 multiple-choice questions on Data science, drawn from 30 bites out of the 105 tagged Data science on Tezvyn. Answer them here or read straight down. Every question carries the correct option, why it is correct, and a link to the bite it came from.

30 questions. Pick an answer, or open “Show the answer” to read it.

Answers are graded in your browser. Nothing is saved, and no XP or streak is earned here. The app keeps score.

  1. Question 1 of 30

    For which situation is a hypothesis-driven analysis LEAST appropriate?

    Show the answer

    Answer: c · Uncovering novel insights and potential trends within a newly acquired dataset.

    Hypothesis-driven analysis is designed for testing specific, falsifiable statements. Uncovering novel insights from a new dataset is an open-ended discovery task, which is better suited for exploratory data analysis rather than hypothesis testing.

    Read the full bite: Hypothesis-Driven Analysis: Ask First, Analyze Second

  2. Question 2 of 30

    When validating a composite burnout proxy, why test whether it predicts voluntary attrition six months later?

    Show the answer

    Answer: c · It establishes predictive validity by showing the proxy correlates with a meaningful future outcome

    Testing future attrition establishes predictive validity, confirming the composite index captures a construct with real downstream consequences. The most tempting distractor confuses prediction with causation: a proxy that predicts attrition does not prove burnout causes it, since unobserved confounders may drive both.

    Read the full bite: How would you build and validate a proxy target for employee burnout?

  3. Question 3 of 30

    Which core concept allows causal inference to distinguish cause-and-effect from mere association?

    Show the answer

    Answer: c · The estimation of a counterfactual outcome

    The card explicitly states that causal inference's mental model is to create a 'counterfactual'—what would have happened if the cause had not been introduced—to determine the causal effect. While identifying confounders and using RCTs are crucial methods in causal inference, the counterfactual is the underlying conceptual tool for distinguishing causation from association. Analyzing correlations is what causal inference aims to move beyond.

    Read the full bite: Causal Inference: Proving Cause, Not Just Correlation

  4. Question 4 of 30

    What is the primary advantage of using uplift modeling over a traditional conversion prediction model?

    Show the answer

    Answer: b · It enables targeting of individuals whose conversion probability is significantly increased by a specific intervention.

    Uplift modeling's core purpose is to identify 'Persuadables'—those whose behavior will change due to an intervention, maximizing the incremental impact of costly resources. Option C is incorrect because uplift's advantage is not just general prediction accuracy, but specifically predicting causal impact.

    Read the full bite: Uplift Modeling: Who to Target, Not Just Who Will Convert

  5. Question 5 of 30

    A spam filter trained on 2020 email data struggles in 2023 because spammers now use keywords previously common in legitimate emails. What type of drift is this?

    Show the answer

    Answer: b · Concept Drift, because the relationship between keywords and whether an email is spam has fundamentally altered.

    This is Concept Drift because the fundamental relationship between the input features (keywords) and the target variable (spam) has changed; what once indicated legitimate email now indicates spam. While the distribution of keywords has shifted (Data Drift), the core issue is the altered meaning of those keywords in predicting spam, which is characteristic of Concept Drift.

    Read the full bite: Data Drift vs. Concept Drift: When Models Go Stale

  6. Question 6 of 30

    You run an experiment and obtain p = 0.03. Which statement correctly interprets this p-value?

    Show the answer

    Answer: c · If the null hypothesis were true, there is a 3% probability of observing data at least this extreme.

    A p-value assumes the null hypothesis is true and quantifies the probability of seeing data at least this extreme under that assumption; it does not measure the probability that the null is false, that the alternative is true, or that the result occurred by chance.

    Read the full bite: What is a p-value? Interpret p = 0.03 at alpha = 0.05.

  7. Question 7 of 30

    Which statement accurately describes a key characteristic of a probability distribution?

    Show the answer

    Answer: b · It maps every possible outcome of a random process to its specific probability.

    A probability distribution is defined as a map of all possible outcomes and their chances, assigning a probability to each. It does not always follow a bell curve, and its purpose is to quantify uncertainty, not to predict exact outcomes or analyze deterministic processes.

    Read the full bite: Probability Distributions: Mapping Odds to Outcomes

  8. Question 8 of 30

    According to the card, what is a crucial requirement for a collection of vectors to be considered a "vector space"?

    Show the answer

    Answer: d · Performing addition or scalar multiplication on any vectors from the collection must always yield a result that is also part of that same collection.

    The card emphasizes that for a set to be a vector space, any operation (addition or scalar multiplication) must result in a vector that "is still inside the sandbox" or "is also still a 2D vector on that plane." This property, known as closure, is fundamental. Option B is incorrect because while the canonical example uses vectors from the origin, it's not a universal requirement for all vector spaces.

    Read the full bite: Vector Spaces: A Playground for Vectors

  9. Question 9 of 30

    When a medical test is 99% accurate, why does Bayes' Theorem suggest a positive result might not mean a 99% chance of having the disease?

    Show the answer

    Answer: a · The base rate, or initial prevalence of the disease in the population, significantly impacts the true probability.

    The card emphasizes that Bayes' Theorem corrects intuition by incorporating the base rate (prior probability) of the disease. A low base rate means even a highly accurate test can yield many false positives, making the posterior probability of having the disease much lower than the test's accuracy suggests. Option D is tempting but incomplete, as it doesn't explain *why* the 1% error is so impactful in this context, which is due to the base rate.

    Read the full bite: Bayes' Theorem: Updating Beliefs with Evidence

  10. Question 10 of 30

    Which scenario represents an inappropriate application for linear regression?

    Show the answer

    Answer: d · Predicting whether a customer will churn (yes/no) based on their service usage.

    Linear regression is designed to predict continuous numerical values, not categorical outcomes like 'yes/no' for customer churn. The other options involve predicting continuous numerical values, which is the primary purpose of linear regression.

    Read the full bite: Linear Regression: Finding the Line of Best Fit

  11. Question 11 of 30

    In a hypothesis test with an alpha of 0.05, what is the correct interpretation if your p-value is 0.03?

    Show the answer

    Answer: c · You have sufficient evidence to reject the null hypothesis.

    The card states that if the p-value is less than alpha (p < alpha), you 'reject the null hypothesis.' Since 0.03 is less than 0.05, the null hypothesis is rejected. The p-value is not the probability of the null hypothesis being true, which is a common misconception.

    Read the full bite: Hypothesis Testing: A Courtroom for Your Data

  12. Question 12 of 30

    In a two-proportion conversion test, which change most directly explains why detecting a 2% relative lift requires roughly 390k users per variant instead of 63k for a 5% relative lift?

    Show the answer

    Answer: a · The absolute MDE shrinks from 0.5 to 0.2 percentage points, and sample size scales roughly with the inverse square of the absolute effect size.

    The correct answer identifies that the absolute MDE falls from 0.5 to 0.2 percentage points, and because N is roughly proportional to the inverse square of the absolute MDE, required sample size balloons by about sixfold. Distractor D is tempting because it quotes the true p(1-p) variance formula from the card, but in this range variance barely changes and cannot explain the explosion in sample size.

    Read the full bite: How do you determine sample size for a conversion lift experiment?

  13. Question 13 of 30

    What is the primary conceptual role of a matrix, beyond just being a grid of numbers?

    Show the answer

    Answer: c · To represent and apply linear transformations to vectors and space.

    The card emphasizes that a matrix is fundamentally a "machine that transforms vectors" and describes "how space is stretched, rotated, or sheared." While matrices are used for solving linear equations (option A), this is a specific application of their ability to represent transformations. Options B and D misrepresent the scope or core functionality.

    Read the full bite: Matrices: The Language of Linear Transformations

  14. Question 14 of 30

    What distinguishes an eigenvector from other vectors when a linear transformation is applied?

    Show the answer

    Answer: d · It maintains its original direction, only changing its length or orientation.

    Eigenvectors are special because they stay on their original line (maintain direction) when transformed, only getting scaled (changing length or flipping orientation). Other vectors typically change both direction and magnitude. Option A describes an eigenvector with an eigenvalue of 1, which is a specific case, not the general definition.

    Read the full bite: Eigenvectors and Eigenvalues: The Unchanging Directions of a Transformation

  15. Question 15 of 30

    Despite advancements, what is a fundamental limitation of sentiment analysis?

    Show the answer

    Answer: d · Its struggle with sarcasm, implicit meaning, and context-dependent nuance, hindering deep individual understanding.

    The card explicitly states sentiment analysis "often fails on sarcasm or complex context," "is not about deep comprehension," and "struggles with domain-specific jargon, comparative sentences, and text where the sentiment is not explicitly stated," concluding it's "not deep individual understanding." This directly supports option D. While machine learning models require labeled data, the card highlights sentiment analysis's purpose as automating large-scale analysis, implying it reduces, rather than constantly requires, extensive human labeling for every new specific instance.

    Read the full bite: Sentiment Analysis: Reading the Room at Scale

  16. Question 16 of 30

    A key numerical column in your dataset has 10% null values. What is the best initial step to take?

    Show the answer

    Answer: b · Investigate the cause and distribution of the nulls to inform your handling strategy.

    The correct first step is always to investigate why data is missing before applying a solution. Dropping 10% of rows is a significant data loss, and imputing with the mean or median without understanding the data's distribution is premature.

    Read the full bite: How would you handle 10% null values in a key column?

  17. Question 17 of 30

    Which scenario best highlights the primary benefit of using a pandas DataFrame?

    Show the answer

    Answer: a · Efficiently analyzing a large CSV file containing sales figures.

    The card states that DataFrames are the 'workhorse for loading, cleaning, and analyzing tabular data in Python, like sales figures from a CSV,' highlighting their efficiency for such tasks. DataFrames are not suitable for data too large for memory, deeply nested JSON, or simple single-column lists.

    Read the full bite: pandas DataFrame: A Spreadsheet in Code

  18. Question 18 of 30

    Which task is LEAST suited for a groupby operation according to the Split-Apply-Combine strategy?

    Show the answer

    Answer: b · Creating a new column by combining values from two existing columns in the same row.

    The card explicitly states that groupby is not for simple row-wise calculations that don't depend on any group, such as multiplying two columns. Options A, B, and D correspond to Aggregation, Transformation, and Filtration, respectively, which are all valid applications of groupby.

    Read the full bite: Groupby: The Split-Apply-Combine Strategy

  19. Question 19 of 30

    What is the primary benefit of transforming a dataset from a "wide" format (e.g., cases_2020, cases_2021 as separate columns) into a tidy format (e.g., year and cases as distinct columns)?

    Show the answer

    Answer: d · It enables seamless integration with a wide array of analytical and visualization tools.

    The card states that tidy data acts as a "universal adapter" for data tools, simplifying analysis and making it the "expected input for a vast ecosystem of tools." Option C is incorrect because the card notes that "wide" format can be more human-readable for presentation.

    Read the full bite: Tidy Data: One Variable, One Column

  20. Question 20 of 30

    What is the fundamental role of the null hypothesis in scientific testing?

    Show the answer

    Answer: a · To provide a default position of no effect or no difference that requires strong evidence to overturn.

    The null hypothesis establishes a baseline assumption that there is no effect or difference, acting as a default that must be disproven with sufficient evidence. Option D describes the alternative hypothesis, which represents the effect the researcher aims to demonstrate.

    Read the full bite: Null Hypothesis: Assume No Effect Until Proven Otherwise

  21. Question 21 of 30

    What is the primary benefit of dplyr's design philosophy for data manipulation in R?

    Show the answer

    Answer: c · It offers a consistent and readable grammar for common data transformations.

    The card emphasizes that dplyr provides a "cohesive, predictable, and readable set of tools" and a "grammar for talking about data." Option C directly captures this core benefit. Option A is incorrect because the card notes data.table can be faster for extreme performance needs. Option B is wrong as the card states dplyr is not for complex, non-tabular data structures. Option D misrepresents dplyr's function; it introduces its own consistent syntax, rather than optimizing base R code.

    Read the full bite: dplyr: A Grammar for Data Manipulation

  22. Question 22 of 30

    Which scenario is LEAST suitable for leveraging Reticulate's capabilities?

    Show the answer

    Answer: a · Performing a simple, isolated Python script execution.

    The card states that for simple, one-off script execution, a system() call might be simpler than using Reticulate. The other options (A, B, D) are explicitly mentioned as key scenarios where Reticulate is beneficial for bridging R and Python environments.

    Read the full bite: R & Python Interoperability with Reticulate

  23. Question 23 of 30

    Which scenario is most appropriate for applying a Chi-Squared test?

    Show the answer

    Answer: b · Determining if there's a statistically significant association between two categorical variables.

    The Chi-Squared test is specifically designed to assess the association or independence between two categorical variables, as stated in the card. It explicitly notes that the test 'only shows association, not causation,' making option D incorrect.

    Read the full bite: Chi-Squared Test: Are These Two Things Related?

  24. Question 24 of 30

    What is the primary problem web scraping aims to solve?

    Show the answer

    Answer: d · Providing a method to gather public data from websites lacking a dedicated API.

    The card states web scraping exists to "bridge this gap, allowing automated collection of public data directly from websites when a more structured access method isn't provided," referring to APIs. Distractor A is incorrect because the card warns that "assuming scraping cleans the data" is a common misconception.

    Read the full bite: Web Scraping: Automating Data Collection from Websites

  25. Question 25 of 30

    What is a primary drawback of applying the Bonferroni correction, especially with many comparisons?

    Show the answer

    Answer: a · It becomes excessively conservative, making it harder to detect real effects.

    The correct answer is C because the card states that with many comparisons, the Bonferroni correction 'becomes so conservative that it dramatically increases your chance of a false negative (missing a real effect).' Option C is incorrect because the Bonferroni correction's purpose is to reduce the chance of a Type I error (incorrectly rejecting a true null hypothesis), not increase it.

    Read the full bite: Bonferroni Correction: Raising the Bar for Significance

  26. Question 26 of 30

    According to the mental model for handling duplicates, what is the primary goal?

    Show the answer

    Answer: c · To consolidate fragmented information into a single, complete, and accurate record.

    The card states the mental model's goal is to "merge them into a single, complete, and accurate record," emphasizing intelligent reconciliation over simple deletion. Option B is a common misconception and explicitly warned against as a "footgun" because it can lead to loss of valuable information or valid transactional data.

    Read the full bite: Handling Duplicate Data

  27. Question 27 of 30

    If an A/B test for a new website feature yields a p-value of 0.02, what is the most accurate interpretation?

    Show the answer

    Answer: b · There is a 2% chance of observing results as extreme as these, assuming the new feature has no actual effect.

    A p-value indicates the probability of seeing your results by chance, assuming the null hypothesis (no effect) is true. It does not state the probability of the null hypothesis being true, nor does it guarantee the alternative hypothesis.

    Read the full bite: P-Value: Gauging Surprise, Not Certainty

  28. Question 28 of 30

    What is the main reason for applying feature scaling in machine learning preprocessing?

    Show the answer

    Answer: a · To ensure that features with widely different numerical ranges contribute equally to distance-based or gradient calculations.

    Feature scaling's primary goal is to prevent features with larger numerical ranges from dominating calculations in algorithms sensitive to magnitude, ensuring all features have comparable influence. While scaling can sometimes indirectly aid generalization, its main purpose is not to prevent overfitting, which is typically addressed by regularization.

    Read the full bite: Feature Scaling: Putting Your Data on the Same Yardstick

  29. Question 29 of 30

    What is the primary reason for using one-hot encoding for categorical features in machine learning?

    Show the answer

    Answer: a · To enable machine learning models to process non-numeric categorical data without assuming an arbitrary order.

    One-hot encoding converts categorical data into a numerical format that machine learning models can understand, crucially doing so without implying any false ordinal relationship or ranking between the categories. Option D is incorrect because one-hot encoding specifically aims to avoid assigning numerical ranks, as this would create a misleading sense of order for nominal data.

    Read the full bite: One-Hot Encoding: Turning Categories into Numbers

  30. Question 30 of 30

    In which scenario would applying binning to a continuous feature be most beneficial?

    Show the answer

    Answer: c · When preparing data for algorithms that specifically require categorical features.

    The card explicitly states binning is useful for "converting continuous features into categorical ones for certain algorithms." Option D is incorrect because binning smooths out minor variations, which would be detrimental to preserving them for detailed anomaly detection.

    Read the full bite: Binning: Grouping Continuous Data into Buckets

Could you explain these out loud?

That is what an interview actually tests. Tezvyn gives you questions like these with what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon