Data Analyst Interview Questions

Interview Preparation Tips for Data Analyst Positions

Before the Interview

  1. Research the company thoroughly

    • Understand their business model, industry challenges, and how they use data
    • Review their products/services and recent news or developments
    • Identify how data analysis might drive value in their specific context
  2. Review the job description carefully

    • Match your skills and experiences to the specific requirements
    • Prepare examples that demonstrate these skills
    • Identify any knowledge gaps and brush up on those areas
  3. Prepare your portfolio

    • Organize 2-3 relevant data projects you can discuss in detail
    • Be ready to explain your analytical approach, tools used, and business impact
    • Consider preparing a brief presentation if the role involves stakeholder communication
  4. Practice with real data

    • Review or work on sample datasets similar to what the company might use
    • Practice writing SQL queries relevant to their business domain
    • Prepare code samples that showcase your technical skills
  5. Brush up on technical skills

    • Review SQL fundamentals and practice complex queries
    • Refresh your knowledge of statistics and probability concepts
    • Practice with the visualization tools mentioned in the job description

During the Interview

  1. Technical question strategy

    • Listen carefully to understand exactly what's being asked
    • Think out loud to demonstrate your analytical process
    • If you don't know something, explain how you would approach finding the answer
  2. Case study approach

    • Clarify the problem and ask questions before diving into solutions
    • Structure your approach methodically
    • Balance technical details with business implications
    • Be clear about assumptions you're making
  3. Behavioral question strategy

    • Use the STAR method (Situation, Task, Action, Result)
    • Focus on your specific contributions to team projects
    • Quantify the impact of your work whenever possible
  4. Questions to ask the interviewer

    • Ask thoughtful questions about their data challenges
    • Inquire about how data drives decision-making in the organization
    • Ask about the team structure and collaboration processes

After the Interview

  1. Send a thank-you note

    • Reference specific points from the conversation
    • Reiterate your interest in the role
    • Add any relevant information you may have forgotten to mention
  2. Reflect on the experience

    • Note questions you found challenging for future preparation
    • Consider how you might improve your responses
  3. Follow up appropriately

    • If you haven't heard back within the timeframe mentioned, send a polite follow-up
    • Use this opportunity to provide any additional relevant information

Data Analyst Learning Resources

Official Documentation

YouTube Channels

Interactive Practice

SQL Questions

Q: What is SQL and why is it important for data analysis?

SQL (Structured Query Language) is the standard language for querying relational databases. It is essential for data analysts because almost all structured business data lives in databases (MySQL, PostgreSQL, Redshift, BigQuery, Snowflake). With SQL you can extract, filter, aggregate, and join datasets without moving data out of the database, making it the first step in nearly every analysis workflow.


Q: What's the difference between WHERE and HAVING clauses?

WHERE filters rows before grouping/aggregation; HAVING filters after aggregation. Use WHERE on raw column values and HAVING on aggregated results like COUNT, SUM, AVG.

-- WHERE filters individual rows
SELECT department, COUNT(*) AS cnt
FROM employees
WHERE status = 'active'
GROUP BY department;

-- HAVING filters aggregated groups
SELECT department, COUNT(*) AS cnt
FROM employees
GROUP BY department
HAVING COUNT(*) > 10;

Q: Explain the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL OUTER JOIN.

Join Returns
INNER JOIN Only rows with a match in both tables
LEFT JOIN All rows from the left table; NULL for unmatched right rows
RIGHT JOIN All rows from the right table; NULL for unmatched left rows
FULL OUTER JOIN All rows from both tables; NULL where no match exists
-- LEFT JOIN: keep all users even if they have no orders
SELECT u.name, o.amount
FROM users u
LEFT JOIN orders o ON u.id = o.user_id;

Q: What are subqueries and when would you use them?

A subquery is a query nested inside another query. Use them to filter with aggregated values, create derived tables, or replace CTEs for simple one-time logic.

-- Filter using a subquery
SELECT * FROM employees
WHERE salary > (SELECT AVG(salary) FROM employees);

-- Subquery as a derived table
SELECT dept, avg_sal FROM (
  SELECT department AS dept, AVG(salary) AS avg_sal
  FROM employees GROUP BY department
) t WHERE avg_sal > 60000;

Q: How would you find duplicate records in a table?

-- Find which values are duplicated
SELECT email, COUNT(*) AS cnt
FROM users
GROUP BY email
HAVING COUNT(*) > 1;

-- See the full duplicate rows
SELECT * FROM users
WHERE email IN (
  SELECT email FROM users GROUP BY email HAVING COUNT(*) > 1
)
ORDER BY email;

Q: Write a query to find the second highest salary in an employee table.

-- Using LIMIT/OFFSET (MySQL, PostgreSQL)
SELECT DISTINCT salary
FROM employees
ORDER BY salary DESC
LIMIT 1 OFFSET 1;

-- Using subquery (works on all databases)
SELECT MAX(salary) AS second_highest
FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees);

Q: What are window functions in SQL and when would you use them?

Window functions compute values across a set of rows related to the current row without collapsing rows the way GROUP BY does. Use them for running totals, rankings, moving averages, and row-over-row comparisons.

SELECT order_date, revenue,
  SUM(revenue)  OVER (ORDER BY order_date)           AS running_total,
  RANK()        OVER (ORDER BY revenue DESC)          AS rank,
  LAG(revenue)  OVER (ORDER BY order_date)            AS prev_day
FROM daily_sales;

Q: Explain the difference between COUNT(*), COUNT(column), and COUNT(DISTINCT column).

  • COUNT(*) — counts every row including NULLs
  • COUNT(column) — counts only non-NULL values in that column
  • COUNT(DISTINCT column) — counts unique non-NULL values
SELECT
  COUNT(*)                AS total_rows,
  COUNT(email)            AS rows_with_email,
  COUNT(DISTINCT country) AS unique_countries
FROM users;

Q: How would you calculate a moving average in SQL?

Use a window function with a frame specification:

SELECT order_date, revenue,
  AVG(revenue) OVER (
    ORDER BY order_date
    ROWS BETWEEN 6 PRECEDING AND CURRENT ROW
  ) AS moving_avg_7d
FROM daily_sales;

Q: What's the difference between DELETE, TRUNCATE, and DROP commands?

Command What it does Rollback Resets auto-increment
DELETE Removes rows (can filter with WHERE) Yes No
TRUNCATE Removes all rows instantly No (usually) Yes
DROP Removes the entire table/object No N/A

Q: How would you optimize a slow SQL query?

  1. Add indexes on columns used in WHERE, JOIN ON, and ORDER BY
  2. Avoid SELECT * — select only needed columns
  3. Use EXPLAIN / EXPLAIN ANALYZE to read the execution plan
  4. Replace correlated subqueries with JOINs or CTEs
  5. Filter early — push WHERE conditions as close to the data source as possible
  6. Avoid functions on indexed columns in WHERE (e.g., WHERE YEAR(date) = 2024 prevents index use)

Q: Explain Common Table Expressions (CTEs) and their benefits.

A CTE (WITH clause) is a named temporary result set that improves query readability by breaking complex logic into named steps. It can be referenced multiple times in the same query and supports recursive queries for hierarchical data.

WITH monthly_rev AS (
  SELECT DATE_TRUNC('month', order_date) AS month, SUM(revenue) AS rev
  FROM orders GROUP BY 1
),
ranked AS (
  SELECT *, RANK() OVER (ORDER BY rev DESC) AS rnk FROM monthly_rev
)
SELECT * FROM ranked WHERE rnk <= 3;

Q: How would you handle NULL values in your SQL queries?

-- COALESCE: return first non-NULL value
SELECT COALESCE(phone, email, 'N/A') AS contact FROM users;

-- NULLIF: return NULL if two values are equal (avoids division by zero)
SELECT revenue / NULLIF(sessions, 0) AS rpm FROM traffic;

-- Filter NULLs
SELECT * FROM orders WHERE discount IS NOT NULL;

-- NULL-safe comparison (MySQL)
SELECT * FROM t WHERE col <=> NULL;

Q: Write a query to calculate Month-over-Month percentage change in revenue.

WITH monthly AS (
  SELECT DATE_TRUNC('month', order_date) AS month,
         SUM(revenue) AS rev
  FROM orders GROUP BY 1
)
SELECT month, rev,
  LAG(rev) OVER (ORDER BY month) AS prev_rev,
  ROUND(100.0 * (rev - LAG(rev) OVER (ORDER BY month))
        / NULLIF(LAG(rev) OVER (ORDER BY month), 0), 2) AS mom_pct
FROM monthly;

Q: How would you implement a ranking system in SQL?

SELECT name, score,
  ROW_NUMBER() OVER (ORDER BY score DESC) AS row_num,    -- unique, no ties
  RANK()       OVER (ORDER BY score DESC) AS rank,       -- gaps after ties
  DENSE_RANK() OVER (ORDER BY score DESC) AS dense_rank  -- no gaps after ties
FROM leaderboard;

Use DENSE_RANK when you don't want to skip positions after tied ranks.


Q: What is the difference between DDL, DML, DCL, and TCL commands in SQL?

Category Full Name Commands
DDL Data Definition Language CREATE, ALTER, DROP, TRUNCATE
DML Data Manipulation Language SELECT, INSERT, UPDATE, DELETE
DCL Data Control Language GRANT, REVOKE
TCL Transaction Control Language COMMIT, ROLLBACK, SAVEPOINT

Q: Explain the concept of database normalization and its normal forms.

Normalization organizes tables to reduce redundancy and improve data integrity. Key normal forms:

  • 1NF: Atomic values; no repeating groups
  • 2NF: 1NF + no partial dependency on composite keys
  • 3NF: 2NF + no transitive dependencies (non-key columns depend only on the primary key)
  • BCNF: Stricter 3NF — every determinant must be a candidate key

Q: What is a primary key and a foreign key in a database?

A primary key uniquely identifies each row in a table (NOT NULL, unique). A foreign key is a column in one table that references the primary key in another table, enforcing referential integrity so you can't have an order for a customer that doesn't exist.


Q: How would you calculate cumulative sums in SQL?

SELECT order_date, daily_revenue,
  SUM(daily_revenue) OVER (ORDER BY order_date) AS cumulative_revenue
FROM daily_sales;

Q: What is a self-join and when would you use it?

A self-join joins a table to itself. Use it when a table has a hierarchical or recursive relationship, such as an employee table where each employee has a manager who is also an employee.

SELECT e.name AS employee, m.name AS manager
FROM employees e
LEFT JOIN employees m ON e.manager_id = m.id;

Q: Explain the difference between UNION and UNION ALL.

  • UNION combines results from two queries and removes duplicates (slower)
  • UNION ALL combines results and keeps all rows including duplicates (faster)

Use UNION ALL by default unless you specifically need deduplication, since it skips the extra sort/hash step.


Q: What are indexes and how do they improve query performance?

An index is a data structure (usually a B-tree) that lets the database find rows without scanning the full table, turning an O(n) scan into an O(log n) lookup. Index columns used in WHERE, JOIN ON, and ORDER BY. Avoid over-indexing — indexes speed reads but slow writes.


Q: What is a stored procedure and when would you use one?

A stored procedure is a named block of SQL stored in the database and executed by name. Use stored procedures for repeated complex logic (ETL steps, data validation), to enforce business rules at the database level, or to give application users limited, controlled access without exposing raw tables.


Q: How would you pivot rows to columns in SQL?

-- Conditional aggregation (works in all databases)
SELECT product_id,
  SUM(CASE WHEN quarter = 'Q1' THEN revenue ELSE 0 END) AS Q1,
  SUM(CASE WHEN quarter = 'Q2' THEN revenue ELSE 0 END) AS Q2,
  SUM(CASE WHEN quarter = 'Q3' THEN revenue ELSE 0 END) AS Q3,
  SUM(CASE WHEN quarter = 'Q4' THEN revenue ELSE 0 END) AS Q4
FROM quarterly_sales
GROUP BY product_id;

Q: What is the COALESCE function and how would you use it?

COALESCE(val1, val2, ...) returns the first non-NULL argument. It is the standard, portable way to substitute a default value for NULLs or to pick the first available contact method.

SELECT COALESCE(mobile, home_phone, work_phone, 'No contact') AS best_phone
FROM customers;

Q: How would you handle date and time calculations in SQL?

-- Difference between dates
SELECT DATEDIFF(NOW(), hire_date) AS days_employed FROM employees;  -- MySQL
SELECT NOW() - hire_date AS tenure FROM employees;  -- PostgreSQL

-- Truncate to month/week
SELECT DATE_TRUNC('month', order_date) AS month FROM orders;

-- Extract parts
SELECT EXTRACT(YEAR FROM order_date), EXTRACT(DOW FROM order_date) FROM orders;

-- Add/subtract intervals
SELECT order_date + INTERVAL '30 days' AS due_date FROM orders;

Q: Explain the difference between aggregate and scalar functions.

  • Aggregate functions operate on a set of rows and return a single value: SUM, AVG, COUNT, MAX, MIN
  • Scalar functions operate on a single value and return a single value: UPPER, LEN, ROUND, COALESCE, DATEPART

Aggregate functions require GROUP BY when used alongside non-aggregated columns; scalar functions do not.


Q: What are SQL transaction isolation levels?

Level Dirty Read Non-Repeatable Read Phantom Read
READ UNCOMMITTED Possible Possible Possible
READ COMMITTED Prevented Possible Possible
REPEATABLE READ Prevented Prevented Possible
SERIALIZABLE Prevented Prevented Prevented

Most databases default to READ COMMITTED. Use SERIALIZABLE only when strict consistency is required, as it has the highest locking overhead.


Q: How would you create a histogram using SQL?

-- Bucket ages into 10-year bins
SELECT
  FLOOR(age / 10) * 10 AS bucket_start,
  COUNT(*) AS frequency
FROM users
GROUP BY 1
ORDER BY 1;

Q: What is the difference between CROSS JOIN and NATURAL JOIN?

  • CROSS JOIN produces a Cartesian product — every row in table A combined with every row in table B. Used to generate combinations (e.g., all date × product pairs).
  • NATURAL JOIN automatically joins on all columns with the same name in both tables. Rarely used in production because it is fragile — adding a column with a matching name changes the join silently.

Statistics and Math Questions

Q: Explain the difference between mean, median, and mode.

  • Mean: Sum of all values divided by count. Sensitive to outliers — one extreme value shifts it significantly.
  • Median: The middle value when data is sorted. Robust to outliers — preferred for skewed data like income or house prices.
  • Mode: The most frequent value. Useful for categorical data or finding the most common occurrence.

For salary data, the median is more informative than the mean because a few very high earners skew the mean upward.


Q: What is standard deviation and why is it important?

Standard deviation (σ) measures how spread out values are around the mean. A small σ means data clusters tightly; a large σ means it is spread widely. It is used to detect outliers (values > 2–3σ from mean), normalize features for ML models, and quantify uncertainty in estimates.


Q: Explain the difference between correlation and causation.

Correlation means two variables tend to move together (positive or negative). Causation means one variable directly causes change in another. Correlation does not imply causation — ice cream sales and drowning rates are correlated (both peak in summer) but neither causes the other. To establish causation you need randomized controlled experiments (A/B tests) or rigorous causal inference methods.


Q: What is statistical significance and how do you determine it?

A result is statistically significant when it is unlikely to have occurred by chance under the null hypothesis. You determine it by computing a test statistic and p-value. If p < α (commonly 0.05), you reject the null hypothesis. Always pair significance with effect size — a tiny effect can be statistically significant with a large enough sample but have no practical value.


Q: What is a p-value and how is it used in hypothesis testing?

