Skip to content
tezvyn:

Top 30 Data Science & Analytics Interview Questions and Answers

30 multiple-choice questions on Data Science & Analytics, of the kind that come up in a technical interview, drawn from 30 bites in the Data Science & Analytics library. 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.

Analysis, notebooks, visualization, pandas, statistics

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

    Which approach best demonstrates a sound framework for measuring e-commerce user engagement?

    Show the answer

    Answer: a · Use DAU/MAU, adoption, retention, and stickiness tied to conversion and churn

    The card defines a strong framework as linking DAU/MAU, adoption, retention, and stickiness to trial conversion and churn. Tracking total page views is a red-flag vanity metric because it is untied to those outcomes.

    Read the full bite: What metrics track e-commerce user engagement and how do you prioritize them?

  2. Question 2 of 30

    An e-commerce site sees search users convert at 5% and non-search users at 2%. What is the best next step to estimate the true incremental impact of search?

    Show the answer

    Answer: a · Match searchers to similar non-searchers using device, landing page, and prior sessions, then compare rates

    Matching on confounders like device and landing page isolates selection bias, which is why the example shows the true incremental lift drops to roughly 25% after propensity matching. Running a two-sample t-test on the raw rates assumes the groups are comparable and would incorrectly validate an inflated, non-causal difference.

    Read the full bite: How would you validate that search users are more likely to purchase?

  3. Question 3 of 30

    A monthly subscriber cancels mid-cycle but retains access until month-end. Which approach reflects a rigorous churn definition for this user?

    Show the answer

    Answer: a · Waiting until the billing period ends or a reactivation window passes

    A rigorous definition ties churn to the actual end of access or the close of a defined renewal window, not just the intent signal. Counting the cancellation click immediately is the naive error highlighted in the card, because the user may still revert and the revenue is still active through the billing period.

    Read the full bite: How do you define churn for a subscription service?

  4. Question 4 of 30

    A checkout A/B test shows significantly higher conversion but slightly lower AOV. What is the strongest basis for a launch recommendation?

    Show the answer

    Answer: d · Estimate net revenue and ensure the AOV decline is within a pre-specified non-inferiority margin

    The right framework classifies conversion as a success metric and AOV as a guardrail requiring non-inferiority, then uses net revenue to judge the business outcome. Treating AOV as a co-success metric that must significantly increase is a tempting error that causes unnecessary conservatism and missed wins.

    Read the full bite: How would you recommend launching a checkout flow with mixed A/B metrics?

  5. Question 5 of 30

    A marketing team debates predicting exact spend versus High/Medium/Low tiers. What most strongly determines whether regression or classification is the better framing?

    Show the answer

    Answer: a · Whether the downstream campaign action requires a ranked list and continuous segmentation or a hard gate into fixed segments.

    The campaign action dictates whether you need a ranked continuous score or a discrete gate, making B correct. D is tempting but dangerous because choosing classification solely for yes/no simplicity ignores the information loss from binarizing a continuous signal and may mismatch flexible budget allocation.

    Read the full bite: How do you frame high-value customer identification as classification versus regression?

  6. Question 6 of 30

    Why is the correlation between profile completion and retention weak evidence that forcing completion will improve retention?

    Show the answer

    Answer: d · Engaged users self-select into completing profiles, confounding the relationship

    Motivated users both complete profiles and retain, so engagement is a confounder making completion a marker rather than a proven cause. A randomized experiment is needed; the other options misstate the actual problem.

    Read the full bite: Does forcing profile completion cause retention?

  7. Question 7 of 30

    What is the most important addition to a revenue metric when evaluating a change that may harm long-term satisfaction?

    Show the answer

    Answer: b · Long-horizon guardrail metrics like retention plus a sufficiently long experiment

    Long-term harm surfaces as delayed churn, so guardrail metrics measured over a long-enough window are essential to weigh against the immediate revenue lift. More precise short-term revenue alone still misses the delayed retention cost.

    Read the full bite: Framing ad-load tradeoffs: revenue versus retention

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

  9. Question 9 of 30

    Which hypothesis pair best tests whether a green signup button increases registrations compared to blue?

    Show the answer

    Answer: b · H0: The registration conversion rate for green equals that for blue; H1: The registration conversion rate for green is strictly greater than that for blue.

    The correct answer frames H0 as no difference and H1 as a directional increase in the specific metric, matching the one-tailed nature of the business question. Option A is tempting because it uses 'no difference,' but it wrongly uses a two-tailed alternative that ignores the directional ask and wastes statistical power.

    Read the full bite: What are your null and alternative hypotheses for this A/B test?

  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 justifies using a z-test for a population mean when the underlying data are heavily skewed?

    Show the answer

    Answer: a · The sampling distribution of the sample mean becomes approximately normal for large n

    The CLT states that the sampling distribution of the sample mean approaches normality as n grows, which justifies using z-tests even when the population is skewed. Option B describes the Law of Large Numbers, a common look-alike that explains convergence to a single value rather than the bell-curve shape required for inference.

    Read the full bite: Explain the Central Limit Theorem and its importance for hypothesis testing

  12. Question 12 of 30

    Which statement correctly describes how increasing model complexity affects bias and variance?

    Show the answer

    Answer: b · Bias decreases but variance increases because the fit depends more on the specific training sample.

    The card explains that increasing complexity reduces bias by fitting training data more closely but simultaneously increases variance by making predictions dependent on the specific sample. Option D is the most tempting distractor because it reflects the common red-flag misconception that adding parameters improves both error sources.

    Read the full bite: Describe the bias-variance tradeoff and how model complexity affects bias and variance

  13. Question 13 of 30

    A medical model reports 99% accuracy on a disease with 1% prevalence. Which observation best shows why accuracy is misleading?

    Show the answer

    Answer: a · The model could predict every patient is healthy and still score 99%.

    When prevalence is 1%, an all-negative classifier automatically achieves 99% accuracy while detecting zero actual cases, proving accuracy can mask total failure. Distractor A is a common misconception the card explicitly warns against, as the problem is class imbalance rather than sample size.

    Read the full bite: Why is 99% accuracy misleading with 1% disease prevalence?

  14. Question 14 of 30

    What happens when the learning rate in gradient descent is set too high?

    Show the answer

    Answer: a · Steps overshoot the minimum and the loss may oscillate or diverge

    Too large a step size overshoots the minimum, causing oscillation or divergence instead of convergence. A high rate does not guarantee faster or correct convergence, and it does not change how the gradient is computed.

    Read the full bite: How gradient descent and the learning rate work

  15. Question 15 of 30

    In PCA on mean-centered data, what does the eigenvalue associated with a principal component directly represent?

    Show the answer

    Answer: d · The variance of the data projected onto that component's direction

    Each eigenvalue equals the variance captured along its eigenvector, which is why components are ranked by eigenvalue. Accuracy is a downstream model metric, not what the eigenvalue measures.

    Read the full bite: Eigenvalues, eigenvectors, and their role in PCA

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

  17. Question 17 of 30

    Under what condition does MAP estimation give essentially the same result as MLE?

    Show the answer

    Answer: a · When the prior is uniform or the dataset is very large

    A uniform prior makes the posterior proportional to the likelihood, and with large data the likelihood overwhelms any prior, so MAP converges to MLE. A strong prior on small data does the opposite.

    Read the full bite: MLE versus MAP estimation and the role of priors

  18. Question 18 of 30

    A pandas DataFrame has 5% missing values in customer_age, completely at random. When is dropna the better choice over fillna?

    Show the answer

    Answer: c · When generating a quick aggregate report and the remaining 95% of data is sufficient

    The card states that dropna is safe for a quick aggregate report when data is missing completely at random and the remaining sample is still large enough. Option A describes the opposite scenario: when age is predictive, dropping rows discards valuable labeled outcomes and reduces model performance, so imputation is preferred instead.

    Read the full bite: Describe strategies for handling missing values in pandas DataFrames

  19. Question 19 of 30

    For a DataFrame with a string index, which call raises an error and why?

    Show the answer

    Answer: d · df.iloc['x'], because iloc requires integer positions not labels

    iloc is strictly positional and rejects a string label, raising a TypeError. df.loc['x'] and df.iloc[0] both work correctly on a string-indexed frame.

    Read the full bite: Pandas loc versus iloc indexing

  20. Question 20 of 30

    When converting a large list of flat dictionaries to a pandas DataFrame, which method minimizes Python-level overhead by leveraging vectorized C-backed construction?

    Show the answer

    Answer: c · Pass the list of dicts directly to pd.DataFrame so the constructor builds the block manager in one pass

    Passing the list directly to pd.DataFrame leverages a C-backed constructor that builds the block manager in a single vectorized pass. Option D is tempting but wrong because iteratively using pd.concat creates a new DataFrame each iteration, resulting in quadratic time complexity from repeated memory copies.

    Read the full bite: Most efficient way to convert list of dicts to pandas DataFrame

  21. Question 21 of 30

    You need to combine customers and transactions on customer_id to compute total spend per customer, including those with zero transactions. Which approach correctly uses pandas?

    Show the answer

    Answer: b · Use pd.merge with how='left' on customer_id, then group by customer, sum amounts, and fill NaN totals with zero

    A left join preserves every customer and shows NaN for missing transactions, which you fill with zero after grouping; an inner join is tempting because it is the pandas default, but it silently drops customers with no matching transactions.

    Read the full bite: How would you combine customer and transaction DataFrames and describe join types?

  22. Question 22 of 30

    When squaring a million-element NumPy array, why is np.square(arr) orders of magnitude faster than a Python for-loop?

    Show the answer

    Answer: b · It delegates to pre-compiled C loops on contiguous memory, avoiding Python interpreter overhead per element.

    NumPy vectorization dispatches operations to C ufuncs on contiguous buffers, eliminating per-element Python interpreter dispatch and object boxing. The most tempting distractor confuses vectorization with parallel processing, yet the card explicitly states that standard NumPy vectorization is single-threaded unless an external multithreaded library is used.

    Read the full bite: What is vectorization in NumPy and pandas?

  23. Question 23 of 30

    Which single expression best computes total and average Sales_Amount per Region in pandas?

    Show the answer

    Answer: b · Select Sales_Amount after groupby and use agg with named aggregations

    Selecting the column and using named aggregation computes both statistics in a single vectorized pass with clean column names. Option C is a common anti-pattern that runs two separate groupby passes and requires manual merging, which is slower and harder to maintain.

    Read the full bite: Calculate total and average sales per region in pandas

  24. Question 24 of 30

    Which code correctly and efficiently extracts weekday names like 'Monday' from a pandas DataFrame column of timestamp strings?

    Show the answer

    Answer: b · pd.to_datetime(df['ts']).dt.day_name()

    pd.to_datetime vectorizes parsing to datetime64 without Python loops, and the .dt accessor exposes day_name(); wrapping conversion in apply processes rows one by one and destroys performance, while calling day_name directly on a string or Series raises an AttributeError.

    Read the full bite: Convert string timestamps to datetime and extract day of week

  25. Question 25 of 30

    When aggregating a 50GB CSV on a 16GB machine, which strategy keeps peak memory usage proportional to a small fragment rather than the entire file?

    Show the answer

    Answer: c · Iterate with read_csv(chunksize=...), aggregating each fragment and discarding it before reading the next

    Streaming with chunksize processes only one fragment at a time, keeping memory bounded by that fragment instead of the full 50GB. Option A is tempting because filtering columns and downcasting dtypes are valid optimizations, but materializing the entire file in a single DataFrame still exhausts RAM.

    Read the full bite: Process a 50GB CSV with only 16GB RAM

  26. Question 26 of 30

    You convert a 10-million-row DataFrame's string column with 6 million unique values to category. What is the likely effect on memory usage?

    Show the answer

    Answer: b · Memory increases because the category codes plus unique values list outweigh a simple object array.

    When cardinality exceeds roughly fifty percent of row count, the storage cost of category codes plus the unique values list exceeds that of a plain object array. Option A is a common misconception that category dtype always reduces memory, but it is only beneficial for low-cardinality columns.

    Read the full bite: How do you analyze and reduce large pandas DataFrame memory usage?

  27. Question 27 of 30

    Which query pattern correctly identifies customers who have never placed an order?

    Show the answer

    Answer: b · LEFT JOIN orders then filter WHERE orders.customer_id IS NULL

    C uses the correct anti-join pattern: LEFT JOIN preserves all customers and IS NULL keeps only those with no matching orders. D is tempting because it looks like logical negation, but if orders.customer_id contains any NULLs, NOT IN unexpectedly returns an empty set instead of the desired customers.

    Read the full bite: Find customers who have not placed any orders

  28. Question 28 of 30

    Which approach correctly handles the full response lifecycle when fetching JSON from a REST API in production using Python's requests?

    Show the answer

    Answer: c · Verify the status with r.raise_for_status() before parsing with r.json()

    Calling r.raise_for_status() before r.json() catches HTTP errors like 404 or 500 before parsing fails. Skipping the status check is a major red flag because error responses often do not contain valid JSON, causing r.json() to crash.

    Read the full bite: How do you fetch JSON from a REST API and parse it?

  29. Question 29 of 30

    Why is it important for a scraper to follow robots.txt directives on a publicly accessible website?

    Show the answer

    Answer: a · Because ignoring it can lead to IP bans, legal liability, and unnecessary server load for the target site

    Ignoring robots.txt risks IP bans, legal action under laws like the CFAA, and added server costs for the target site. The most tempting distractor wrongly treats the file as a security boundary that hides pages, but it only requests polite crawler behavior and does not actually restrict access.

    Read the full bite: What is robots.txt, why respect it, and consequences of ignoring it?

  30. Question 30 of 30

    Which client-side strategy best maximizes throughput for a 100 req/min API without triggering excessive 429 errors?

    Show the answer

    Answer: b · Bound concurrency to a small worker pool, proactively pace requests using rate-limit headers, and apply exponential backoff with jitter on 429s.

    The correct answer combines proactive throttling, header-aware dynamic pacing, bounded concurrency, and resilient retries as described in the card. Option A is tempting because it limits concurrency, but it still creates burst traffic and ignores headers, relying on the server to punish the client rather than preventing 429s proactively.

    Read the full bite: Design a rate-limited REST API data collection script

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