Data Scientist question bank
363 questions. Filter by level and skill, track what you've solved, and see how many people get each one right.
- Typical income in a skewed dataset
- Meaning of a p-value
- Ice cream and drowning
- Counting orders per customer
- Customers with no orders
- Type I error
- Showing a distribution
- What standard deviation tells you
- Positive test for a rare disease
- Expected profit of a dice game
- Probability of A or B
- Values within two standard deviations
- Median of six numbers
- Z-score of an exam result
- Units of variance
- Exactly two heads in three flips
- Precision from a confusion matrix
- Metric when missing a case is costly
- High accuracy on rare events
- Why keep a test set
- High train score, low validation score
- Counting missing values in pandas
- pandas mean with a missing value
- value_counts with normalize
- Filtering groups in SQL
- COUNT of a column with NULLs
- Encoding a city column
- Scaling features for kNN
- Choosing the number of clusters
- Chart for a monthly trend
- A correlation of -0.9
- Reading a regression coefficient
- Survey sent only to app users
- What the central limit theorem says
- Unit of randomisation for a new menu
- Why run an A/A test
- What MDE means
- The counterfactual
- Why random assignment works
- Same user, same variant
- When a bandit beats an A/B test
- Keeping a long-term holdout
- Running a test for 10 days
- Comparing beta users with everyone else
- Ramping traffic from 1% upwards
- Changing an item in a tuple
- Reading a missing dictionary key safely
- List comprehension with a condition
- is versus == for two lists
- Slicing part of a string
- Floor division with a negative number
- Checking 0.1 + 0.2 == 0.3
- Formatting a price with an f-string
- Why use with open()
- Most common item with Counter
- What if __name__ == "__main__" does
- Saving the result of list.sort()
- Dates read as plain text
- Keeping the latest row per email
- Sorting by city then by sales
- Getting the weekday from a date column
- Shape after summing along axis 0
- A random sample that repeats
- Filtering rows for several cities
- Renaming one column
- Turning a groupby result into a table
- Labelling orders as high or low
- Values from np.linspace
- Reshaping with -1
- Dropping rows with no email
- Duplicates hiding behind spaces and case
- An extra "Unnamed: 0" column
- Top three products by sales
- Share of orders above a threshold
- dtype of an array with NaN
- Grouping values with defaultdict
- Items in one set but not both
- Numbering rows from 1
- Percentage change between days
- Index of the largest value
- Grouping sales by month
- f-string with an equals sign
- Two independent servers both up
- Churn rate among mobile users
- Expected value of a raffle ticket
- Converting units and the SD
- Expected sign-ups from 100 visits
- Arrivals in ten minutes
- Beyond 1.96 standard deviations
- Red after five blacks
- Choosing a panel of three
- Order of three speakers
- A negative covariance
- Reading a P90 latency
- Average of a 0/1 column
- Sum of seven with two dice
- Ten heads in a row
- Typical value of a category
- Writing the null hypothesis
- A real effect that was missed
- z-test or t-test
- Moving from 95% to 99% confidence
- SD and standard error
- What R² of 0.64 means
- Predicting far outside the data
- R² from a correlation
- Parts of a time series
- A simple baseline for weekly patterns
- Uncertainty further into the future
- Making sure every emirate is covered
- Only happy customers reply
- One point creates a correlation
- Effect size in standard deviations
- Sample size for a smaller effect
- groupby with transform
- Reading a 95% confidence interval
- Testing 20 metrics at once
- Latest order per customer
- Overall rate flips when split
- Predicting a heavily skewed target
- Studying only active users
- Users needed to detect a 1 point lift
- What statistical power means
- Comparing means with unequal variances
- Testing two categorical variables
- Bonferroni threshold for ten tests
- What an AUC of 0.8 means
- F1 from precision and recall
- Which prediction hurts log loss most
- RMSE with one large error
- Row count after a merge
- groupby with a missing key
- Ranking with ties in SQL
- NOT IN returns no rows
- Suspiciously strong churn feature
- Validating a forecasting model
- Making a trending series stationary
- Why a forest beats one tree
- Lowering the boosting learning rate
- Regularisation that zeroes coefficients
- PCA on unscaled features
- Using a model on rare positives
- Brier score for two predictions
- Halving a confidence interval
- Lift of the top decile
- A lift that fades after week one
- PM wants to ship an unclear win
- Analysing only users who reached checkout
- From triggered lift to overall lift
- One huge order swings the result
- Users who never opened the feature
- Computing a difference-in-differences
- What propensity matching does
- Which variable to control for
- Agreeing on one decision metric
- Two tests running at the same time
- Probability to beat control
- A rule change as an experiment
- Testing a billboard campaign
- Groups differed before the test began
- Randomising by device for logged-in users
- Only 40 stores to test on
- Copying a list of lists
- Summing a generator twice
- return inside try with finally
- Sorting by score, then by name
- What *args and **kwargs receive
- zip with lists of different length
- Inverting a dict with repeated values
- Calling a typed function with strings
- Row counts from loc and iloc slices
- Combining two conditions in a filter
- Setting a flag through chained indexing
- Named columns from groupby
- Customers who never ordered
- Blank cells in a pivot table
- Shape after melt
- Converting a column with NaN to integers
- map and replace on unknown codes
- Splitting customers into quartiles by spend
- Duplicate index after concat
- Best-selling product in each city
- resample raises a TypeError
- A 7-day window on irregular dates
- A huge text column with few values
- A slow row-wise apply
- Showing UTC timestamps in Dubai time
- Catching duplicate keys in a merge
- Average price weighted by quantity
- Showing every copy of a duplicate
- Running total per customer
- Days since the previous purchase
- Dates like 03/04/2026 in an Indian file
- Moving an index level to columns
- Row percentages in a crosstab
- Recommended way to make random numbers
- Pulling a PIN code out of an address
- Using a variable inside query()
- A DataFrame that became None
- Columns called price_x and price_y
- Ranking scores with ties
- Bad dates turning into NaT
- Building a long string in a loop
- Forward fill without crossing customers
- pivot raises a duplicate-entries error
- Filtering text with missing values
- Numbering each customer's orders
- Which city had top sales
- Sorting words by length
- Dummy columns for four cities
- Arabic text turns into \u codes
- At least one six in four rolls
- Exclusive events and independence
- Shared birthdays in a small team
- Spread of a difference
- At least one faulty unit in a box
- A minute with no calls
- Calls until the first sale
- Height at the 84th percentile
- Transaction amounts with a long tail
- Two defective items without replacement
- Correlation after a currency change
- Which branch has steadier sales
- Switching doors in a game show
- Are two events independent
- When a normal approximation works
- When a yes/no metric is noisiest
- Is phone insurance worth it
- Average gap between arrivals
- Two servers in the same rack
- Reading a Q-Q plot
- Two branches combined
- Converting probability to odds
- Choosing a one-sided test
- Before and after on the same users
- Interval for a survey share
- Are orders spread evenly over weekdays
- Comparing average baskets in four cities
- Small, very skewed samples
- Significant but not important
- An interval that includes zero
- Building a bootstrap interval
- Sample variance of three values
- R² keeps rising with more columns
- A U-shaped residual plot
- Reading a city dummy coefficient
- Which predictor matters more
- Ridge versus lasso
- A coefficient with p = 0.30
- Slope from correlation and spreads
- Autocorrelation spike at lag 7
- MAPE on slow-moving items
- Ramadan shifts every year
- Flagging an unusual day
- Sampling whole schools
- Capping extreme order values
- City averages and individual people
- A curved but steady relationship
- Checking results every day
- Coaching the worst stores
- Unexpected group sizes
- Using pre-experiment data
- Difference-in-differences assumption
- Coefficients that keep flipping
- Feature users retain better
- Click-through rate standard errors
- Propensity scores near 0 and 1
- Key assumption of an instrument
- A link that only appears in a subset
- Error spread grows with the prediction
- Direction of omitted variable bias
- AUC after squaring the scores
- Precision when prevalence drops
- Oversampling before cross-validation
- Target encoding without leakage
- NDCG at 3 for a ranking
- Treated drivers take control rides
- Benjamini-Hochberg discoveries
- Noisy feature, flatter slope
- Back-transforming log predictions
- Effect with an interaction term
- From log-odds to probability
- Shape after NumPy broadcasting
- Rolling mean at the edges
- LEFT JOIN that acts like INNER JOIN
- Average lifetime with active customers
- Great backtest, poor live forecast
- When the bootstrap breaks down
- Optimising time on site
- Big effect in one segment
- Testing a group-chat feature
- Testing a new dispatch algorithm
- Looking at results weekly, done right
- Effect on those who actually used it
- Free delivery above ₹499
- A launch in only one city
- Adjusting for a variable on the causal path
- Is 10% versus 11% significant
- Comparing two search rankers quickly
- Who should get the coupon
- Power of a 90/10 split
- Lambdas created in a loop
- A loop that ignores Ctrl+C
- Reading a global before assigning it
- A list default in a dataclass
- round() on .5 values
- A decorator hides the function name
- nunique and unique disagree
- Integer overflow in a NumPy array
- Row count after explode
- Day-over-day change for many stores
- Integers turn into floats in iterrows
- Views and copies in NumPy
- Merging an int key with a text key
- First quartile of four values
- Different standard deviations for the same data
- Adding 1 to a big float32 value
- NaN keys in a pandas merge
- Sum of a column that is all missing
- A helper that changes the caller's data
- Adding a month to 31 January
- Assigning a Series with a different index
- groupby().first() mixes rows
- Dividing by zero in pandas
- Latest exchange rate before each trade
- Matrix product of two arrays
- Memory report far below real use
- Two-level column names after agg
- Business days for a Saudi office
- Integers turn into floats after concat
- Does np.vectorize make code fast
- Which bin holds a boundary value
- Comparing two Series with NaN
- Memory saved by a smaller integer type
- Month-end dates with date_range
- Decimal from a float or a string
- Where NaN goes in a descending sort
- Already waited ten minutes
- Variance of a uniform wait
- A sample mean that keeps jumping
- Which plant made the faulty part
- Guarantee without normality
- Expected number of correct matches
- Count data with variance far above the mean
- Spread of a day's total
- Making a simulation ten times more precise
- A density value of 4
- Two positive screening tests
- Sampling most of a small population
- Sample size for a ±3% margin
- Overlapping confidence intervals
- How a permutation test works
- Reading a Bayesian credible interval
- Maximum likelihood for a click rate
- Interval for one new store
- A logistic coefficient of 0.693
- One store moves the whole line
- Reading a log-log coefficient
- Updating a smoothed forecast
- Forecasting a random walk
- Two trending series that correlate
- Choosing the AR order
- Zero failures in 600 transactions