The p-value is the probability of observing results at least as extreme as the actual results, assuming the null hypothesis is true. A small p-value (< 0.05) means the data is unlikely under H₀, providing evidence to reject it. It is not the probability that H₀ is true, nor a measure of effect size.


Q: What is the central limit theorem and why is it important?

The CLT states that the sampling distribution of the mean approaches a normal distribution as sample size grows, regardless of the original population's distribution. This is foundational because it justifies using t-tests and z-tests even when raw data is not normally distributed, and it underpins confidence interval construction.


Q: Explain Type I and Type II errors.

  • Type I error (False Positive): Reject H₀ when it is actually true. Controlled by α (significance level). Example: concluding a treatment works when it doesn't.
  • Type II error (False Negative): Fail to reject H₀ when it is false. Controlled by β; power = 1 − β. Example: missing a real drug effect in a clinical trial.

Reducing one type of error increases the other — the trade-off is managed by choosing α and sample size carefully.


Q: What is regression analysis and when would you use it?

Regression models the relationship between a dependent variable (Y) and one or more independent variables (X). Use it to predict continuous outcomes (linear regression), binary outcomes (logistic regression), or to quantify how much each predictor contributes to Y. Common data analyst use cases: forecasting sales, pricing models, identifying key churn drivers.


Q: Explain the difference between univariate, bivariate, and multivariate analysis.

  • Univariate: Analysis of a single variable (histogram, mean, standard deviation)
  • Bivariate: Relationship between two variables (scatter plot, correlation, cross-tabulation)
  • Multivariate: Relationships among three or more variables simultaneously (regression, clustering, PCA)

Start with univariate to understand distributions, bivariate to spot relationships, then multivariate to model complex interactions.


Q: What is a confidence interval?

A confidence interval (CI) is a range of values that is likely to contain the true population parameter with a specified probability (e.g., 95% CI). A 95% CI means that if you repeated the study 100 times, approximately 95 of the resulting intervals would contain the true parameter. It quantifies estimation uncertainty — narrower CIs indicate more precise estimates.


Q: What is the difference between probability and likelihood?

  • Probability asks: given a fixed model/parameter, what is the chance of observing this data?
  • Likelihood asks: given the observed data, how plausible is each possible parameter value?

In statistics: probability → data given parameters; likelihood → parameters given data. Maximum Likelihood Estimation (MLE) finds parameters that maximize the likelihood of the observed data.


Q: Explain what a normal distribution is and its characteristics.

A normal distribution is a symmetric, bell-shaped distribution fully described by its mean (μ) and standard deviation (σ). Key properties:

  • ~68% of data falls within ±1σ of the mean
  • ~95% within ±2σ
  • ~99.7% within ±3σ (the 68-95-99.7 rule)

Many natural phenomena approximate normality, and many statistical tests assume it.


Q: What is a z-score and how is it used?

A z-score measures how many standard deviations a value is from the mean: z = (x − μ) / σ. Uses: standardizing features before ML modeling, comparing values from different scales, identifying outliers (|z| > 3), and converting to percentiles using the standard normal table.


Q: How would you detect outliers in a dataset?

Three common approaches:

  1. IQR method: Values below Q1 − 1.5×IQR or above Q3 + 1.5×IQR
  2. Z-score method: Values with |z| > 3
  3. Visual: Box plots, scatter plots, histograms

Choose based on distribution shape — IQR is robust for skewed data; z-score assumes normality.


Q: What's the difference between parametric and non-parametric tests?

  • Parametric tests assume data follows a known distribution (usually normal): t-test, ANOVA, Pearson correlation. More powerful when assumptions hold.
  • Non-parametric tests make no distribution assumptions: Mann-Whitney U, Kruskal-Wallis, Spearman correlation. Use them for ordinal data, small samples, or when normality is violated.

Q: What is the difference between variance and covariance?

  • Variance measures the spread of a single variable around its mean (σ²)
  • Covariance measures how two variables change together — positive means they move in the same direction, negative means opposite

Covariance is hard to interpret because it depends on units. Correlation normalizes covariance to the range [−1, +1], making it interpretable.


Q: Explain the concept of skewness in a distribution.

Skewness measures the asymmetry of a distribution. Positive skew (right-skewed): the tail extends to the right; mean > median (e.g., income). Negative skew (left-skewed): tail extends left; mean < median. Skewed data often requires log transformation before modeling or using median instead of mean for summary statistics.


Q: What is kurtosis and what does it tell you about a distribution?

Kurtosis measures the "tailedness" of a distribution. High kurtosis (leptokurtic): heavy tails, more extreme outliers than a normal distribution. Low kurtosis (platykurtic): light tails, fewer extremes. Excess kurtosis = kurtosis − 3; a normal distribution has excess kurtosis of 0. Relevant when modeling financial returns or anomaly detection.


Q: What is a chi-square test and when would you use it?

The chi-square test checks whether there is a statistically significant association between two categorical variables (chi-square test of independence), or whether observed frequencies match expected frequencies (goodness-of-fit test). Example: testing whether click-through rate differs by user segment.


Q: Explain the concept of statistical power.

Power (1 − β) is the probability that a test correctly rejects H₀ when it is false (avoids a Type II error). Higher power means less chance of missing a real effect. Power increases with larger sample size, larger effect size, and higher α. Typically aim for 80% power when designing experiments.


Q: What is Bayes' theorem and how is it applied in data analysis?

Bayes' theorem: P(A|B) = P(B|A) × P(A) / P(B). It updates prior beliefs with new evidence to get a posterior probability. Applications in data analysis: spam filtering, Bayesian A/B testing (updating probability of a variant winning as data arrives), naive Bayes classifiers, and probabilistic forecasting.


Q: What are the assumptions behind linear regression?

  1. Linearity: Relationship between X and Y is linear
  2. Independence: Observations are independent of each other
  3. Homoscedasticity: Constant variance of residuals across all levels of X
  4. Normality of residuals: Residuals are approximately normally distributed
  5. No multicollinearity: Predictors are not highly correlated with each other

Q: Explain the concept of multicollinearity and why it matters.

Multicollinearity occurs when two or more predictor variables in a regression are highly correlated. This makes individual coefficient estimates unstable and hard to interpret (standard errors inflate, p-values become unreliable). Detect with VIF (Variance Inflation Factor > 5–10 indicates a problem). Fix by removing one of the correlated variables, using PCA, or applying regularization (Ridge/Lasso).


Q: What is heteroscedasticity and how does it impact regression models?

Heteroscedasticity means the variance of residuals is not constant — it changes with the level of the predicted values. This violates OLS assumptions, making standard errors unreliable and hypothesis tests invalid. Detect by plotting residuals vs. fitted values. Fix with log/square-root transformations of the target or use weighted least squares.


Q: Explain the difference between ANOVA, MANOVA, and ANCOVA.

  • ANOVA (Analysis of Variance): Tests if means differ across 3+ groups for one dependent variable
  • MANOVA (Multivariate ANOVA): Same but for multiple dependent variables simultaneously
  • ANCOVA (Analysis of Covariance): ANOVA while controlling for a continuous covariate (e.g., testing if treatment groups differ in outcome after controlling for age)

Q: What is the difference between R-squared and adjusted R-squared?

  • measures how much variance in Y is explained by the model (0 to 1). Adding any variable increases R², even irrelevant ones.
  • Adjusted R² penalizes for adding variables that don't improve the model. Use adjusted R² when comparing models with different numbers of predictors.

Q: What is the concept of degrees of freedom in statistics?

Degrees of freedom (df) represent the number of independent values that can vary in a calculation. In a sample of n values, estimating the mean uses 1 df, leaving n − 1 df for estimating variance. Degrees of freedom determine the correct t-distribution or chi-square distribution to use in hypothesis tests.


Q: What are non-parametric equivalents of common statistical tests?

Parametric test Non-parametric equivalent
One-sample t-test Wilcoxon signed-rank test
Two-sample t-test Mann-Whitney U test
Paired t-test Wilcoxon signed-rank test
One-way ANOVA Kruskal-Wallis test
Pearson correlation Spearman / Kendall correlation

Q: Explain the concept of bootstrapping and its applications.

Bootstrapping is a resampling technique where you repeatedly draw samples with replacement from your data to estimate the sampling distribution of a statistic (mean, median, confidence interval, model accuracy). It does not require distributional assumptions and works well for small samples or complex estimators.


Q: What is a survival analysis and when would you use it?

Survival analysis models the time until an event occurs (customer churn, machine failure, employee attrition). It handles censored data — observations where the event has not yet occurred by the end of the study period. The Kaplan-Meier curve visualizes survival over time; the Cox proportional hazards model identifies which factors drive the event.

Python/R Programming Questions

Q: What libraries/packages do you commonly use for data analysis in Python/R?

Library Purpose
pandas DataFrames — data manipulation and wrangling
NumPy Numerical arrays and mathematical operations
matplotlib / seaborn Static visualizations
plotly Interactive charts
scikit-learn ML models, preprocessing, model evaluation
scipy Statistical tests and scientific computing
statsmodels Statistical modelling, regression diagnostics
sqlalchemy Database connections from Python

Q: How would you handle missing values in a dataset using Python/R?

import pandas as pd

df = pd.read_csv('data.csv')
print(df.isnull().sum())            # count missing per column
print(df.isnull().mean() * 100)     # % missing

df['age'].fillna(df['age'].median(), inplace=True)     # fill numeric
df['city'].fillna(df['city'].mode()[0], inplace=True)  # fill categorical
df['price'].fillna(method='ffill', inplace=True)       # forward-fill time series
df.dropna(subset=['email'], inplace=True)              # drop rows missing key field

The right strategy depends on the percentage missing and whether data is missing at random.


Q: Explain the difference between a list, tuple, and dictionary in Python.

  • List: Ordered, mutable, allows duplicates. [1, 2, 3]
  • Tuple: Ordered, immutable, allows duplicates. (1, 2, 3) — use for fixed data like coordinates or function return values
  • Dictionary: Key-value pairs, ordered (Python 3.7+), mutable, keys must be unique. {"name": "Alice", "age": 30}

Q: What is pandas and why is it useful for data analysis?

pandas is Python's primary data manipulation library. It provides the DataFrame (a 2D labeled table) and Series (1D labeled array) which let you load, clean, transform, aggregate, and join datasets with concise code. It bridges the gap between raw data and analysis without needing SQL or a database.


Q: How would you merge two dataframes in pandas?

import pandas as pd

# SQL-style joins
result = pd.merge(orders, customers, on='customer_id', how='left')
result = pd.merge(orders, customers,
                  left_on='cust_id', right_on='id', how='inner')

# Stack rows (append)
combined = pd.concat([df_2023, df_2024], ignore_index=True)

# Stack columns
combined = pd.concat([features, labels], axis=1)

Q: Explain how to use groupby in pandas.

# Single column
df.groupby('region')['revenue'].sum()

# Multiple columns, multiple aggregations
df.groupby(['region', 'product']).agg(
    total=('revenue', 'sum'),
    avg=('revenue', 'mean'),
    count=('order_id', 'count')
).reset_index()

# Custom agg per column
df.groupby('region').agg({'revenue': ['sum','mean'], 'units': 'sum'})

Q: How would you create a visualization of a dataset using Python libraries?

import matplotlib.pyplot as plt
import seaborn as sns

fig, axes = plt.subplots(1, 2, figsize=(12, 4))

# Distribution
sns.histplot(df['order_value'], kde=True, ax=axes[0])
axes[0].set_title('Order Value Distribution')

# Category comparison
df.groupby('region')['revenue'].sum().plot(kind='bar', ax=axes[1])
axes[1].set_title('Revenue by Region')

plt.tight_layout()
plt.savefig('analysis.png', dpi=150)

Q: How would you handle categorical variables in your analysis?

  • Ordinal categories (e.g., Low/Medium/High): map to integers preserving order
  • Nominal categories (e.g., country, color): one-hot encode with pd.get_dummies
  • High-cardinality categories (> 50 values): target encoding, frequency encoding, or embeddings
  • For tree-based models: can pass as integer-encoded or use category dtype

Q: Write a function to remove outliers from a dataset.

import pandas as pd

def remove_outliers_iqr(df, column):
    Q1 = df[column].quantile(0.25)
    Q3 = df[column].quantile(0.75)
    IQR = Q3 - Q1
    lower = Q1 - 1.5 * IQR
    upper = Q3 + 1.5 * IQR
    return df[(df[column] >= lower) & (df[column] <= upper)]

clean_df = remove_outliers_iqr(df, 'salary')

Q: How would you perform a time series analysis in Python/R?

import pandas as pd
from statsmodels.tsa.seasonal import seasonal_decompose

df = pd.read_csv('sales.csv', parse_dates=['date'], index_col='date')
monthly = df['revenue'].resample('M').sum()

# Decompose trend, seasonality, residual
decomp = seasonal_decompose(monthly, model='additive', period=12)
decomp.plot()

# Rolling stats
monthly.rolling(3).mean()  # 3-month moving average

# Forecast with Prophet
from prophet import Prophet
model = Prophet()
model.fit(df.rename(columns={'date':'ds','revenue':'y'}))
future = model.make_future_dataframe(periods=90)
forecast = model.predict(future)

Q: What's the difference between loc and iloc in pandas?

  • loc is label-based: uses index labels and column names
  • iloc is integer position-based: uses 0-based integer positions
df.loc['row_label', 'col_name']   # by label
df.iloc[0, 1]                      # by position (row 0, col 1)
df.loc[df['age'] > 30, 'name']    # boolean mask with loc

Q: How would you identify and handle multicollinearity?

Detect with a correlation matrix or Variance Inflation Factor (VIF). Handle by dropping one of the correlated features, combining them (PCA), or using regularized regression (Ridge/Lasso) which penalizes large coefficients automatically.

from statsmodels.stats.outliers_influence import variance_inflation_factor

X = df[['age', 'income', 'credit_score']]
vif = pd.DataFrame({'feature': X.columns,
                    'VIF': [variance_inflation_factor(X.values, i)
                            for i in range(X.shape[1])]})

Q: Explain how you would implement a machine learning model for prediction.

from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report
import pandas as pd

X = df.drop('target', axis=1)
y = df['target']
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

model = RandomForestClassifier(n_estimators=100, random_state=42)
model.fit(X_train, y_train)
preds = model.predict(X_test)
print(classification_report(y_test, preds))

Q: How would you evaluate the performance of a machine learning model?

Task Key Metrics
Classification Accuracy, Precision, Recall, F1-score, ROC-AUC
Regression MAE, MSE, RMSE, R-squared
Ranking NDCG, MAP

Use cross-validation to get a robust estimate. For imbalanced classes, prefer F1 or AUC over accuracy.


Q: How would you extract data from a web API using Python?

import requests
import pandas as pd

response = requests.get(
    'https://api.example.com/data',
    headers={'Authorization': 'Bearer TOKEN'},
    params={'start': '2024-01-01', 'limit': 100}
)
response.raise_for_status()
data = response.json()
df = pd.DataFrame(data['results'])

For paginated APIs, loop through pages until next is None. For rate-limited APIs, add time.sleep between requests.


Q: What is vectorization in NumPy and why is it important?

Vectorization means applying operations to entire arrays at once using NumPy's optimized C/Fortran internals, instead of Python for-loops. It is 10–100× faster because it avoids Python interpreter overhead and uses CPU SIMD instructions.

import numpy as np
a = np.array([1, 2, 3, 4])
# Vectorized (fast)
result = a * 2 + 1
# Equivalent loop (slow for large arrays)
# result = [x * 2 + 1 for x in a]

Q: Explain the difference between apply, map, and applymap in pandas.

  • Series.map(func): applies a function element-by-element to a Series; also used for value substitution with a dict
  • Series.apply(func): similar to map but also works with more complex functions/aggregations
  • DataFrame.apply(func, axis=0|1): applies a function along rows (axis=1) or columns (axis=0)
  • DataFrame.applymap(func) (deprecated → map in pandas 2.1+): applies element-by-element to every cell in a DataFrame

