PRACTICE BANK
Test what you understand.
Reason through real data-science decisions.
Apply concepts across realistic scenarios, then inspect the reasoning that makes each approach dependable.
CONTINUE PRACTICE
P01 · Remove Duplicates While Preserving Order
Python Beginner Interpret · 8 min
100 problems
Remove Duplicates While Preserving Order
Return unique event labels without changing the order in which users first saw them.
Find the Second Largest Value
Find the runner-up value in a list without treating repeated maximum values as a new rank.
Find Missing Values by Column
Profile null values before deciding whether rows should be imputed, retained, or removed.
Filter High-Value Customers
Select active customers above a revenue threshold without accidentally including incomplete records.
Top 5 Customers by Revenue
Aggregate completed orders, then rank customers by revenue without counting cancelled orders.
Customers With No Orders
Find customers without purchases using a left join and null logic.
Mean vs Median With a Salary Outlier
Choose the summary statistic that best represents a skewed salary distribution.
Compare Variability Using Standard Deviation
Compare two product lines with similar average demand but different week-to-week volatility.
99% Accuracy, Zero Fraud Detected
Diagnose a fraud model that looks accurate overall but fails at the outcome the business cares about.
Diagnose an Overfitting Model
Interpret a large training-validation gap and select evidence-based next steps.
Should You Scale Features Before KNN?
Decide whether scaling is necessary when distance drives a model's predictions.
Feature Engineering From a Date Column
Turn raw order timestamps into calendar features while avoiding assumptions about the target.
Count Frequency of Categories
Create a frequency table for survey responses without assuming every category is present.
Aggregate Transactions by Customer
Aggregate transaction records into customer-level revenue and order counts.
Process a Large Stream Without Loading Everything Into Memory
Design a memory-safe approach for a multi-gigabyte clickstream file.
Revenue by Product Category
Summarize completed sales by product category for a merchandising report.
Monthly Revenue Growth
Calculate month-over-month revenue growth while handling a month with no prior comparison.
Rolling 7-Day Revenue
Build a rolling revenue metric that does not hide days with zero sales.
Rename and Standardize Columns
Normalize a messy vendor file so downstream code can use predictable field names.
Group Sales by Region
Create a regional sales summary with revenue and unique-customer counts.
Diagnose Unexpected Results After a Merge
Investigate why a customer-order merge suddenly produces far more rows than either input.
Interpret a Confidence Interval
Interpret a confidence interval without claiming it gives the probability of a fixed parameter.
Evaluate an A/B Test Beyond Statistical Significance
Decide whether a statistically significant conversion lift is worth shipping.
Classification or Regression?
Select the learning task that matches the business outcome rather than the tool you want to use.
Diagnose an Underfitting Model
Recognize when a model is too simple rather than overfit.
Detect Data Leakage Before Deployment
Identify a feature that is highly predictive only because it is created after the outcome.
Standardize Inconsistent Category Labels
Clean inconsistent product-category labels without hiding genuinely unknown values.
Clean Mixed Date Formats
Parse a column containing multiple date formats without silently swapping day and month.
Resolve Conflicting Customer Records
Create a defensible rule for conflicting customer records from CRM and billing systems.
Detect Invalid Customer Records
Flag records with impossible or internally inconsistent customer values.
Create a Customer Tenure Feature
Turn signup dates into a tenure feature available at a defined prediction date.
Leakage-Safe Target Encoding
Encode a high-cardinality category without letting each row learn from its own target.
Read a Confusion Matrix
Translate confusion-matrix cells into business errors for a loan pre-screening model.
Choose a Precision-Recall Tradeoff
Choose an operating threshold for a review team with limited capacity.
Cost-Sensitive Model Selection
Choose between models with conflicting metrics using an explicit error-cost model.
Diagnose Poor Probability Calibration
Decide whether predicted probabilities can be trusted for risk prioritization.
Choose a Tree, Random Forest, or Boosting Model
Choose a tree model from operational trade-offs, not score alone.
Customer Segmentation With K-Means
Reason about scaling, K selection, and cautious cluster interpretation.
Interpret a PCA Projection
Interpret explained variance and PCA's representational trade-off.
Residuals and Model Error
Calculate residuals, absolute errors, and MAE.
Training Loss Falls, Validation Loss Rises
Diagnose overfitting from training history.
Does This Knowledge Assistant Need RAG?
Choose RAG, deterministic systems, or prompt context based on the task.
Evaluate a RAG Answer
Separate retrieval, generation, groundedness, and citation quality.
Choose and Interpret an EDA Chart
Choose charts for exploratory questions and interpret them cautiously.
Vectorize a Calculation Instead of Looping Row by Row
Use NumPy element-wise operations and boolean masks.
Trace a List Mutation That Duplicated Revenue Labels
Trace a small function to find a shared-list mutation that duplicates a revenue label.
Define a Function Contract for a Revenue Parsing Helper
Design input, output, and edge-case behavior for a messy revenue parsing helper.
Implement a Safe Running Category Counter
Update category counts without hidden shared state between calls.
Diagnose a Join Explosion After Merging Orders and Pageviews
Find why a merge multiplied rows before conversion was calculated.
Choose Wide or Long Format for Weekly Channel Metrics
Choose a table shape for weekly channel trend analysis and visualization.
Implement a Reshape From Wide Experiment Results to Long Format
Convert variant columns into a tidy experiment-results table.
Calculate Conversion Rate With the Right Session Denominator
Calculate conversion with purchases and sessions at the same grain.
Calculate Each Store's Share of Regional Revenue
Compute each store's revenue share inside its region.
Choose WHERE or HAVING for a Low-Volume Customer Filter
Choose the filtering stage for a rule based on aggregated order counts.
Design a Window-Function Query for Latest Subscription Status
Return each user's latest subscription state while retaining plan history.
Calculate a Weighted Average Rating Across Product Lines
Combine segment ratings using their sample sizes.
Calculate the Margin of Error Behind a 95% Confidence Interval
Calculate a 95% proportion interval's margin component and interpret its width.
Diagnose Selection Bias in a Voluntary Survey Result
Diagnose why a voluntary survey can overstate sentiment.
Calculate the Output of a Broadcasted Price Adjustment
Calculate prices after one discount vector is broadcast across a product-price matrix.
Calculate a Standardized Feature Vector by Hand
Compute z-scores for a small feature vector and connect them to vectorized standardization.
Diagnose Leakage From a Post-Outcome Feature
Identify a feature available only after the outcome.
Choose an Encoding Strategy for a High-Cardinality Category
Choose encoding for a category with many values.
Design a Group-Aware Validation Split
Design evaluation when entities have multiple rows.
Interpret a Logistic Regression Probability Shift
Interpret a coefficient without treating it as probability points.
Diagnose Unstable Feature Importance Across Model Runs
Explain shifting importance among correlated predictors.
Choose a Classification Threshold Under Asymmetric Costs
Choose a threshold from error costs.
Calculate Precision and Recall From an Alert Table
Calculate alert precision and recall.
Interpret a Miscalibrated Probability Model
Compare predicted buckets with observed frequencies.
Design Evaluation for a Rare-Event Classifier
Design rare-event classifier evaluation.
Diagnose Unstable Customer Segments Across K-Means Runs
Diagnose unstable K-Means assignments.
Choose Whether to Standardize Features Before K-Means
Decide scaling for distance-based clustering.
Implement a Minimal Train and Validation Loop
Separate model training and validation states.
Diagnose a Diverging Neural Network Training Run
Prioritize debugging from an exploding-loss trace.
Design an Evaluation Set for a RAG System
Design RAG evaluation that separates retrieval from grounding.
Implement Metadata-Aware Chunk Preparation for RAG
Prepare chunks with source metadata for later retrieval.
Diagnose Duplicate Customer Rows After Data Cleaning
Diagnose unexpected duplicate customer rows by tracing keys, source grain, and merge behavior.
Choose a Missing-Data Strategy for Income and Region
Choose separate missing-data treatments for numeric income and categorical region.
Implement a Defensive Numeric Cleaning Helper
Convert messy currency-like strings into numeric values while making invalid values visible.
Design a Feature Availability Contract for Rolling Metrics
Define a time contract that prevents rolling behavioral features from using future information.
Diagnose Leakage From a Customer Lifetime Aggregate
Diagnose why a full-lifetime customer aggregate leaks future behavior into an earlier prediction.
Choose a Baseline Before Training a Complex Ensemble
Choose a defensible simple baseline before evaluating a complex ensemble.
Interpret Learning Curves for Bias and Variance
Interpret compact training and validation learning-curve evidence.
Design a Time-Aware Validation Strategy
Design chronological validation for a system that predicts future observations.
Calculate Expected Cost Across Two Classification Thresholds
Calculate operational cost at two thresholds and choose the lower-cost policy.
Diagnose High AUROC but Poor Alert Precision
Diagnose why strong ranking quality can coexist with poor precision at an operational threshold.
Choose Macro or Weighted F1 for an Imbalanced Multiclass Problem
Choose an F1 averaging method based on an explicit multiclass evaluation goal.
Implement Group-Level Normalization With Pandas Transform
Normalize values relative to each row's group while preserving the original DataFrame shape.
Design a SQL Deduplication Step Before Revenue Aggregation
Deduplicate versioned transactions before aggregating revenue.
Calculate the Expected Number of False Positives
Calculate expected false alarms from case volume, negative prevalence, and a false-positive rate.
Implement a Bootstrap Confidence Interval for a Median
Implement a compact bootstrap interval for uncertainty around a sample median.
Diagnose Training-Serving Skew in a Feature Pipeline
Diagnose an offline-to-online feature mismatch without confusing it with ordinary overfitting.
Design a Model Selection Rule Across Validation Folds
Design a model-selection rule using average performance, fold variability, and complexity.
Interpret Performance Drift Across Customer Cohorts
Interpret cohort-level performance changes without overclaiming a root cause.
Choose an Outlier Treatment Before Revenue Aggregation
Choose a context-aware treatment for extreme revenue values before reporting a KPI.
Implement a Reproducible SQL Cohort Table
Build a deterministic cohort table from each user's first qualifying event.
Calculate Uncertainty for a Difference in Conversion Rates
Calculate approximate uncertainty around a difference in conversion rates.
Diagnose Cluster Instability After Adding Encoded Features
Diagnose instability caused by representation and distance choices in a clustering pipeline.
Implement Early Stopping Logic From Validation Loss
Implement compact validation-loss early stopping with patience and best-state restoration.
Design a Failure Taxonomy for RAG Evaluation
Design a separable RAG failure taxonomy that supports debugging beyond one aggregate score.
Interpret a Cohort Retention Table With Changing Denominators
Interpret retention percentages when cohorts have different initial sizes and incomplete later periods.
LOCAL PROGRESS · 0 completed · 100 remaining