Skip to content
tezvyn:
Menu

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. Quiz progress is not saved, and no XP or streak is earned here. The app keeps score.

  1. Question 1 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

  2. Question 2 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

  3. Question 3 of 30

    What is the primary purpose of using a histogram in data analysis?

    Show the answer

    Answer: c · To understand the shape, central tendency, and spread of a single continuous variable.

    A histogram is used to visualize the distribution of a single continuous variable, helping to understand its shape, central tendency, and spread. It is not suitable for comparing multiple categories, showing data over time, or displaying categorical data, which are common misconceptions.

    Read the full bite: Histogram: See the Shape in Your Data

  4. Question 4 of 30

    During EDA, a heatmap reveals a strong positive correlation between daily ice cream sales and sunscreen sales. What is the most appropriate next step before making causal business recommendations?

    Show the answer

    Answer: d · Investigate potential confounders such as outdoor temperature and examine partial correlations before making causal recommendations.

    The card emphasizes that a strong heatmap correlation should prompt a search for confounders such as temperature and further analysis like partial correlation, not a causal conclusion. Option B is wrong because heatmap color intensity reflects linear association, not causal strength, which is a key red flag mentioned.

    Read the full bite: Explain correlation vs causation and heatmap limitations in EDA

  5. Question 5 of 30

    What is the primary advantage of a box plot when comparing distributions of several datasets?

    Show the answer

    Answer: c · It offers a compact visual summary, facilitating quick comparison of central tendency, spread, and outliers across groups.

    The card emphasizes that box plots provide a "compact way to see a dataset's central tendency, spread, and skewness, especially when comparing multiple datasets at once." Option A is incorrect because the line in a box plot represents the median, not the mean, and the median is often more robust to outliers than the mean.

    Read the full bite: Box Plot: See a Distribution's Shape at a Glance

  6. Question 6 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

  7. Question 7 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

  8. Question 8 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

  9. Question 9 of 30

    What is the primary role of the logistic (sigmoid) function within a logistic regression model?

    Show the answer

    Answer: a · To transform the linear combination of input features into a probability score between 0 and 1.

    The logistic function takes the weighted sum of inputs and maps it to a value between 0 and 1, which represents the probability of the event occurring. It does not directly output a binary classification; that requires an additional thresholding step.

    Read the full bite: Logistic Regression: Predicting a Yes or No Outcome

  10. Question 10 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.

  11. Question 11 of 30

    What is a primary reason to choose a decision tree model for a predictive task?

    Show the answer

    Answer: c · Their straightforward interpretability and explainability to non-technical stakeholders.

    The card emphasizes that decision trees are chosen when model interpretability is critical, making them easy to understand and explain. The card also states that single decision trees are highly prone to overfitting and that ensemble methods generally offer higher accuracy.

    Read the full bite: Decision Tree Learning: A Flowchart for Your Data

  12. Question 12 of 30

    What is the core iterative process that drives k-Means clustering?

    Show the answer

    Answer: c · Data points are assigned to the nearest centroid, and then each centroid is relocated to the average position of its assigned points.

    The card explicitly states the k-Means process involves iteratively assigning data points to their nearest centroid and then moving each centroid to the mean (average location) of its assigned points. Option B describes hierarchical clustering, not k-Means.

    Read the full bite: k-Means Clustering: Grouping Data Around Centroids

  13. Question 13 of 30

    What is the primary objective of structuring a data presentation using a narrative arc?

    Show the answer

    Answer: a · To persuade stakeholders by guiding them from an initial problem to a recommended solution.

    The card explicitly states that data storytelling is used "to persuade an audience" and "to lead an audience through your analytical process to a specific recommendation." While simplifying complex data (C) and aiding memory (D) can be benefits, the core purpose is persuasion and driving action from a problem to a solution. Presenting all raw data (B) is contrary to the concept of a focused narrative.

    Read the full bite: Data Storytelling: Using Narrative to Drive Insight

  14. Question 14 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

  15. Question 15 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?

  16. Question 16 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

  17. Question 17 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

  18. Question 18 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

  19. Question 19 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

  20. Question 20 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

  21. Question 21 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

  22. Question 22 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

  23. Question 23 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?

  24. Question 24 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

  25. Question 25 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

  26. Question 26 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

  27. Question 27 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?

  28. Question 28 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

  29. Question 29 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

  30. Question 30 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

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