Q: How would you handle a large dataset that doesn't fit into memory?

  1. Chunking: pd.read_csv('file.csv', chunksize=100000) — process in batches
  2. Filtering at read time: usecols and dtype parameters to reduce memory
  3. Dask: drop-in pandas replacement that processes data in parallel chunks
  4. Polars: memory-efficient alternative to pandas with lazy evaluation
  5. Database: run aggregations in SQL and pull only summary results into Python
  6. PySpark: distributed processing for truly large datasets (TBs)

Q: What is the difference between Series and DataFrame in pandas?

  • Series: 1-dimensional labeled array — like a single column with an index
  • DataFrame: 2-dimensional labeled data structure — like a table with rows and columns; each column is a Series
s = pd.Series([1, 2, 3], index=['a','b','c'])    # Series
df = pd.DataFrame({'x': [1,2], 'y': [3,4]})       # DataFrame
type(df['x'])   # pandas.core.series.Series

Q: How would you implement custom functions for data cleaning in pandas?

import pandas as pd
import re

def clean_phone(phone):
    if pd.isna(phone):
        return None
    digits = re.sub(r'\D', '', str(phone))
    return digits if len(digits) == 10 else None

df['phone_clean'] = df['phone'].apply(clean_phone)

# Vectorized alternative for simple ops
df['name_clean'] = df['name'].str.strip().str.title()

Q: Explain how to use pivot tables in pandas.

pivot = df.pivot_table(
    values='revenue',
    index='region',
    columns='product',
    aggfunc='sum',
    fill_value=0
)
# Same as Excel pivot table — rows=region, columns=product, values=sum(revenue)

Q: What are regular expressions and how would you use them for data cleaning?

Regular expressions (regex) are patterns for matching and extracting text. Common uses: extracting emails/phones, removing special characters, validating formats.

import re
import pandas as pd

# Extract emails from a text column
df['email'] = df['text'].str.extract(r'([\w.+-]+@[\w-]+\.[\w.]+)')

# Remove non-alphanumeric characters
df['clean'] = df['raw'].str.replace(r'[^a-zA-Z0-9 ]', '', regex=True)

# Validate phone format
df['valid_phone'] = df['phone'].str.match(r'^\d{10}$')

Q: How would you handle time zone conversions in pandas?

import pandas as pd

# Localize a naive datetime column
df['ts'] = pd.to_datetime(df['ts'])
df['ts_utc'] = df['ts'].dt.tz_localize('UTC')

# Convert to another timezone
df['ts_ist'] = df['ts_utc'].dt.tz_convert('Asia/Kolkata')
df['ts_ny']  = df['ts_utc'].dt.tz_convert('America/New_York')

Q: What is the difference between melt and stack in pandas?

  • melt: converts wide format to long format — takes column headers and turns them into values in a new column. Equivalent to SQL UNPIVOT.
  • stack: pivots the innermost column level to become the innermost row index level. Works with MultiIndex DataFrames.

Use melt for reshaping regular DataFrames; use stack/unstack when working with MultiIndex structures.


Q: How would you optimize pandas code for better performance?

  1. Use vectorized operations instead of apply with Python functions
  2. Use appropriate dtypes (category for low-cardinality strings saves memory)
  3. Filter and select columns early to reduce DataFrame size
  4. Use query() for readable, sometimes faster filtering
  5. Use pd.read_csv with dtype and usecols to avoid loading unnecessary data
  6. Replace row-by-row updates (iterrows) with loc or np.where

Q: Explain the concept of broadcasting in NumPy.

Broadcasting allows NumPy to perform operations on arrays of different shapes by automatically expanding the smaller array to match the larger one's shape, without copying data. For example, adding a scalar to an array, or adding a 1D array to each row of a 2D array.

import numpy as np
matrix = np.array([[1,2,3],[4,5,6]])  # shape (2,3)
row    = np.array([10, 20, 30])        # shape (3,)
result = matrix + row                  # broadcasts row across both rows → (2,3)

Q: How would you create a custom visualization using matplotlib/seaborn?

import matplotlib.pyplot as plt
import seaborn as sns

sns.set_theme(style='whitegrid')
fig, ax = plt.subplots(figsize=(10, 6))

sns.lineplot(data=df, x='month', y='revenue', hue='region', ax=ax)
ax.set_title('Monthly Revenue by Region', fontsize=14, fontweight='bold')
ax.set_xlabel('Month')
ax.set_ylabel('Revenue (USD)')
ax.yaxis.set_major_formatter(plt.FuncFormatter(lambda x, _: f'${x:,.0f}'))
ax.legend(title='Region', bbox_to_anchor=(1.05, 1))
plt.tight_layout()

Q: What is the difference between .copy() and assigning a dataframe to a new variable?

Assigning df2 = df creates a reference — both variables point to the same object, so changes to df2 affect df. Using df2 = df.copy() creates an independent copy, so changes to df2 do not affect df. Always use .copy() when you intend to modify a subset without affecting the original.


Q: How would you use pandas to perform an SQL-like operation?

# SELECT + WHERE
result = df.loc[df['status'] == 'active', ['name', 'revenue']]

# GROUP BY + HAVING
grp = df.groupby('region')['revenue'].sum().reset_index()
result = grp[grp['revenue'] > 100000]

# JOIN
result = pd.merge(orders, customers, on='customer_id', how='inner')

# ORDER BY
result = df.sort_values('revenue', ascending=False)

# LIMIT
result = df.head(10)

Q: What is PySpark and when would you use it instead of pandas?

PySpark is the Python API for Apache Spark, a distributed computing framework. Use PySpark instead of pandas when:

  • Your dataset is too large for a single machine (hundreds of GB to TBs)
  • You need parallel processing across a cluster
  • You are working in a data engineering pipeline (ETL at scale)
  • You need fault-tolerant processing of streaming data

For data < a few GB that fits in RAM, pandas is faster and simpler due to lower overhead.

Data Visualization Questions

Q: What are the key principles of effective data visualization?

  1. Clarity: One clear message per chart — remove all chartjunk (unnecessary gridlines, 3D effects, decorations)
  2. Accuracy: Never distort data — start y-axes at zero for bar charts, avoid dual axes without good reason
  3. Data-ink ratio (Tufte): maximize information, minimize non-data ink
  4. Appropriate chart type: match the chart to the data relationship
  5. Accessibility: use color-blind-safe palettes, add labels, ensure sufficient contrast
  6. Context: always include a title, axis labels, units, and data source

Q: Which visualization would you use to show the relationship between two continuous variables?

A scatter plot is the standard choice. Add a regression/trend line to show direction and strength of the relationship. For large datasets with overplotting, use a hexbin plot or 2D density plot (KDE). Add color or size to encode a third variable.


Q: How would you visualize categorical data?

  • Bar chart: compare values across categories (use horizontal bars for long category names)
  • Pie/donut chart: show part-to-whole for few categories (max 5–6 slices)
  • Grouped bar chart: compare categories across a second dimension
  • Treemap: part-to-whole with many categories
  • Dot plot: cleaner alternative to bar charts for comparing many categories

Q: Explain the difference between bar charts, histograms, and box plots.

Chart Data type Shows
Bar chart Categorical Comparison of discrete categories
Histogram Continuous (1 variable) Frequency/distribution of a single variable
Box plot Continuous (1+ groups) Median, IQR, whiskers, and outliers

Histograms have no gaps between bars (they represent continuous ranges); bar charts do.


Q: When would you use a heatmap?

Use a heatmap to display a matrix of values where color encodes magnitude:

  • Correlation matrix between many variables
  • User activity by hour-of-day × day-of-week
  • Feature importance across models
  • Any table where you want to spot patterns quickly

Avoid heatmaps when exact values are important — use a table or bar chart instead.


Q: How do you choose the right chart type for your data?

Ask these questions:

  1. What relationship am I showing? (comparison, distribution, composition, correlation, trend over time)
  2. How many variables? (1 variable → histogram; 2 continuous → scatter; 1 cat + 1 num → bar)
  3. How many data points? (few → bar/dot; many → scatter/heatmap)
  4. Who is the audience? (executives → simple; analysts → interactive with detail)

Q: What tools/libraries do you use for creating visualizations?

Tool Best for
matplotlib / seaborn Static publication-quality charts in Python
plotly Interactive web charts in Python
Tableau Business dashboards, drag-and-drop exploration
Power BI Microsoft ecosystem, embedded reports
D3.js Custom interactive web visualizations
Looker / Metabase Self-serve BI for non-technical users

Q: What is the purpose of data visualization in the analysis process?

Visualization serves two roles: exploratory (helping the analyst find patterns, outliers, and relationships in data during analysis) and explanatory (communicating findings clearly to stakeholders). Numbers in a table are harder to grasp than a well-designed chart — good visualization turns data into insight and action.


Q: How would you create an effective dashboard for stakeholders?

  1. Define the audience and the decisions the dashboard should support
  2. Identify 3–5 key metrics (KPIs) — put them at the top
  3. Group related charts together; use consistent colors and scales
  4. Add filters for slicing by time, region, or segment
  5. Keep it simple — one message per chart, no more than 6–8 charts per page
  6. Test with real users and iterate based on feedback

Q: How do you balance aesthetics and information in your visualizations?

Follow the signal-to-noise principle: every design element should either convey information or improve readability. Remove decorative elements that add no data (gradients, 3D effects, heavy gridlines). Use white space deliberately. Choose colors purposefully — use one accent color to highlight the key point, not a rainbow of colors for decoration.


Q: What is a choropleth map and when would you use it?

A choropleth map colors geographic regions (countries, states, districts) according to a data variable. Use it to show geographic patterns — regional sales, election results, unemployment rates. Limitation: large-area regions visually dominate even if their values are unremarkable. Use with caution and normalize by population when comparing regions of different sizes.


Q: How would you visualize high-dimensional data?

  • Pair plot (scatterplot matrix): shows pairwise relationships between up to ~8 variables
  • PCA / t-SNE / UMAP: reduce to 2D and plot; good for clustering visualization
  • Parallel coordinates plot: each axis is a variable; lines connect each observation's values
  • Heatmap of correlation matrix: shows all pairwise correlations at once

Q: What is color theory and why is it important in data visualization?

Color carries meaning and should be used deliberately. Key principles:

  • Use sequential palettes (light-to-dark) for ordered data (e.g., revenue low → high)
  • Use diverging palettes for data with a meaningful midpoint (e.g., profit/loss)
  • Use categorical palettes for unordered groups
  • Ensure sufficient contrast for accessibility; use color-blind-safe palettes (ColorBrewer, Viridis)
  • Avoid using color as the sole differentiator — add labels or patterns too

Q: Explain the concept of small multiples in visualization.

Small multiples (also called trellis or facet charts) display the same chart type repeated across subsets of data — for example, a line chart of revenue for each region side by side. They allow direct comparison across categories without cluttering a single chart, and leverage the brain's ability to spot differences by position rather than color.


Q: How would you make your visualizations accessible to people with visual impairments?

  1. Use color-blind-safe palettes (avoid red-green combinations)
  2. Don't rely on color alone — add labels, patterns, or shapes
  3. Ensure high contrast between text and background (WCAG AA = 4.5:1 ratio)
  4. Add alt text descriptions to charts in web/report contexts
  5. Offer a data table alongside the chart as an alternative

Q: What is the difference between exploratory and explanatory data visualization?

  • Exploratory: Quick, rough charts made by the analyst for themselves to understand the data. The goal is discovery — finding patterns, outliers, and hypotheses. Most of these charts are never shared.
  • Explanatory: Polished, audience-ready charts that communicate a specific insight. Every design decision supports the one key message you want the audience to take away.

Q: What are the Gestalt principles of visual perception and how do they apply to data visualization?

Key Gestalt principles for charts:

  • Proximity: elements placed close together are perceived as related — group related charts and labels
  • Similarity: elements that look alike (same color/shape) are perceived as related — use consistent color coding
  • Enclosure: a border or background groups elements together — use panels to separate chart sections
  • Continuity: the eye follows lines and curves — useful for line charts showing trends

Q: How would you visualize changes over time?

  • Line chart: best for continuous data over time (revenue, temperature, stock price)
  • Area chart: line chart with filled area — good for showing magnitude and trend
  • Bar chart: better for discrete time periods (monthly totals, quarterly comparisons)
  • Slope chart: comparing two time points across categories
  • Heatmap calendar: showing daily patterns over a year (like GitHub contribution graph)

Q: What is a dual-axis chart and when is it appropriate to use one?

A dual-axis chart overlays two series with different y-axes on the same chart. Use it sparingly and only when two metrics have a meaningful relationship (e.g., revenue and conversion rate over time). It is often misused to imply correlation that may not exist. Clearly label both axes and consider whether a separate chart or indexed chart would be clearer.


Q: How would you visualize part-to-whole relationships?

  • Pie/donut chart: best for 2–5 parts; percentages should sum to 100%
  • Stacked bar chart: compare part-to-whole across multiple groups
  • 100% stacked bar: focuses on proportions, not absolute values
  • Treemap: part-to-whole with many hierarchical categories
  • Waffle chart: alternative to pie chart, easier to read precise percentages

Q: What is Tufte's concept of the "data-ink ratio" and why is it important?

Edward Tufte defined data-ink ratio as the proportion of a chart's ink that is actually used to display data, versus decorative or redundant ink. A high ratio means most visual elements convey information. Applying this principle: remove unnecessary gridlines, borders, tick marks, legends that can be direct labels, 3D effects, and background fills. The result is a cleaner, more readable chart.


Q: How would you visualize uncertainty or confidence intervals in your data?

  • Error bars: add ± standard error or 95% CI to bar and line charts
  • Ribbon/band: shaded area around a line showing CI (common in time series forecasts)
  • Box plot: shows median, IQR, and range, communicating spread directly
  • Violin plot: shows full distribution shape, richer than a box plot
  • Fan chart: shows widening uncertainty into the future (used in economic forecasts)

Q: What is a sankey diagram and when would you use it?

A Sankey diagram shows flows between categories — the width of each flow is proportional to its magnitude. Use it for: user journey/funnel analysis (where do users drop off?), energy/material flow analysis, budget allocation flows, or conversion funnels with multiple paths.


Q: Explain how you would create an interactive visualization.

Use Plotly (Python), D3.js (JavaScript), or Tableau/Power BI for interactive charts. Key interactive features to add: tooltips on hover showing exact values, filters/dropdowns to change the data view, zoom/pan for time series, click-to-drill-down for hierarchical data. For Python web apps, use Dash (Plotly) or Streamlit to embed interactive charts.


Q: What are treemaps and when would you use them?

A treemap displays hierarchical data as nested rectangles, where each rectangle's area is proportional to its value. Use it to show part-to-whole relationships with many categories (e.g., revenue breakdown by category > sub-category > product), or to compare values across a hierarchy where a bar chart would be too crowded.


Q: How would you visualize network or relationship data?

Use a network graph (node-link diagram): nodes represent entities, edges represent relationships. Tools: NetworkX + matplotlib (Python), Gephi (desktop), D3.js (web). For dense networks, use a chord diagram or adjacency matrix heatmap instead. Color nodes by category, size nodes by importance metric.


Q: What are common mistakes or pitfalls in data visualization?

  1. Truncated y-axes on bar charts — exaggerates differences
  2. Pie charts with many slices — hard to compare angles
  3. 3D charts — distort perception of values
  4. Using too many colors — creates confusion instead of clarity
  5. Missing axis labels and units — makes charts uninterpretable
  6. Cherry-picking time ranges — misleads about trends
  7. Dual axes implying correlation without justification

