tezvyn:

🤖AI & ML

Artificial intelligence, machine learning, and data science

1166 bites

More in AI & ML — page 28

Data Science & Analytics2 min read

Find customers who have not placed any orders

Tests SQL anti-join logic. Great answers show two paths: LEFT JOIN plus IS NULL on orders.customer_id, or NOT EXISTS, and mention NULL safety with NOT IN. Red flag: INNER JOIN with DISTINCT, which silently drops customers without orders.

Data Science & Analytics2 min read

How do you analyze and reduce large pandas DataFrame memory usage?

This tests in-memory representation and systematic optimization. Start with df.info(memory_usage='deep'), downcast numerics with to_numeric, convert low-cardinality strings to category, and use nullable dtypes.

Process a 50GB CSV with only 16GB RAM
Data Science & Analytics2 min read

Process a 50GB CSV with only 16GB RAM

WHAT IT TESTS: Streaming aggregation under memory constraints. ANSWER OUTLINE: Chunk with read_csv chunksize, filter columns via usecols, downcast int64 to int32/int16, skip rows. RED FLAG: Loading everything into one DataFrame or using default dtypes.

Data Science & Analytics2 min read

Convert string timestamps to datetime and extract day of week

This tests pandas datetime parsing and accessor fluency. A strong answer uses pd.to_datetime, assigns the result, then extracts the day via .dt.day_name() or .dt.dayofweek. Red flag: manual string splitting or Python loops instead of vectorized ops.

Calculate total and average sales per region in pandas
Data Science & Analytics2 min read

Calculate total and average sales per region in pandas

Tests split-apply-combine fluency. A strong answer groups by Region then calls agg with a dict or named aggregation to return sum and mean of Sales_Amount together. Red flag: chaining separate groupby calls or looping rows manually.

Data Science & Analytics2 min read

What is vectorization in NumPy and pandas?

Tests if you know why NumPy operations beat Python loops via contiguous memory and C-level SIMD. A strong answer defines vectorization as array-wide operations without explicit loops, contrasts a ufunc to a for-loop, and cites interpreter overhead removal.

How would you combine customer and transaction DataFrames and describe join types?
Data Science & Analytics2 min read

How would you combine customer and transaction DataFrames and describe join types?

This tests relational merging and join semantics in pandas. Answer: use pd.merge on customer_id, then groupby sum; describe inner, left, right, and outer joins by key preservation. Red flag: proposing concat without keys or conflating inner and left joins.

Data Science & Analytics2 min read

Most efficient way to convert list of dicts to pandas DataFrame

Tests knowledge of vectorized DataFrame construction versus slow row-wise assembly. Answer: pass the list directly to pd.DataFrame(data); C-backed and handles missing keys as NaN. Red flag: recommending loops with pd.concat or iterative DataFrame building.

Describe strategies for handling missing values in pandas DataFrames
Data Science & Analytics2 min read

Describe strategies for handling missing values in pandas DataFrames

Tests practical judgment on cleaning trade-offs. Good answers contrast dropna when data is abundant against fillna imputation to preserve rows, noting bias risk. Red flag: prescribing one fix without asking why values are missing or what the model needs.

Data Science & Analytics2 min read

How do you determine sample size for a conversion lift experiment?

Tests fluency with statistical experiment design. A strong answer frames N as a function of alpha, power, baseline rate, and MDE, noting that shrinking the MDE or raising power inflates N. Red flag: picking N from traffic instead of risk tolerance.

Why is 99% accuracy misleading with 1% disease prevalence?
Data Science & Analytics2 min read

Why is 99% accuracy misleading with 1% disease prevalence?

Tests class imbalance intuition. A strong answer notes that an all-negative classifier hits 99% accuracy, then names precision, recall, F1, and AUC-PR to expose false negatives and false positives. Red flag: claiming accuracy is fine after rebalancing.

Describe the bias-variance tradeoff and how model complexity affects bias and variance
Data Science & Analytics2 min read

Describe the bias-variance tradeoff and how model complexity affects bias and variance

WHAT IT TESTS: Your grasp of error decomposition into bias squared, variance, and noise. ANSWER OUTLINE: More complexity cuts bias but boosts variance via overfitting; test error forms a U. RED FLAG: Claiming both bias and variance fall as parameters grow.

Explain the Central Limit Theorem and its importance for hypothesis testing
Data Science & Analytics2 min read

Explain the Central Limit Theorem and its importance for hypothesis testing

This tests whether you know why sample means from skewed populations tend toward normal as size grows, enabling tests. A strong answer covers mean convergence to normal and standard error. Red flag: claiming the CLT works for small samples or single points.

Data Science & Analytics2 min read

What is a p-value? Interpret p = 0.03 at alpha = 0.05.

Tests frequentist testing and p-value misinterpretations. Define p-value as the probability of data this extreme under the null; since 0.03 < 0.05, reject the null at 5%. Never say it is the probability the null is false or the result is due to chance.

What are your null and alternative hypotheses for this A/B test?
Data Science & Analytics2 min read

What are your null and alternative hypotheses for this A/B test?

This tests translating a directional business question into statistical hypotheses. A strong answer states H0 as no difference in registration rate and H1 as green outperforming blue. A red flag is framing H0 as "blue is better" or using a two-tailed test.

How would you build and validate a proxy target for employee burnout?
Data Science & Analytics2 min read

How would you build and validate a proxy target for employee burnout?

WHAT IT TESTS: operationalizing unobserved constructs into ML targets from messy HR data. ANSWER OUTLINE: combine survey scales with behavioral signals such as off-hours logins and PTO drops; validate via convergent and predictive validity against attrition.

How do you frame high-value customer identification as classification versus regression?
Data Science & Analytics3 min read

How do you frame high-value customer identification as classification versus regression?

Tests mapping a business goal to a defensible target. Outline: define value and action, then contrast regression predicting spend versus classification predicting tiers. Red flag: picking models before fixing the label or the campaign action.

Data Science & Analytics2 min read

How would you recommend launching a checkout flow with mixed A/B metrics?

This tests multi-metric trade-offs. A strong answer tags conversion as success and AOV as a guardrail, estimates net revenue impact, and frames decision as a risk-managed business choice. A red flag is demanding all metrics win or ignoring business context.

Data Science & Analytics2 min read

How do you define churn for a subscription service?

This tests operationalizing a business metric into a data definition. A strong answer separates voluntary from passive churn, picks a moment, and aligns to the billing cycle. Red flag: counting all cancellations as churn while ignoring grace periods.

How would you validate that search users are more likely to purchase?
Data Science & Analytics2 min read

How would you validate that search users are more likely to purchase?

This tests correlation versus causation in product analytics. A strong answer defines the purchase window, matches searchers to similar non-searchers, and picks a statistical test. A red flag is running a t-test without controlling for user intent or time.