Q: How would you design visualizations for different audience types?

  • Executives: Simple, high-level KPIs, one insight per chart, no jargon, focus on business impact
  • Analysts/data teams: More detail, interactive charts, raw numbers visible, methodology notes
  • General public: Minimal technical terms, strong titles that tell the story, extra annotation
  • Clients: Branded, polished, include context and recommendations

Q: What is a funnel chart and when would you use it?

A funnel chart shows progressive reduction through stages of a process — widest at the top, narrowing as users/items drop off. Use it for: sales pipeline stages, user conversion flows (visit → signup → purchase → retention), recruitment pipelines, or any process with sequential drop-off points.


Q: How do you handle visualizing missing data?

  1. Show missing data explicitly — use a distinct color or pattern (e.g., grey hatching) rather than leaving blank space
  2. Add a note about the percentage of missing values
  3. For time series with gaps, use dotted lines or break the line
  4. In tables, display "N/A" rather than blank cells
  5. Consider a separate chart showing the missingness pattern (e.g., a missingness heatmap)

Data Cleaning and Preparation Questions

Q: What steps do you take to clean a new dataset?

  1. Understand the data: check shape, dtypes, first/last rows, and the data dictionary
  2. Identify missing values: df.isnull().sum() — decide to drop or impute
  3. Remove duplicates: df.drop_duplicates()
  4. Fix data types: convert string dates to datetime, numeric strings to numbers
  5. Handle outliers: cap, remove, or flag extreme values
  6. Standardize formats: consistent casing, date formats, category labels
  7. Validate ranges: catch impossible values (negative ages, future birth dates)
  8. Document changes: keep a cleaning log for reproducibility and audit

Q: How do you identify and handle outliers?

Identify: IQR method (values beyond Q1 ± 1.5×IQR), Z-score (|z| > 3), or visual inspection (box plots, scatter plots).

Handle based on context:

  • Remove if the value is clearly a data entry error (e.g., age = 999)
  • Cap/winsorize at 1st/99th percentile for statistical robustness
  • Keep and flag with an indicator variable so models can learn the pattern
  • Analyze separately if outliers represent a meaningful segment (VIP customers, extreme events)

Q: What techniques do you use to handle missing data?

Method When to use
Drop rows < 5% missing, missing completely at random
Mean/median fill Continuous columns, symmetric distribution
Mode fill Categorical columns
Forward/backward fill Time series with temporal continuity
KNN imputation When missingness correlates with other features
MICE / multiple imputation Complex patterns, high % missing
Indicator variable When the fact of being missing is itself informative

Q: How do you approach feature selection?

  1. Filter methods: correlation with target, mutual information, chi-square test — fast, model-agnostic
  2. Wrapper methods: forward/backward selection using model performance — more accurate but slow
  3. Embedded methods: regularization (Lasso zeroes out irrelevant features), tree feature importance
  4. Domain knowledge: always consult subject matter experts — they know which features are meaningful

Remove features with near-zero variance, high missing rates (> 70%), or high multicollinearity (VIF > 10).


Q: Explain the process of normalizing or standardizing data.

  • Min-Max Normalization: scales values to [0, 1] — (x − min) / (max − min). Sensitive to outliers. Use for algorithms that need bounded inputs (neural networks, KNN).
  • Z-score Standardization: (x − mean) / std. Centers at 0 with unit variance. Use for linear models, SVM, PCA. Robust to distribution shape.
  • Robust Scaling: uses median and IQR instead of mean and std — best when data has many outliers.

Q: What is data transformation and when would you use it?

Data transformation changes the scale, shape, or representation of data to meet modeling assumptions or improve analysis. Common transformations:

  • Log transform: reduces right skew (e.g., income, revenue)
  • Square root: similar to log but milder
  • Box-Cox: family of power transforms that finds the optimal transformation for normality
  • Binning/discretization: convert continuous to categorical (age groups)
  • Encoding: convert categories to numbers for ML models

Q: How do you handle imbalanced data?

For classification with severe class imbalance (e.g., 99% negative, 1% positive):

  1. Resampling: oversample the minority class (SMOTE) or undersample the majority
  2. Class weights: pass class_weight='balanced' to scikit-learn classifiers
  3. Threshold tuning: adjust the decision threshold instead of defaulting to 0.5
  4. Evaluation metrics: use Precision-Recall AUC or F1-score, not accuracy
  5. Ensemble methods: BalancedRandomForest, EasyEnsemble

Q: What techniques would you use to detect anomalies in a dataset?

  • Statistical: Z-score, IQR, Grubbs' test for individual values
  • Isolation Forest: tree-based method that isolates anomalies efficiently
  • DBSCAN: density-based clustering that labels low-density points as noise/anomalies
  • Autoencoder: neural network that reconstructs data — high reconstruction error = anomaly
  • Business rules: hard-coded thresholds (transaction > $10,000, login attempts > 5/minute)

Q: How do you approach feature engineering?

Feature engineering creates new variables that better represent the underlying patterns:

  • Date features: extract day of week, month, is_weekend, days_since_last_purchase
  • Interaction features: multiply two related features (e.g., price × quantity = revenue)
  • Ratio features: revenue per user, orders per session
  • Aggregations: customer-level averages or sums from transaction-level data
  • Text features: TF-IDF, word counts, sentiment scores from text columns
  • Lag features: previous period values for time series

Q: What is dimensionality reduction and when would you use it?

Dimensionality reduction reduces the number of features while preserving important information. Use it when: you have hundreds of correlated features, you want to visualize high-dimensional data in 2D/3D, or you need to speed up model training.

  • PCA: linear method, creates uncorrelated components ordered by variance explained
  • t-SNE / UMAP: non-linear, excellent for 2D visualization of clusters
  • Feature selection: keep a subset of original features (interpretable, unlike PCA)

Q: How do you validate the quality of your data?

  1. Completeness: missing value rates per column
  2. Uniqueness: duplicate row counts; cardinality of ID fields
  3. Validity: values within expected ranges (age 0–120, dates not in the future)
  4. Consistency: same entity has same values across tables (customer name matches across sources)
  5. Accuracy: spot-check samples against the source system or ground truth
  6. Timeliness: data freshness — is it up to date for the analysis period?

Q: What is data imputation and what methods do you use?

Imputation fills missing values with estimated values instead of dropping rows. Simple methods: mean/median/mode fill. Advanced methods: KNN imputation (fills using values from similar rows), MICE (Multiple Imputation by Chained Equations, iteratively models each column with missing values using all others as predictors). Choose based on data size, pattern of missingness, and how much the imputation affects downstream results.


Q: How do you handle large datasets that don't fit into memory?

  1. Load only necessary columns (usecols in pandas)
  2. Use efficient dtypes (int32 instead of int64, category for strings)
  3. Process in chunks: pd.read_csv('file.csv', chunksize=100000)
  4. Use Dask or Polars for out-of-core processing
  5. Push heavy aggregations to the database via SQL — pull only summaries
  6. Use PySpark or BigQuery for truly large (TB-scale) data

Q: What is ETL and how does it relate to data preparation?

ETL stands for Extract, Transform, Load. It is the process of pulling data from source systems (Extract), cleaning and transforming it into the required format (Transform), and loading it into a data warehouse or analytical store (Load). Data preparation is the Transform step — it includes cleaning, joining, aggregating, and reshaping data to make it analysis-ready.


Q: How would you handle duplicate records in a dataset?

# Identify duplicates
print(df.duplicated().sum())
print(df[df.duplicated(subset=['email'], keep=False)])

# Remove exact duplicates
df = df.drop_duplicates()

# Remove duplicates on key fields, keeping the most recent
df = df.sort_values('updated_at', ascending=False)
df = df.drop_duplicates(subset=['customer_id'], keep='first')

Q: What is data profiling and how do you perform it?

Data profiling is the process of examining a dataset to understand its structure, content, and quality. It includes: row/column counts, data types, missing value rates, cardinality, min/max/mean/std per column, frequency distributions of categorical columns, and correlation analysis. Tools: pandas-profiling / ydata-profiling, Great Expectations, or manual profiling with pandas describe().


Q: How do you handle inconsistent data formats (e.g., dates in different formats)?

import pandas as pd

# pd.to_datetime handles many formats automatically
df['date'] = pd.to_datetime(df['date'], infer_datetime_format=True, errors='coerce')

# If mixed formats, parse explicitly
def parse_date(d):
    for fmt in ('%Y-%m-%d', '%d/%m/%Y', '%m-%d-%Y'):
        try:
            return pd.to_datetime(d, format=fmt)
        except:
            continue
    return pd.NaT

df['date'] = df['date'].apply(parse_date)

Q: What methods would you use to detect data entry errors?

  1. Range checks: values outside expected min/max
  2. Type checks: non-numeric values in numeric fields
  3. Format validation: regex for emails, phone numbers, postcodes
  4. Cross-field validation: end_date should be after start_date; quantity × price should equal total
  5. Reference data lookup: city/state combinations that don't match known postal data
  6. Statistical anomalies: values many standard deviations from the mean for that segment

Q: How do you handle outliers in different types of analyses?

  • Descriptive statistics: use median and IQR instead of mean and SD when outliers are present
  • Regression models: winsorize or remove outliers as they can heavily influence coefficients
  • Tree-based models: generally robust to outliers — no transformation needed
  • Clustering: outliers can form their own cluster or skew centroids; consider removing or treating them as noise (DBSCAN handles this naturally)
  • Anomaly detection: outliers are the target, so keep them

Q: What is binning/discretization and when would you use it?

Binning converts a continuous variable into categorical buckets (e.g., age → 18–25, 26–35, 36–50, 50+). Use it to: reduce the impact of outliers, model non-linear relationships with linear models, create interpretable segments for business reporting, or handle sparse continuous values.

df['age_group'] = pd.cut(df['age'], bins=[0,25,35,50,100],
                          labels=['Under 25','26-35','36-50','50+'])

Q: How do you approach text data cleaning and preprocessing?

import re, string
import pandas as pd

def clean_text(text):
    text = str(text).lower()
    text = re.sub(r'<.*?>', '', text)           # remove HTML
    text = re.sub(r'http\S+', '', text)          # remove URLs
    text = re.sub(r'[^a-z0-9 ]', '', text)       # remove punctuation
    text = re.sub(r'\s+', ' ', text).strip()     # normalize whitespace
    return text

df['clean_text'] = df['review'].apply(clean_text)
# Next: tokenize, remove stopwords, stem/lemmatize

Q: What is one-hot encoding and when would you use it?

One-hot encoding converts a categorical column with k unique values into k binary (0/1) columns. Use it for nominal categories (no inherent order) when feeding data into ML models that require numeric input.

df_encoded = pd.get_dummies(df, columns=['color'], drop_first=True)
# drop_first=True avoids the dummy variable trap in regression

For high-cardinality columns (> 50 categories), prefer target encoding or embeddings.


Q: How do you handle categorical variables with high cardinality?

Options for 50–1000+ unique categories:

  1. Target encoding: replace category with mean of target for that category (risk: overfitting — use cross-validation)
  2. Frequency encoding: replace category with its frequency/count in the dataset
  3. Group rare categories: lump categories with < 1% frequency into "Other"
  4. Embeddings: train a neural network embedding layer (used in deep learning)
  5. Hashing: hash the category to a fixed-size vector (sklearn's FeatureHasher)

Q: What are different scaling methods and when would you use each?

Method Formula Best for
Min-Max (x − min)/(max − min) When you need values in [0,1]; sensitive to outliers
Z-score (Standard) (x − mean)/std Linear models, SVM, PCA; assumes roughly normal
Robust (x − median)/IQR Data with outliers; more robust than z-score
Log transform log(x + 1) Highly skewed right distributions

Tree-based models (Random Forest, XGBoost) do NOT need scaling.


Q: How do you ensure data quality throughout an analysis pipeline?

  1. Add data validation checks at each pipeline stage (e.g., Great Expectations, dbt tests)
  2. Log row counts and key metrics before and after each transformation
  3. Implement schema validation — fail fast if column types or ranges change unexpectedly
  4. Write unit tests for data transformation functions
  5. Monitor data freshness and set alerts for pipeline failures
  6. Document assumptions and business logic for future maintainers

Q: What is data augmentation and when is it appropriate?

Data augmentation artificially increases dataset size by creating modified copies of existing data. Common in: image/NLP ML models (flip, rotate, crop images; paraphrase text) and imbalanced classification (SMOTE generates synthetic minority class samples). It is less common in traditional business analytics. Always validate that augmented data preserves real-world distributions.


Q: How do you handle time series data preparation?

  1. Ensure regular time intervals — resample if needed (df.resample('D').sum())
  2. Handle missing timestamps by forward-filling or interpolating
  3. Sort chronologically before analysis
  4. Create lag features (yesterday's value, last week's average)
  5. Handle seasonality (encode day of week, month, holiday flags)
  6. Normalize carefully — use expanding window statistics (only past data) to avoid data leakage

Q: What is feature interaction and how can it improve your models?

A feature interaction is a new feature created by combining two or more existing features (e.g., age × income, or a polynomial term like price²). Interactions capture relationships that neither feature expresses alone. Tree-based models learn interactions automatically; linear models benefit most from manually engineered interaction terms.


Q: How would you handle data versioning in your analysis?

  1. Store raw data immutably — never overwrite original files
  2. Version datasets with timestamps or sequential IDs in filenames/paths
  3. Use DVC (Data Version Control) alongside Git to track dataset versions alongside code
  4. Document which data version was used for each model or analysis
  5. In cloud environments, use partitioned storage (s3://bucket/year=2024/month=05/) for natural versioning

Q: What ethical considerations should be taken into account during data preparation?

  1. Privacy: anonymize or pseudonymize PII; only collect and use data with proper consent
  2. Bias: check whether cleaning/filtering disproportionately removes data for certain groups
  3. Representation: ensure training data represents all groups the model will be applied to
  4. Transparency: document all preprocessing decisions so others can scrutinize the methodology
  5. Data minimization: only retain data needed for the stated analysis purpose

Business Case Questions

Q: How would you measure the success of a product feature?

Define success metrics before launch. Typical framework:

  • North Star Metric: the one metric that best captures value (e.g., weekly active users)
  • Leading indicators: feature adoption rate, engagement with the feature within 7 days
  • Lagging indicators: retention improvement, revenue impact after 30–90 days
  • Guardrail metrics: ensure the feature doesn't hurt page load time, error rate, or other features

Run an A/B test or pre/post analysis with a control group. Calculate statistical and practical significance.


Q: How would you analyze customer churn?

  1. Define churn: no activity for 30/60/90 days, or explicit cancellation
  2. Compute churn rate: churned / total customers at period start
  3. Cohort analysis: track retention curves per signup month — identify if a specific cohort churns faster
  4. Identify churn predictors: logistic regression or gradient boosting on usage frequency, support tickets, NPS, last login, plan type
  5. Segment churners: high-value vs. low-value; voluntary vs. involuntary (payment failure)
  6. Build a prediction model: score churn probability 30 days out — trigger retention campaigns for high-risk users

Q: How would you approach A/B testing?

  1. Define hypothesis and metric: H₀ = no difference; H₁ = variant outperforms control on conversion rate
  2. Calculate required sample size: power analysis (typically 80% power, α = 0.05, minimum detectable effect)
  3. Run the experiment: randomly split users 50/50; collect data for the required duration (min 1–2 weeks to account for weekly patterns)
  4. Analyze: t-test for continuous metrics, chi-square/z-test for proportions; check p-value and effect size
  5. Decide: ship the variant if statistically significant AND practically meaningful
  6. Monitor post-launch: watch guardrail metrics for regressions

Q: How would you identify trends in seasonal data?

  1. Plot the time series and visually inspect for recurring patterns
  2. Use time series decomposition (seasonal_decompose) to separate trend, seasonality, and residual
  3. Compute YoY (year-over-year) growth to compare equivalent periods
  4. Use STL decomposition for complex or multiple overlapping seasonal patterns
  5. Model seasonality with: Fourier terms, seasonal dummies (day-of-week, month), or Prophet

Q: How would you build a forecast model for sales?

  1. Gather historical sales data at the required granularity (daily/weekly/monthly)
  2. Visualize and decompose: identify trend, seasonality, special events
  3. Choose a baseline: seasonal naïve (last year's same period) as the benchmark
  4. Build candidate models: Exponential Smoothing, SARIMA, Prophet, or gradient boosting with lag features
  5. Evaluate with walk-forward cross-validation; report MAE and MAPE on a held-out test set
  6. Include confidence intervals in the forecast deliverable

Q: How would you analyze the effectiveness of a marketing campaign?

Define a control group (users who did not see the campaign) and compare:

  • Conversion rate: did campaign recipients purchase at a higher rate?
  • Revenue lift: incremental revenue attributable to the campaign
  • ROI: (revenue lift − campaign cost) / campaign cost
  • Attribution: multi-touch attribution to understand which touchpoints contributed

Use difference-in-differences or propensity score matching when you can't randomize.


Q: How would you identify key drivers of customer satisfaction?

  1. Collect NPS or CSAT scores alongside structured features (product used, plan tier, support tickets, usage frequency)
  2. Run regression or a tree-based model with satisfaction score as the target — examine feature importance
  3. Use driver analysis (importance × satisfaction) to identify which factors to prioritize: high importance + low satisfaction = priority action
  4. Analyze open-text feedback with topic modeling (LDA) or sentiment analysis to surface qualitative themes

Q: How would you approach cohort analysis?

Group users by a shared characteristic at a fixed point in time (typically signup week/month). Track a key metric (retention, revenue) for each cohort over time. Plot as a retention matrix (cohort × weeks since signup). Identify: are newer cohorts retaining better than older ones? Is there a specific week where most users churn?

cohort = df.groupby(['cohort_month', 'period_number'])['user_id'].nunique().reset_index()
cohort_pivot = cohort.pivot(index='cohort_month', columns='period_number', values='user_id')
retention = cohort_pivot.divide(cohort_pivot[0], axis=0)

Q: What metrics would you use to evaluate the health of an e-commerce business?

Category Key Metrics
Acquisition CAC, new users, traffic, conversion rate
Engagement DAU/MAU, session length, cart add rate
Revenue GMV, AOV (average order value), revenue per user
Retention Repeat purchase rate, churn rate, 30/60/90-day retention
Satisfaction NPS, CSAT, return/refund rate
Operations Fulfillment time, inventory turnover, out-of-stock rate

Q: How would you segment customers for targeted marketing?

  1. RFM segmentation: Recency (last purchase), Frequency (# purchases), Monetary (total spend) — score each dimension and create segments (Champions, At Risk, Hibernating, etc.)
  2. K-Means clustering: cluster on behavioral features and profile each cluster
  3. Demographic segmentation: age, location, industry for B2B
  4. Behavioral segmentation: product category preferences, channel preferences, engagement level

Validate segments are distinct and actionable — different marketing messages should resonate differently with each.


Q: How would you identify cross-selling opportunities?

  1. Market basket analysis: use association rules (Apriori algorithm) to find items frequently bought together — "customers who bought A also bought B" (support, confidence, lift)
  2. Collaborative filtering: recommend products purchased by similar customers
  3. Product affinity matrix: build a co-purchase heatmap to spot natural bundles
  4. Measure lift > 1 as the threshold for a meaningful association

Q: How would you analyze website traffic data to improve conversion?

  1. Funnel analysis: map the conversion funnel (visit → product page → cart → checkout → purchase); measure drop-off at each step
  2. Cohort analysis: compare conversion rates by traffic source, device type, landing page
  3. Session recording / heatmaps: qualitative insight into where users click and where they hesitate
  4. A/B testing: test specific changes to high-drop-off pages
  5. Key metrics: bounce rate, pages per session, time on page, conversion rate by segment

Q: How would you create a pricing strategy based on data?

  1. Price elasticity analysis: measure how demand changes with price changes (% change in demand / % change in price)
  2. Competitive analysis: scrape or collect competitor pricing data
  3. Willingness-to-pay surveys: conjoint analysis or van Westendorp pricing model
  4. Segmented pricing: offer different price tiers based on usage, features, or customer segment
  5. A/B test pricing changes on new users to measure actual elasticity before a full rollout

Q: How would you measure the ROI of a digital advertising campaign?

ROI = (Revenue attributable to campaign − Campaign cost) / Campaign cost × 100%

Challenges: attribution (which touchpoint gets credit?), incrementality (would users have purchased anyway?). Use:

  • Last-click attribution (simple but biased toward bottom-funnel channels)
  • Multi-touch attribution (data-driven, requires enough data volume)
  • Holdout/lift testing: compare conversion rates between exposed and unexposed groups

Q: How would you use data to optimize supply chain operations?

  1. Demand forecasting: predict future demand by SKU and location to optimize inventory levels
  2. Inventory optimization: calculate economic order quantity (EOQ), reorder points, safety stock
  3. Supplier performance analysis: track on-time delivery rate, defect rate, lead time variability
  4. Route optimization: use historical delivery data + ML to minimize delivery time and cost
  5. Stockout/overstock analysis: identify SKUs frequently out of stock or overstocked

Q: How would you identify and reduce customer acquisition costs?

  1. Break down CAC by channel (paid search, social, referral, organic) — total channel spend / new customers from channel
  2. Identify the highest-ROI channels (lowest CAC with highest LTV customers)
  3. Analyze conversion funnels per channel to find inefficiencies
  4. Test and optimize landing pages and ad creative for high-CAC channels
  5. Shift budget toward lower-CAC channels and referral/viral growth mechanisms

Q: How would you analyze the impact of a loyalty program?

Use a difference-in-differences design: compare behavior of loyalty program members vs. non-members before and after joining. Track:

  • Purchase frequency (did it increase after joining?)
  • Average order value (do members spend more per visit?)
  • Churn rate (do members retain at higher rates?)
  • Net impact: incremental revenue from loyalty vs. cost of rewards

Account for selection bias — members who join may already be more engaged customers.


Q: How would you determine the lifetime value of a customer?

Simple LTV: Average Purchase Value × Purchase Frequency × Customer Lifespan

Discounted LTV (more accurate): LTV = Σ (revenue_t − cost_t) / (1 + discount_rate)^t for each period t

Predictive LTV: use the BG/NBD model (for non-contractual businesses) or regression to predict future revenue from behavioral features (recency, frequency, monetary).


Q: How would you analyze and improve user engagement metrics?

Define engagement clearly (DAU/MAU, session length, feature usage, comments, shares). Identify which features or actions correlate with long-term retention (the "aha moment"). Segment low vs. high engagement users and identify differences in their behavior. Run targeted experiments to nudge low-engagement users toward high-value actions.


Q: How would you design a KPI dashboard for executive leadership?

  1. Start with the key business questions executives need to answer
  2. Select 5–8 top-level KPIs (revenue, growth rate, churn, NPS, CAC, LTV)
  3. Show KPIs with trend (current value vs. prior period) and target
  4. Add one chart per KPI for context (trend line, sparkline)
  5. Keep it high-level — link to detailed drill-down reports for analysts
  6. Update automatically; add alerts for significant deviations

Q: How would you use data to identify potential new markets or products?

  1. Market sizing: estimate total addressable market (TAM) for candidate segments using industry data, search volume, survey data
  2. Gap analysis: where do existing customers cluster that you don't yet serve?
  3. Adjacent analysis: what products do your best customers also buy elsewhere?
  4. Trend analysis: Google Trends, social media signals, patent filings for emerging demand
  5. Customer interviews + survey data: validate quantitative signals with qualitative research

Q: How would you analyze employee productivity and satisfaction data?

Combine HR data (output metrics, attendance, performance ratings) with survey data (engagement scores). Use regression to identify which factors (manager quality, role clarity, compensation, remote work) drive productivity and satisfaction. Ensure data is aggregated to protect individual privacy. Segment by team, tenure, or role to find patterns.


Q: How would you measure and improve product or service quality?

  1. Define quality metrics: defect rate, return rate, support ticket volume, NPS, CSAT
  2. Root cause analysis: Pareto analysis (which defect types cause 80% of complaints?), fishbone diagram
  3. Statistical process control: control charts to detect when a process goes out of spec
  4. A/B test improvements: measure whether a process change reduces the defect rate
  5. Feedback loops: collect structured post-purchase or post-service surveys

Q: How would you use data to optimize inventory management?

  1. Demand forecasting: predict future demand per SKU using historical sales, seasonality, promotions
  2. ABC analysis: classify items by revenue contribution (A = top 20% of items = 80% of revenue)
  3. Safety stock calculation: buffer stock = Z × σ_demand × lead_time
  4. Reorder point: (average daily demand × lead time) + safety stock
  5. Dead stock identification: flag SKUs with > 90 days without sales for clearance or discontinuation

Q: How would you analyze social media data for business insights?

  1. Sentiment analysis: classify posts as positive/negative/neutral using NLP (VADER, transformers)
  2. Topic modeling: LDA or BERTopic to find recurring themes in mentions
  3. Share of voice: brand mentions vs. competitor mentions over time
  4. Influencer analysis: identify accounts with high reach and engagement that mention the brand
  5. Trend detection: spike detection in mention volume that correlates with product/campaign events

Q: How would you determine the optimal marketing mix?

Use Marketing Mix Modeling (MMM): a regression model where revenue (or conversions) is the dependent variable and marketing channel spend variables are predictors, plus controls for seasonality, price, and economic factors. The coefficients represent the incremental contribution of each channel. Optimize budget allocation by maximizing revenue subject to budget constraints using the estimated response curves.


Q: How would you use data to improve customer retention strategies?

  1. Identify at-risk customers using a churn prediction model (score daily/weekly)
  2. Segment by value: prioritize high-LTV at-risk customers for high-touch interventions
  3. Design targeted retention campaigns (discount, personalized outreach, feature highlight)
  4. A/B test retention interventions to measure incremental impact
  5. Track net retention improvement quarter-over-quarter; calculate cost per retained customer

Q: How would you analyze the impact of price changes on demand?

Compute price elasticity = % change in demand / % change in price. Use:

  • Regression analysis: regress sales volume on price (control for seasonality, promotions)
  • A/B test: randomly show different prices to different user segments
  • Difference-in-differences: compare regions/segments with and without price changes

Elasticity < −1 = elastic (demand is price-sensitive); > −1 = inelastic.


Q: How would you measure and improve team performance metrics?

Define meaningful KPIs for the team's function (engineering: deployment frequency, bug rate; sales: pipeline conversion, quota attainment; support: resolution time, CSAT). Track trends over time and benchmark against targets. Run retrospectives to identify root causes of metric changes. Ensure metrics measure outcomes (not just activity) and can't be easily gamed.


Q: How would you use data to identify and mitigate business risks?

  1. Risk identification: analyze historical incidents, near-misses, and external risk indicators
  2. Quantification: assess probability and impact of each risk
  3. Early warning indicators: define leading metrics that signal emerging risk (e.g., increasing customer complaint rate → churn risk; rising defect rate → quality risk)
  4. Scenario analysis: model financial impact under different risk scenarios
  5. Monitoring dashboard: track risk indicators in near-real-time with alert thresholds

Behavioral Questions

Q: Describe a challenging data analysis project you worked on.

Use the STAR method: describe a project where data was messy, requirements were ambiguous, or stakeholders had conflicting needs. Focus on the specific challenge (e.g., joining data across 5 different sources with no common key, or delivering analysis under a 48-hour deadline). Explain what you did — the decisions you made, tools you used — and the measurable business outcome your analysis enabled.


Q: How do you communicate technical findings to non-technical stakeholders?

Lead with the business insight, not the methodology: "Mobile conversion is 23% lower than desktop — here's why and what to do." Use simple visuals (one chart per point). Replace jargon with plain language — instead of "p-value < 0.05" say "we're 95% confident this is a real difference." End with a clear recommendation and the trade-offs, not just findings. Anticipate questions and pre-address data quality concerns proactively.


Q: How do you stay updated with the latest trends in data analysis?

Regular reading: towards data science, Data Elixir newsletter, Lex Friedman / Huberman for broad science. Following practitioners on LinkedIn and X. Kaggle competitions to practice new techniques. Attending data meetups or webinars. Taking structured courses (Coursera, fast.ai) for major skill gaps. The key is applying new learning to real projects quickly — passive reading fades without practice.


Q: Describe how you've used data to drive business decisions.

Prepare a specific example: state the business question, the data you used, the analysis methodology, the finding, and — most importantly — the decision that was made as a result and the measurable impact. Strong answers include a before/after metric (e.g., "our analysis showed campaign A underperformed by 35% vs. B, leading the team to reallocate $200K in budget, increasing ROI by 18%").


Q: How do you handle tight deadlines for analysis projects?

  1. Clarify the minimum viable analysis — what is the single most important question to answer?
  2. Time-box exploratory work — set a fixed time for data exploration before moving to analysis
  3. Use existing templates or prior analyses as a starting point
  4. Communicate early if the scope is too large for the deadline — propose what can be delivered vs. what needs more time
  5. Deliver a clear, confident insight even if it is preliminary — note the caveats explicitly

Q: Tell me about a time when your analysis led to a significant business impact.

Structure your answer: the problem the business faced → the analysis you conducted → the specific insight you surfaced → the decision made → the quantified outcome. Even if the impact wasn't large in absolute terms, highlight the decision-making process and your analytical contribution. Be specific about numbers.


Q: How do you prioritize requests from different stakeholders?

Evaluate each request on: business impact (revenue/cost/risk), urgency (decision deadline), and analytical complexity (time required). Use a prioritization framework (e.g., impact/effort matrix). Communicate the prioritized queue transparently to all stakeholders. Push back diplomatically on low-impact requests or re-scope them to something smaller and faster.


Q: Describe how you've collaborated with other teams (engineering, product, etc.).

Highlight examples of working cross-functionally: sitting with engineers during data pipeline design to ensure the right events are logged, partnering with product during A/B test setup to define metrics and success criteria, or translating business requirements from a product manager into a data model. Emphasize proactive communication and shared ownership of data quality.


Q: How do you handle situations where the data doesn't support a stakeholder's hypothesis?

Present the data objectively — do not soften numbers that contradict a belief. Explain the methodology clearly so the stakeholder trusts the analysis. Offer to run additional segments or cuts — sometimes the aggregate hides a real effect in a subgroup. If they push back, propose a small pilot test to settle the question empirically. Never adjust the analysis to produce a desired result.


Q: Tell me about a time when you made a mistake in your analysis. How did you handle it?

The key here is showing: you caught the mistake (ideally before it caused harm), you disclosed it proactively, you understood the root cause, and you put a process in place to prevent recurrence. A good answer shows intellectual honesty, ownership, and a systematic approach to quality control (peer review, validation checks, automated tests).


Q: How do you ensure the accuracy of your analyses?

  1. Validate data sources — check row counts and key distributions against known benchmarks
  2. Sanity-check outputs — compare totals to last quarter's report or finance numbers
  3. Have a colleague reproduce a key number independently
  4. Version-control your analysis scripts in Git so changes are traceable
  5. Document all assumptions, filters, and business logic applied
  6. Test edge cases: what happens when a column is all NULL? When there are no records in a date range?

Q: Describe how you've automated a repetitive analysis process.

Examples: scheduling a SQL query + email report with Airflow or dbt, building a Python script that replaces a weekly manual Excel process, creating a parameterized Tableau dashboard so stakeholders can self-serve instead of requesting custom reports. Focus on the time saved, error reduction from removing manual steps, and the business benefit of faster data availability.


Q: How do you approach learning new tools or techniques for data analysis?

Start with the official documentation and a small toy project. Look for a tutorial that solves a problem similar to your actual work. Then apply the tool to a real, low-stakes internal project. Document what you learn. Ask for code reviews from colleagues who know the tool. The fastest learning path is always deliberate practice on a real problem, not just passive reading.


Q: How do you balance speed and thoroughness in your analysis?

Calibrate based on the stakes of the decision and the reversibility of the action. A one-time tactical decision (next week's promotion) needs speed; a strategic decision (entering a new market) warrants more rigor. Communicate uncertainty clearly — a 70% confidence insight delivered now may be more valuable than a 95% confidence insight delivered two weeks late. Always disclose limitations alongside findings.


Q: Tell me about a time when you had to work with incomplete or messy data.

Describe the data quality issue (missing values, inconsistent formats, unreliable joins), the impact it had on the analysis, and how you handled it (imputation strategy, conservative assumptions, excluding unreliable data and flagging the limitation, working with engineering to fix the upstream source). Show you can deliver useful insights even under imperfect data conditions.


Q: How do you handle feedback on your analyses?

Listen openly — feedback from domain experts often reveals business context you were missing. Separate feedback about the analysis approach (valid to discuss) from requests to change the numbers (never appropriate). Ask clarifying questions to understand the concern. If the feedback reveals a genuine flaw, acknowledge it, fix it, and describe what you learned. If the feedback is a disagreement with the result, propose an empirical way to resolve it.


Q: Describe a situation where you had to defend your analytical approach or findings.

Prepare a specific example where: the finding was counterintuitive or contradicted conventional wisdom, you were confident in your methodology, and you were able to explain clearly why your approach was sound. Mention how you walked through the methodology step by step, addressed specific objections with data, and ultimately helped the stakeholder understand and trust the result.


Q: Tell me about a time when you had to quickly learn a new domain or industry for your analysis.

Describe your learning process: reading company documents and industry reports, interviewing domain experts, reviewing past analyses, identifying the key metrics and definitions used in that domain. Show you can ask the right questions ("What does this metric actually measure? Are there known data quality issues here?") rather than making assumptions.


Q: How do you manage your time across multiple analysis projects?

Keep a visible task list ranked by deadline and impact. Time-block deep work for complex analyses (2–3 uninterrupted hours). Batch ad-hoc requests to specific slots (e.g., 1 hour each morning). Communicate proactively when a project will take longer than expected. Use automation for recurring work to free time for higher-value analysis.


Q: Describe how you've handled conflicting priorities from different stakeholders.

Acknowledge competing demands openly rather than silently choosing one stakeholder. Facilitate a conversation between stakeholders to align on priorities based on business impact. Escalate to your manager when you cannot resolve the conflict directly. Be transparent about capacity: "I can complete request A this week or request B — which is higher priority for the business right now?"


Q: Tell me about a time when you identified an opportunity for improvement that others had missed.

Strong answers involve proactive exploration — you went beyond the original brief, noticed something in the data (an unexpected pattern, a segment performing differently), and translated it into a business recommendation. Show that you think beyond just answering the question asked and look for adjacent insights that create additional value.


Q: How do you handle situations where you don't have all the data you need?

  1. Assess what decisions can still be made with available data, with noted caveats
  2. Use proxy metrics — find an available variable that correlates with the unavailable one
  3. Make conservative assumptions and be explicit about them
  4. Initiate data collection for the future: work with engineering to log what's needed
  5. Use external data sources (industry benchmarks, public datasets) to fill gaps

Q: Describe a time when you had to change your analysis approach midway through a project.

Show adaptability: you started with one hypothesis or method, discovered it wasn't working (data didn't support the assumption, the metric was flawed, the analysis was technically infeasible), and pivoted to a better approach. Emphasize that you recognized the issue early, communicated the change and why it was needed, and ultimately delivered a better result.


Q: How do you ensure your analyses align with broader business goals?

Before starting, connect the analytical question to a specific business decision: "This analysis will inform whether to invest $500K in channel X." Review with the stakeholder that your proposed methodology actually answers the right question. Cross-check your output against the strategic priorities for the quarter. Deliver findings in the context of business impact, not just numbers.


Q: Tell me about a time when you had to simplify a complex analysis for better understanding.

Describe how you translated a multi-variable regression output, a clustering result, or a complex statistical test into a clear, actionable insight for a non-technical audience. Focus on: the simplification choices you made, what you left out and why, how you used visuals to replace equations, and how you validated that the simplified message was still accurate.


Q: How do you handle ambiguity in analysis requirements?

Ask clarifying questions before starting: What decision will this analysis inform? Who is the audience? What does success look like? What is the deadline? What data is available? When requirements are genuinely unclear, deliver an exploratory analysis with multiple interpretations rather than making a single assumption. Iterate quickly with stakeholders rather than spending weeks on a potentially wrong approach.


Q: Describe a situation where you had to collaborate with subject matter experts to complete an analysis.

Examples: working with a clinician to understand what a medical metric means before building a model, partnering with a finance team member to understand how revenue is recognized before doing an attribution analysis, or coordinating with an operations expert to validate that a supply chain model's assumptions were realistic. Show that you value domain expertise and don't assume you know better than experts.


Q: How do you maintain objectivity in your analyses when there might be pressure for certain outcomes?

Separate the analytical finding from the decision and recommendation. The data says what it says — your job is to report it accurately and explain what it means. When you feel pressure to change a conclusion, ask for a technical review of your methodology. If the pressure is inappropriate, escalate. Build a reputation for intellectual honesty — stakeholders should trust your numbers precisely because they know you won't manipulate them.


Q: Tell me about a time when you helped improve data literacy within your organization.

Examples: running a SQL workshop for non-technical colleagues, creating a self-serve dashboard that replaced ad-hoc data requests, writing documentation that helped business teams understand which metrics to use and when, or mentoring a junior analyst. Focus on the impact — did it save hours of requests? Did teams make faster, more data-informed decisions?


Q: How do you advocate for data-driven decision making in an organization?

Lead by example — deliver analyses that are accurate, timely, and clearly connected to business outcomes. Build credibility first, then use it to influence decisions. Help leaders see where data could resolve a debate or reduce risk. Make data accessible (dashboards, documentation). Acknowledge the limits of data — sometimes intuition and experience matter too. Frame data as reducing uncertainty, not eliminating judgment.

Technical Scenario Questions

Q: You're given a dataset with user activity logs. How would you identify unusual patterns or potential fraud?

  1. Velocity checks: flag accounts with unusually high action counts in a short time window (> mean + 3σ per hour)
  2. Behavioral fingerprinting: cluster users by normal behavior; flag those that don't fit any cluster
  3. Device/IP analysis: multiple accounts sharing the same device ID, IP, or payment method
  4. Time-of-day analysis: activity at unusual hours for the account's historical pattern
  5. Rule-based triggers: hard thresholds like 50 logins in 1 minute or transactions from two countries within 30 minutes
hourly = logs.groupby(['user_id', pd.Grouper(key='timestamp', freq='H')]).size()
threshold = hourly.mean() + 3 * hourly.std()
suspicious = hourly[hourly > threshold]

Q: You have a dataset with high cardinality categorical variables. How would you handle them in your analysis?

Options depending on the model and context:

  • Frequency encoding: replace category with its count or frequency in the dataset
  • Target encoding: replace with the mean of the target for that category (use cross-validation to avoid leakage)
  • Group rare categories: bin categories with < 1% frequency into "Other"
  • Hashing: use sklearn's FeatureHasher for a fixed-size encoding
  • Embeddings: train a neural network embedding layer (most powerful for NLP or high-cardinality IDs)

Q: You're asked to forecast sales for the next quarter. What approach would you take?

  1. Gather historical data at the required granularity; check for seasonality and trend
  2. Use a seasonal naïve model as the baseline (last year's same quarter)
  3. Build candidate models: Exponential Smoothing, Prophet, or gradient boosting with lag/seasonal features
  4. Evaluate with walk-forward cross-validation; report MAPE and MAE on held-out data
  5. Deliver forecast with 80% and 95% confidence intervals, not just a point estimate
  6. Document assumptions (stable macro conditions, no major promotions, etc.)

Q: You're analyzing customer feedback data. How would you extract key themes and sentiments?

  1. Sentiment analysis: classify each review as positive/neutral/negative using VADER (rule-based, fast) or a transformer model (BERT-based, more accurate)
  2. Topic modeling: use LDA or BERTopic to discover recurring themes without labeled data
  3. Keyword frequency: TF-IDF to find terms that distinguish positive vs. negative reviews
  4. Named entity recognition: extract product names, features, and locations mentioned
  5. Summarize: report top themes in positive vs. negative feedback, trend over time, and correlation with star rating

Q: You're given a large dataset that crashes your tool. How would you approach analyzing it?

  1. Profile the file first: check size, number of rows, column types (head, schema inspection)
  2. Load only necessary columns: pd.read_csv(f, usecols=['col1','col2'])
  3. Optimize dtypes: use int32 instead of int64, category for strings
  4. Process in chunks: pd.read_csv(f, chunksize=100_000)
  5. Move heavy aggregations to SQL or use Dask/Polars for out-of-core processing
  6. Sample first: validate your analysis logic on 1% of data before scaling up

Q: You notice conflicting trends in two related metrics. How would you investigate this?

  1. Verify both metrics are calculated consistently (same population, same date filters, same business logic)
  2. Check for data pipeline issues: are both pulling from the same source? Different refresh cadences?
  3. Look for composition effects: the aggregate metric may trend one way while segment-level trends differ (Simpson's paradox)
  4. Check for definition changes or logging changes introduced around the divergence point
  5. Document your findings and consult domain experts before drawing conclusions

Q: How would you design a system to monitor key business metrics and detect anomalies?

  1. Define KPIs and their expected behavior (trend, seasonality, acceptable range)
  2. Set up a scheduled pipeline (Airflow/dbt) to compute metrics and store in a time-series table
  3. Apply anomaly detection: rule-based (> X% drop vs. prior period) or statistical (3σ from rolling mean) or ML (Prophet, Isolation Forest)
  4. Route alerts to Slack/email with context: current value, expected range, comparison period, link to dashboard
  5. Tier alerts (critical vs. warning) and require acknowledgment for critical ones to reduce fatigue

Q: You're asked to build a recommendation system for products. How would you approach this?

  1. Collaborative filtering: recommend products liked by similar users (matrix factorization, ALS)
  2. Content-based filtering: recommend products similar to what the user has engaged with (product features, embeddings)
  3. Popularity baseline: recommend top-selling products as the fallback for new users (cold-start problem)
  4. Hybrid: combine collaborative and content-based signals
  5. Evaluate with: precision@k, recall@k, NDCG, and offline A/B comparison vs. baseline; then run an online A/B test

Q: How would you analyze the impact of a recent price change on customer behavior?

Use difference-in-differences: compare behavior before vs. after the price change for affected customers vs. a control group (customers on a different plan or region). Alternatively, run a regression discontinuity design if the price change was time-based. Measure: conversion rate, churn rate, average order value, and revenue per user. Compute price elasticity from the observed demand change.


Q: You're given website clickstream data. How would you analyze the user journey and identify drop-off points?

  1. Define key conversion funnel stages (home → product → cart → checkout → purchase)
  2. Compute the conversion rate at each step: sessions reaching step N+1 / sessions reaching step N
  3. Identify which step has the biggest drop-off
  4. Segment by device, traffic source, and user type to find where specific groups struggle
  5. Combine with session recording / heatmap data for qualitative insight
  6. A/B test improvements on the highest drop-off page

Q: How would you conduct a market basket analysis to understand product associations?

Use the Apriori algorithm or FP-Growth to find association rules from transaction data. Key metrics:

  • Support: % of transactions containing both A and B
  • Confidence: % of transactions with A that also contain B
  • Lift: confidence / (support of B alone) — lift > 1 means A and B co-occur more than by chance
from mlxtend.frequent_patterns import apriori, association_rules

basket = df.groupby(['transaction_id','product'])['qty'].sum().unstack().fillna(0)
basket = (basket > 0).astype(int)
frequent_items = apriori(basket, min_support=0.01, use_colnames=True)
rules = association_rules(frequent_items, metric='lift', min_threshold=1.5)

Q: You're tasked with optimizing delivery routes based on historical delivery data. How would you approach this?

  1. Analyze historical data: delivery times, distances, traffic patterns by time-of-day and day-of-week
  2. Build a travel time model that accounts for time-of-day and distance
  3. Apply route optimization algorithms (Vehicle Routing Problem: OR-Tools, Google Maps Distance Matrix API)
  4. Incorporate constraints: delivery windows, vehicle capacity, driver hours
  5. A/B test optimized routes vs. current routes on a subset of deliveries; measure on-time rate and total distance

Q: How would you build a customer lifetime value model?

Simple approach: LTV = Average Order Value × Purchase Frequency × Average Customer Lifespan

Statistical approach (BG/NBD model): models the probability a customer is still alive and their expected purchase rate, handling non-contractual businesses where customers can go silent without explicitly churning.

ML approach: train a regression model predicting total revenue in the next 12 months using features: recency, frequency, monetary (RFM), tenure, product category, and channel.

Validate by comparing predicted vs. actual LTV on a held-out cohort.


Q: You're given social media data about your product. How would you extract actionable insights?

  1. Aggregate and classify mentions by sentiment (positive/negative/neutral)
  2. Topic model to find recurring themes — what aspects of the product generate the most discussion?
  3. Trend analysis: are mentions growing or declining? What triggered spikes?
  4. Competitor comparison: share of voice, sentiment comparison
  5. Identify high-reach advocates and detractors (influencers)
  6. Translate insights: negative sentiment about a specific feature → product team action; positive mentions → content for marketing

Q: How would you design and analyze an experiment to test a new feature's impact?

  1. Define: primary metric (e.g., 7-day retention), guardrail metrics, minimum detectable effect
  2. Power analysis: calculate required sample size to achieve 80% power at α = 0.05
  3. Randomization: randomly assign users to control/treatment at the user level (not session level)
  4. Run: collect data for the required duration (minimum 1–2 weeks to control for day-of-week effects)
  5. Analyze: t-test or chi-square; check for novelty effects, network effects, and segment-level results
  6. Decide and document: record the methodology, result, and decision for future reference

Q: You discover that a dataset you've been using for months has data quality issues. How would you handle this?

  1. Immediately quantify the scope: which records are affected? What time range? What is the magnitude of the error?
  2. Assess impact: which analyses, models, or dashboards were built on this data?
  3. Communicate transparently to stakeholders — do not sit on the issue
  4. Re-run the critical analyses with corrected data; clearly mark previous outputs as potentially flawed
  5. Fix the upstream data issue with engineering; add data quality tests to prevent recurrence
  6. Document a post-mortem with root cause and prevention steps

Q: You're asked to analyze the relationship between employee satisfaction and productivity. How would you approach this?

  1. Define and source both variables: satisfaction from employee surveys (eNPS, Likert scale); productivity from output metrics appropriate to the role
  2. Check for confounders: tenure, role, team size, manager quality all affect both
  3. Run a correlation analysis first, then a multivariate regression controlling for confounders
  4. Ensure privacy: aggregate to team level, not individual, before sharing results
  5. Validate findings with HR and management before drawing causal conclusions

Q: How would you identify and analyze seasonality in a business with multiple overlapping cycles?

Use STL (Seasonal and Trend decomposition using LOESS) which handles multiple seasonal periods simultaneously. Alternatively, use Prophet which models daily, weekly, and yearly seasonality independently plus holiday effects. To detect multiple seasonality manually, compute autocorrelation (ACF plot) and look for significant spikes at lag 7 (weekly), 30 (monthly), and 365 (annual).


Q: You're tasked with building a dashboard that needs to update in real-time. How would you approach this?

  1. Data pipeline: stream events to a real-time store (Kafka → Flink/Spark Streaming → a time-series DB like ClickHouse or Druid, or a materialized view in BigQuery)
  2. API layer: expose pre-aggregated metrics via a low-latency API endpoint
  3. Frontend: use a WebSocket or server-sent events connection to push updates to the dashboard (Grafana, Superset, or custom React dashboard with polling)
  4. Define "real-time" with stakeholders — 1 minute latency may be sufficient; true sub-second is much more complex

Q: You notice that two different data sources are giving conflicting information. How would you reconcile this?

  1. Identify the exact discrepancy: which metric, what magnitude, what time range?
  2. Check definitions: do both sources define the metric the same way? (e.g., "active user" might differ)
  3. Check technical differences: different join logic, different timezone handling, different granularity
  4. Trace data lineage: where does each source originate? Is one more authoritative (e.g., source of truth in the data warehouse)?
  5. Align with stakeholders on which source to use and document the decision; fix the discrepancy upstream if possible

Q: You're asked to predict which customers are most likely to upgrade to a premium service. How would you build this model?

  1. Define the target: customers who upgraded within the next 30 days
  2. Features: current plan, usage metrics (sessions, feature usage, storage), tenure, support interactions, pricing page visits, email engagement
  3. Model: logistic regression (interpretable) or gradient boosting (more accurate)
  4. Evaluate: AUC-ROC, precision@k (how many of the top K predicted users actually upgrade?)
  5. Deploy: score all users weekly; trigger targeted upgrade campaigns for top-decile users
  6. Measure incrementality: A/B test — do users who receive the campaign upgrade at a higher rate than the control group?

Q: How would you analyze the effectiveness of different customer service channels?

Compare channels (email, chat, phone, self-service) on: resolution rate, average resolution time, customer satisfaction score (CSAT) post-interaction, repeat contact rate (did the issue come back?), and cost per interaction. Control for issue type complexity — some issues are naturally routed to more expensive channels. Use regression to isolate the channel effect from the ticket complexity effect.


Q: You're given transaction data and asked to identify potential money laundering activities. What approach would you take?

  1. Structuring detection: identify transactions just below reporting thresholds (e.g., multiple $9,900 transactions)
  2. Network analysis: build a graph of fund flows; flag circular flows or rapid layering (A sends to B, B sends to C, C sends back to A)
  3. Velocity anomalies: accounts receiving many small deposits and sending one large transfer
  4. Geolocation anomalies: transactions from jurisdictions with high money laundering risk
  5. Isolation Forest / Autoencoder: unsupervised anomaly detection on behavioral features
  6. Escalate flagged cases to a compliance team for manual review — do not act automatically

Q: How would you use data to optimize employee scheduling based on customer demand patterns?

  1. Forecast demand at granular time intervals (15-min or hourly) using historical data + seasonality + events
  2. Define staffing requirements: minimum staff per demand level, skill requirements per shift
  3. Formulate as an optimization problem: minimize labor cost subject to demand coverage constraints (use linear programming or a scheduling solver like OR-Tools)
  4. A/B test the optimized schedule vs. the current schedule on a subset of locations; measure wait times and customer satisfaction

Q: You're asked to analyze the root causes of manufacturing defects. How would you approach this?

  1. Pareto analysis: rank defect types by frequency — the top 20% of causes likely produce 80% of defects
  2. Process control charts: identify whether defects are random variation or assignable-cause variation
  3. Fishbone / Ishikawa diagram: structure potential causes (machine, method, material, manpower, measurement, environment)
  4. Regression / DOE (Design of Experiments): quantify the contribution of specific factors (temperature, machine operator, material batch) to defect rate
  5. Root cause verification: validate with subject matter experts before implementing fixes

Q: How would you measure and improve the accuracy of a demand forecasting model?

Evaluate with MAPE (Mean Absolute Percentage Error), MAE, and RMSE on a held-out test set using walk-forward cross-validation. Compare against baselines (naïve seasonal model). To improve: add external features (promotions, holidays, weather, economic indicators), use more granular data, try ensemble methods, or apply transfer learning from related products. Monitor drift over time with a control chart on forecast error.


Q: You've been asked to analyze customer reviews to improve product features. What methodology would you use?

  1. Sentiment analysis: classify each review as positive/negative/neutral
  2. Aspect-based sentiment analysis: extract sentiment about specific features (battery life, screen, price) from text
  3. Topic modeling (BERTopic or LDA): discover recurring themes across reviews
  4. Quantitative linkage: correlate review themes with star rating and return rate to prioritize which issues matter most
  5. Competitive benchmarking: apply the same analysis to competitor reviews to identify gaps

Q: How would you design an attribution model to understand which marketing channels drive conversions?

Start with last-click attribution as the baseline. Move to data-driven multi-touch attribution which uses ML (Markov chains or Shapley values) to assign fractional credit to each touchpoint in the conversion path. Validate with holdout experiments (turn off one channel and measure the conversion impact). Report incremental ROAS (Return on Ad Spend) per channel, not just attributed revenue.


Q: You're asked to analyze the impact of weather on sales. How would you approach this?

  1. Join historical sales data with weather data (temperature, precipitation, wind) at the same geographic and temporal granularity
  2. Run correlation analysis between weather variables and sales by product category
  3. Build a regression model: sales ~ temperature + precipitation + day_of_week + month + holiday (control for seasonality)
  4. Measure effect size: how much does a 10°C increase in temperature affect ice cream sales vs. winter coat sales?
  5. Use findings to improve demand forecasting by including weather forecasts as features

Q: How would you design a data model to track and analyze the customer journey across multiple touchpoints?

Build a customer event table: one row per customer action with columns: customer_id, session_id, timestamp, event_type (page_view, add_to_cart, purchase), channel (organic, paid, email), and device. Link to a customer dimension table and a campaign dimension table. Use window functions to build session-level and journey-level aggregations. This enables funnel analysis, attribution, and cohort analysis from a single flexible model.

Tool-Specific Questions

Q: How would you use Excel for data analysis? What are its limitations?

Excel is useful for: quick exploratory analysis, simple pivot tables and charts, small datasets (< 1M rows), sharing results with non-technical stakeholders, and vlookup/index-match for data lookups. Limitations: no version control, breaks with large data, manual processes are error-prone, difficult to reproduce or audit, no native statistical testing, and limited visualization customization.


Q: What features of Tableau/Power BI do you find most useful for data analysis?

Tableau: calculated fields, LOD (Level of Detail) expressions for complex aggregations, parameter controls, set actions for interactive filtering, and table calculations (running total, % of total). Power BI: DAX measures for business calculations, row-level security, Power Query for ETL, DirectQuery for live database connections, and native integration with the Microsoft ecosystem (Azure, SharePoint, Teams).


Q: How do you approach writing efficient SQL queries for large datasets?

  1. Filter early — apply WHERE conditions before joining
  2. Use CTEs for readability but avoid deeply nested CTEs that prevent optimizer push-down
  3. Use appropriate JOIN types — avoid CROSS JOIN unless intended
  4. Only select needed columns — avoid SELECT *
  5. Use partitioned columns in WHERE clauses to enable partition pruning (in BigQuery, Redshift, Hive)
  6. Analyze the query execution plan with EXPLAIN ANALYZE before optimizing

Q: What are the advantages of using Python/R over Excel for data analysis?

Python/R Excel
Handles any data size (with proper tools) Breaks at ~1M rows
Reproducible, version-controlled scripts Manual, error-prone
Full statistical library ecosystem Limited statistical functions
Automation and scheduling Manual execution
Can connect to databases, APIs, cloud Limited connectivity
Free and open-source Licensed

Q: How would you use Git in your data analysis workflow?

Track your analysis scripts and notebooks in Git just like code. Use branches for experimental analyses. Write meaningful commit messages that describe what changed and why. Use .gitignore to exclude data files and credentials. Use pull requests for peer review of significant analyses. Tag releases when you share an analysis with stakeholders so you can reproduce it later.


Q: What ETL tools have you worked with and what are their strengths?

Tool Strengths
dbt SQL-based transformations, version control, testing, documentation
Apache Airflow General workflow orchestration, complex DAGs, large ecosystem
Fivetran / Airbyte Managed EL (extract-load), 100+ connectors, minimal maintenance
Spark (PySpark) Distributed processing for very large data
Informatica / Talend Enterprise ETL, GUI-based, heavy governance

Q: How do you use GitHub/GitLab in your data workflow?

Store analysis code and notebooks in a repository. Use pull requests for peer review. CI/CD pipelines can run data tests (pytest, great_expectations) automatically on merge. Issues and milestones track analytical work. Use GitHub Actions to schedule and run data pipeline scripts. Document data models and analysis in the repo's README or a docs/ folder.


Q: How familiar are you with cloud platforms (AWS, GCP, Azure) for data analysis?

Key data services by platform:

  • AWS: S3 (storage), Redshift (data warehouse), Glue (ETL), Athena (serverless SQL on S3), SageMaker (ML)
  • GCP: BigQuery (serverless data warehouse), Cloud Storage, Dataflow (streaming ETL), Vertex AI (ML)
  • Azure: Azure Data Lake, Synapse Analytics, Azure ML, Azure Databricks, Power BI

All three offer managed Spark (Databricks, EMR, Dataproc) and serverless SQL for large-scale analysis.


Q: What experience do you have with big data technologies like Hadoop or Spark?

Hadoop: HDFS for distributed storage, MapReduce for batch processing (largely replaced by Spark). Apache Spark: in-memory distributed computation, supports Python (PySpark), SQL (Spark SQL), streaming (Structured Streaming), and ML (MLlib). Spark is 10–100× faster than MapReduce for iterative algorithms. Use Spark when data exceeds what fits on a single machine or when pandas performance is insufficient.


Q: How would you use Jupyter notebooks in your analysis workflow?

Jupyter notebooks combine code, narrative text, and visualizations in a single document. Best practices: use notebooks for exploratory analysis and communication; convert to scripts for production pipelines. Use nbformat for versioning. Use Papermill to parameterize and schedule notebooks. Pair with Voilà or Streamlit to turn notebooks into interactive apps for stakeholders.


Q: What database systems have you worked with and what are their pros and cons?

Database Type Pros Cons
PostgreSQL OLTP relational Feature-rich, free, reliable Not optimized for analytics at scale
MySQL OLTP relational Widely used, fast reads Weaker analytics functions
Redshift OLAP / data warehouse Columnar, fast analytics Cost, setup complexity
BigQuery Serverless OLAP Scalable, pay-per-query Cost unpredictability
Snowflake Cloud data warehouse Multi-cloud, easy scaling Cost
MongoDB Document (NoSQL) Flexible schema No native JOINs

Q: How would you approach data version control?

Use DVC (Data Version Control) alongside Git: DVC tracks large data files and models in remote storage (S3, GCS) while Git tracks code and DVC metadata files. This gives you reproducible pipelines where you can check out any code version and retrieve the corresponding dataset and model. Alternatively, use naming conventions (timestamped paths, version numbers) or database schema versioning with Flyway/Liquibase.


Q: What experience do you have with data orchestration tools?

Apache Airflow: define DAGs (Directed Acyclic Graphs) of tasks in Python; schedule and monitor pipelines; large ecosystem of operators for databases, cloud services, and APIs. Prefect / Dagster: more modern alternatives with better error handling and observability. dbt: orchestrates SQL transformations specifically, with built-in testing and documentation. Choose based on team skill set and data stack.


Q: How familiar are you with machine learning platforms?

Key platforms: scikit-learn (Python, comprehensive ML library), XGBoost / LightGBM (gradient boosting, industry standard for tabular data), TensorFlow / PyTorch (deep learning), MLflow (experiment tracking and model registry), Weights & Biases (experiment tracking), SageMaker / Vertex AI / Azure ML (managed cloud ML platforms for training, deployment, and monitoring).


Q: What experience do you have with streaming data processing?

Apache Kafka: distributed message broker for high-throughput event streaming. Apache Flink / Spark Structured Streaming: process Kafka streams in real-time for aggregations, joins, and anomaly detection. AWS Kinesis / GCP Pub/Sub: managed streaming services. Use cases: real-time fraud detection, live dashboards, event-driven pipelines, clickstream analysis.


Q: How do you use Excel's Power Query for data transformation?

Power Query (Get & Transform) allows you to: connect to multiple data sources (CSV, SQL, web, SharePoint), apply transformations (filter, merge, pivot, split columns, change types), and load clean data into Excel or Power BI. The transformations are recorded as steps that re-run automatically when data refreshes — similar to an ETL pipeline but within Excel. It is much more robust than manual VLOOKUP-based data joining.


Q: What are your favorite Excel functions for data analysis?

  • VLOOKUP / XLOOKUP: lookup values across tables
  • INDEX + MATCH: more flexible alternative to VLOOKUP
  • SUMIFS / COUNTIFS / AVERAGEIFS: conditional aggregation
  • IF / IFS / IFERROR: conditional logic
  • TEXT / DATEVALUE: date and text manipulation
  • PIVOT TABLES + SLICERS: interactive summarization without formulas

Q: How do you approach creating calculated fields in Tableau?

Calculated fields in Tableau use Tableau's expression language. Key types:

  • Basic expressions: SUM([Revenue]) / SUM([Visits]) — revenue per visit
  • LOD expressions: {FIXED [Region] : SUM([Revenue])} — region total regardless of current filter
  • Table calculations: WINDOW_SUM, RUNNING_SUM, LOOKUP — operate on the visible table
  • Parameters: let users control thresholds or dimensions in calculated fields

Q: What's the difference between Tableau Desktop and Tableau Server?

Tableau Desktop: the authoring tool where analysts create and publish workbooks. Tableau Server (or Tableau Cloud): the hosting platform where published workbooks are shared, scheduled for refresh, managed with permissions, and accessed by end users via a browser without needing the Desktop application. Analysts develop in Desktop and publish to Server for distribution.


Q: How would you implement row-level security in Power BI?

In Power BI Desktop: define roles using DAX filters (e.g., [Region] = USERNAME() or a lookup table mapping email to region). Publish to Power BI Service. Assign users or groups to roles in the dataset settings. Users only see rows their role permits — the filter applies before the data reaches their report. Test roles in Desktop using "View as role" before publishing.


Q: What's your experience with DAX in Power BI?

DAX (Data Analysis Expressions) is Power BI's formula language for creating measures and calculated columns. Key concepts: measures (calculated at query time, context-aware), calculated columns (computed at data refresh, stored in the model), filter context (current slicer/filter selections), and row context (current row in a table). Common functions: CALCULATE (modify filter context), SUMX (row-by-row iteration), RELATED (lookup across relationships), ALL/ALLEXCEPT (remove filters).


Q: How do you optimize Tableau dashboards for performance?

  1. Use extracts instead of live connections where possible
  2. Reduce the number of marks (limit data points per view)
  3. Avoid complex LOD calculations on large datasets
  4. Filter data at the source (data source filters) before it reaches Tableau
  5. Use integer keys for joins instead of string keys
  6. Limit the number of sheets per dashboard; use show/hide containers instead of multiple tabs
  7. Enable incremental extract refresh instead of full refresh

Q: What databases have you connected to from Tableau/Power BI?

Both tools support direct connections to: MySQL, PostgreSQL, Microsoft SQL Server, Oracle, Snowflake, Amazon Redshift, Google BigQuery, Azure Synapse, Databricks, and dozens more via ODBC/JDBC. For large databases, use a direct query / DirectQuery connection for live data, or extract subsets into the tool's in-memory engine for better performance.


Q: How do you create and use parameters in Tableau?

Parameters are dynamic values that users can change via a dropdown or slider. Uses: letting users switch between metrics (Revenue vs. Units), set a threshold for a reference line, or control a top-N filter. Create in the Data pane → right-click → Create Parameter. Reference in calculated fields: IF [Sales] > [Min Sales Threshold] THEN "Above" ELSE "Below" END. Show the parameter control on the dashboard for user interaction.


Q: What is your experience with Google Analytics and how would you use it for website analysis?

Google Analytics tracks user behavior on websites: sessions, page views, bounce rate, conversion events, traffic sources, and user demographics. For data analysis: export raw event data via the GA4 BigQuery integration for SQL analysis, build custom conversion funnels, analyze traffic source quality (compare conversion rate by channel), and use cohort analysis to measure retention.


Q: How would you use AWS Redshift for data warehousing?

Redshift is a columnar, MPP (massively parallel processing) data warehouse. Best practices: choose distribution keys that distribute data evenly across nodes; use sort keys on columns used in WHERE and ORDER BY; use compression encoding to reduce storage; run VACUUM and ANALYZE regularly; use Redshift Spectrum to query data in S3 without loading it. Use Redshift for analytical queries on large datasets; keep OLTP workloads in PostgreSQL or RDS.


Q: What is your experience with Snowflake and its unique features?

Snowflake's key differentiators: separate compute and storage (scale each independently, pay per query), virtual warehouses (isolated compute clusters that can run concurrently without contention), zero-copy cloning (instantly clone a table or database for dev/test without duplicating storage), time travel (query data as it existed at any point in the past 90 days), and data sharing (share live data across organizations without copying).


Q: How would you use Docker containers in a data science workflow?

Docker packages code, dependencies, and environment into a portable container. Use cases: reproducible analysis environments (no more "it works on my machine"), deploying ML models as REST APIs (Flask/FastAPI in a container), orchestrating data pipelines with Docker Compose, and running consistent environments in CI/CD. Create a Dockerfile specifying your Python version, libraries, and run command; build and run with docker build and docker run.


Q: What are the benefits of using Airflow for workflow orchestration?

Apache Airflow lets you define pipelines as Python DAGs with scheduled execution, dependencies, retries, and alerting. Benefits: visibility into pipeline status (web UI with task logs), dependency management (Task B waits for Task A to succeed), automated retries on failure, support for parallelism, 400+ pre-built operators for databases/cloud/APIs, and integration with Kubernetes for scalable execution.


Q: How would you use Google BigQuery for large-scale data analysis?

BigQuery is a serverless, columnar data warehouse that scales automatically. Key features: partitioned tables (partition by date to limit bytes scanned and cost), clustered tables (sort by column values for faster filtering), SQL for analytics with standard SQL including window functions and CTEs, BI Engine for sub-second dashboard queries, BigQuery ML for running ML models in SQL, and scheduled queries for automated reporting.

Practical Exercises You Might Encounter

Given a sample dataset, clean it and present key insights.

Approach: start with df.info(), df.describe(), and df.isnull().sum() to understand the data. Fix data types, handle missing values, remove duplicates, and validate ranges. Then build 3–5 visualizations covering distribution of the key variable, trends over time, and top categorical breakdowns. Summarize the 3 most actionable insights with specific numbers. Show your cleaning decisions and reasoning clearly — interviewers evaluate your process as much as the output.


Write a SQL query to solve a specific business problem.

Before writing: restate the problem in your own words to confirm understanding. Identify the tables needed, the join logic, the aggregation required, and any edge cases (NULLs, duplicates, date boundaries). Write the query step by step — start with a simple version and build complexity. Always test your logic mentally on a small example. Common patterns: revenue by segment, retention rate, first purchase date, running totals.


Analyze a dataset and create visualizations to tell its story.

Follow a narrative arc: start with the big picture (total revenue or users), then drill into segments (by region, product, cohort), highlight the most interesting finding, and end with a recommendation. Each chart should have a clear title that states the insight ("East region revenue grew 40% YoY while West declined 15%"), not just the chart type ("Revenue by Region").


Build a predictive model using a provided dataset.

  1. EDA: understand distributions, missing values, target class balance
  2. Feature engineering: create relevant features, encode categoricals, scale numerics
  3. Baseline: try a simple model first (logistic regression, decision tree)
  4. Improve: try gradient boosting (XGBoost, LightGBM) with cross-validation
  5. Evaluate: appropriate metrics for the task (AUC for classification, RMSE for regression)
  6. Interpret: feature importances, SHAP values, partial dependence plots
  7. Communicate: explain the model's key drivers and limitations clearly

Identify issues in a flawed analysis and explain how to fix them.

Systematic checklist: incorrect population filter (wrong date range, wrong segment), incorrect metric definition (using revenue instead of profit), statistical errors (ignoring sample size, reporting p-value without effect size), visualization issues (truncated y-axis, misleading chart type), data quality issues (duplicates, missing data not addressed), and logical errors (correlation interpreted as causation).


Design metrics to track the success of a business initiative.

Framework: define leading indicators (early signals — adoption rate, engagement), lagging indicators (final outcomes — revenue, churn), and guardrail metrics (ensure the initiative doesn't harm other things — page load time, return rate). Each metric should have: a clear definition, a measurable baseline, a target, an owner, and a measurement cadence.


Create a dashboard to monitor key business metrics.

Choose 5–8 KPIs relevant to the business function. For each: show current value, comparison to prior period (WoW/MoM/YoY), trend sparkline, and traffic-light status (on track / at risk / off track). Add filters for date range and segment. Use a consistent layout — most important metrics at the top-left. Ensure the dashboard answers the questions a decision-maker asks every morning without needing to dig deeper.


Perform an exploratory data analysis on a new dataset in real-time.

Structure your EDA live: state your approach before starting (shows organization). Sequence: 1) understand the schema and business context, 2) check data quality (missing, duplicates, outliers), 3) univariate distributions of key variables, 4) bivariate relationships (correlations, cross-tabs), 5) formulate hypotheses based on patterns found. Narrate what you are doing and why — interviewers evaluate your thinking process.


Debug a problematic SQL query or Python script.

Start by reading the error message carefully — it usually points to the exact line and type of error. For SQL: check column names, table aliases, NULL handling, and GROUP BY completeness. For Python: add print statements or use a debugger (pdb) to inspect intermediate values. Reproduce the issue on a minimal example. Test edge cases: empty tables, NULL values, date boundaries. Check if recent data changes could explain the unexpected output.


Explain how you would approach a specific business problem with data.

Structure: 1) Restate the problem and confirm your understanding, 2) Define what "success" looks like (the metric to optimize), 3) Identify what data is needed and where it lives, 4) Outline the analysis methodology, 5) Describe how you would validate the result, 6) Explain how you would communicate findings and what decisions they would enable. Show end-to-end analytical thinking, not just technical skills.


Optimize a slow-running query or script.

For SQL: use EXPLAIN ANALYZE to find the bottleneck (full table scan, missing index, Cartesian join). Add appropriate indexes. For Python/pandas: replace slow apply() with vectorized operations. Profile with %timeit or cProfile. Use Dask for large dataframes. For both: filter early to reduce data volume before joining or aggregating.


Create a cohort analysis from customer transaction data.

import pandas as pd

df['cohort'] = df.groupby('customer_id')['order_date'].transform('min').dt.to_period('M')
df['period']  = df['order_date'].dt.to_period('M')
df['period_number'] = (df['period'] - df['cohort']).apply(lambda x: x.n)

cohort_data = df.groupby(['cohort','period_number'])['customer_id'].nunique().reset_index()
cohort_pivot = cohort_data.pivot('cohort','period_number','customer_id')
retention = cohort_pivot.divide(cohort_pivot[0], axis=0).round(2)

Design an A/B test to evaluate a product change.

  1. Write the hypothesis: "Adding a progress bar to the checkout flow will increase purchase completion by 5%"
  2. Define the randomization unit (user, session, or device — use user for consistency)
  3. Calculate sample size: use a power calculator with expected baseline rate, MDE, α=0.05, power=0.80
  4. Determine run duration: min 1–2 weeks; avoid stopping early (peeking problem)
  5. Define guardrail metrics: ensure the change doesn't increase cart abandonment or page errors
  6. Analyze with a z-test for proportions; report p-value, effect size, and 95% CI

Build a regression model to predict key business metrics.

Select features based on business logic and exploratory correlation analysis. Split data chronologically (if time series) or randomly. Handle missing values and encode categoricals. Start with linear regression as a baseline. Try Ridge/Lasso for regularization. Evaluate with cross-validated RMSE and R². Check residual plots for heteroscedasticity and non-linearity. Report feature coefficients with confidence intervals for interpretability.


Develop a customer segmentation model using clustering.

  1. Select behavioral features: RFM (recency, frequency, monetary), product preferences, channel usage
  2. Scale features (z-score) before clustering
  3. Determine k with the elbow method and silhouette score
  4. Run K-Means; validate clusters are stable across runs
  5. Profile each cluster: what are their average RFM scores? What products do they prefer?
  6. Name each segment meaningfully (Champions, At-Risk, New Customers) and define the marketing action for each

Create a time series forecast from historical data.

EDA: plot the series, decompose into trend + seasonality + residual. Establish a baseline (seasonal naïve). Train Prophet or SARIMA. Evaluate with walk-forward cross-validation (train on months 1–12, predict month 13; retrain on 1–13, predict 14; etc.). Choose the model with the lowest MAPE on validation. Report the forecast with uncertainty intervals and document assumptions.


Build a classification model to identify high-value customers.

Define "high-value" (e.g., top 20% by LTV, or LTV > $500). Create a binary target. Engineer features from historical behavior (order frequency, average basket, days since last purchase, product categories, channel). Use logistic regression for interpretability or gradient boosting for accuracy. Evaluate with precision, recall, and AUC. Deploy as a weekly scoring job and use scores to trigger targeted campaigns.


Develop a dashboard showing geographic distribution of customers or sales.

Use a choropleth map for country/state level data or a bubble map for city-level. In Tableau: use Filled Map with region → color (revenue). In Python: use plotly.express.choropleth or folium for interactive maps. Normalize by population if comparing regions of different sizes. Add a filter for date range and a tooltip showing absolute value + rank. Include a top-10 regions bar chart alongside for precise comparisons.


Create a funnel analysis to identify conversion bottlenecks.

Define each funnel stage and compute the conversion rate between adjacent stages. Identify the step with the largest absolute drop-off (not just the lowest conversion rate — the volume matters). Segment the funnel by device, traffic source, and user type to isolate where specific groups struggle. A/B test improvements on the biggest drop-off step. Report both absolute drop-off and percentage conversion at each step.


Analyze customer feedback data to extract sentiment and key themes.

Pipeline: load text data → clean (lowercase, remove HTML/URLs/punctuation) → sentiment classification (VADER for speed, fine-tuned BERT for accuracy) → topic modeling (BERTopic or LDA) → quantify: what % of reviews mention each theme? How does sentiment differ by theme? Visualize: sentiment distribution bar chart, word clouds by sentiment, theme prevalence over time. Deliver: top 5 improvement areas based on negative theme frequency × review volume.


Build a churn prediction model and recommend retention strategies.

  1. Define churn (no activity in 30 days)
  2. Create features: days since last login, session frequency trend, support tickets, plan type, payment failures
  3. Train gradient boosting classifier; evaluate AUC and precision@k
  4. Interpret with SHAP values — identify the top 5 churn drivers
  5. Score all active users weekly; flag top-10% churn-risk users for the retention team
  6. Recommend interventions based on churn drivers: declining usage → in-app re-engagement; payment failures → proactive billing outreach

Create a report analyzing the effectiveness of marketing campaigns.

Structure: campaign overview (spend, impressions, clicks, CTR), conversion metrics (CVR, CPA, ROAS), comparison vs. prior campaign and benchmark, segmentation (best-performing creatives, audiences, channels), and statistical significance of key differences. Include: a recommendation on budget reallocation, a note on attribution methodology limitations, and the proposed approach for the next campaign test.


Develop a model to optimize pricing strategy.

  1. Estimate price elasticity: regress sales volume on price (control for seasonality and promotions)
  2. Model the demand curve: fit a log-linear model (log(demand) = α + β × log(price))
  3. Compute revenue at each price point: revenue = price × predicted demand
  4. Find the revenue-maximizing price; also compute the margin-maximizing price if cost data is available
  5. Validate with a controlled A/B price test on a subset of users before full rollout

Build an anomaly detection system for transaction data.

  1. Define normal behavior: compute rolling mean and std for key metrics per entity (user, merchant)
  2. Rule-based layer: flag any transaction exceeding configurable thresholds (e.g., > 3σ from rolling mean)
  3. ML layer: train an Isolation Forest or Autoencoder on historical "normal" transactions; flag high anomaly scores
  4. Alert routing: high-confidence anomalies → automatic hold; medium confidence → manual review queue
  5. Feedback loop: analyst labels drive model retraining

Create a customer lifetime value prediction model.

Feature engineering: recency (days since last purchase), frequency (# orders in last 6 months), monetary (average order value), tenure (days since first purchase), product diversity, and channel. Train an XGBoost regressor with next-12-month revenue as the target (use historical cohorts for ground truth). Evaluate with hold-out MAE and RMSE. Segment customers by predicted LTV quintile for targeted marketing.


Design and interpret results from a multivariate test.

In a multivariate test (MVT), multiple page elements are tested simultaneously to find the best combination. Design: define element variants (headline × CTA button × hero image), calculate required sample size for all combinations, run the test for sufficient duration, analyze using factorial design. Caution: MVTs require much larger samples than simple A/B tests. Interpret interaction effects — sometimes combination A+B outperforms each element individually.


Build a recommendation engine based on user behavior.

  1. Build a user-item interaction matrix (user × product, values = purchase/click counts)
  2. Apply collaborative filtering: matrix factorization (ALS in implicit or Surprise library)
  3. Generate top-k recommendations per user
  4. Handle cold start: recommend popular items to new users
  5. Evaluate offline: precision@k, recall@k, NDCG on a held-out set
  6. A/B test online: compare click-through rate and revenue for recommended vs. non-recommended items

Create a natural language processing pipeline to analyze text data.

import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import Pipeline

pipeline = Pipeline([
    ('tfidf', TfidfVectorizer(max_features=10000, ngram_range=(1,2),
                               stop_words='english')),
    ('clf', LogisticRegression(max_iter=1000))
])
pipeline.fit(X_train, y_train)
preds = pipeline.predict(X_test)

For more complex tasks use a pre-trained transformer (BERT, DistilBERT) via HuggingFace.


Develop a demand forecasting model that accounts for seasonality.

Use Prophet (Facebook/Meta's open-source library) which explicitly models yearly, weekly, and daily seasonality plus custom holiday effects. Alternatively, use SARIMA (p,d,q)(P,D,Q,s) where s = seasonal period. For complex seasonality, use TBATS (handles multiple overlapping seasonal periods). Always include external regressors for known future events (promotions, holidays) that affect demand. Evaluate with walk-forward cross-validation.


Create an interactive visualization that allows stakeholders to explore data.

Use Plotly + Dash (Python) or Streamlit for quick interactive apps. Key interactive features: dropdown to select the metric or dimension, date range slider, hover tooltips with exact values, click-to-drill-down, and a download button for the filtered data. Alternatively, publish a Tableau or Power BI dashboard with filters and parameters. The goal is to answer follow-up questions without requiring a new data request.

Struggling to Find a Job? Get Specific Batch Wise job Updates ✅ Check now

Python Interview Questions

Join our WhatsApp Channel for more resources.