Interview
Interview
Business Impact /
Interview Talking
Concept Definition Point
ETL vs ELT ETL: Extract, ETL: legacy systems,
Transform, Load data quality. ELT:
(transform before cloud data warehouses
loading). ELT: Extract, (Snowflake, BigQuery)
Load, Transform leverage massive
(transform in the data compute for
warehouse). transformation.
Normalization (1NF, Eliminate redundancy Normalize for OLTP to
2NF, 3NF) and dependency. 1NF: avoid update anomalies.
atomic columns. 2NF: Denormalize for OLAP
remove partial to improve query
dependencies. 3NF: performance.
remove transitive
dependencies.
Star vs Snowflake Star: one fact table Star: simpler queries,
Schema surrounded by faster aggregations.
denormalized Snowflake: more
dimensions. Snowflake: storage-efficient, but
normalized dimensions. requires more joins.
Fact vs Dimension Fact: quantitative data Interview tip: Always
(sales, quantity). clarify grain before
Dimension: descriptive modeling.
attributes (customer,
product). Grain = level
of detail of a fact row.
Slowly Changing Type 0: retain original. Implementation: SQL
Dimensions (SCD) Type 1: overwrite. (MERGE, INSERT),
Type 2: add new row Power Query (buffered
with versioning. Type 3: lookups), Python
add previous value (tracking changes).
column.
Data Types Categorical (nominal, Storage optimization:
ordinal), Numerical use appropriate types
(continuous, discrete). (e.g., int vs bigint,
varchar vs char).
Sampling Methods Random, stratified, Stratified sampling
cluster. preserves class
proportions – useful for
imbalanced datasets.
1
Business Impact /
Interview Talking
Concept Definition Point
Indexes Clustered: sorts and Too many indexes slow
stores data rows. down writes. Covering
Non-clustered: separate index can eliminate key
structure with pointers. lookups.
Transactions (ACID ACID: Atomicity, Choose based on
vs BASE) Consistency, Isolation, consistency
Durability (RDBMS). requirements.
BASE: Basically
Available, Soft state,
Eventually consistent
(NoSQL).
OLTP vs OLAP OLTP: transactional, Tooling: OLTP →
normalized, high RDBMS, OLAP →
concurrency. OLAP: columnar stores, data
analytical, warehouses.
denormalized, complex
queries.
Data Warehouse vs DWH: structured, Modern architectures
Data Lake vs Data schema-on-write. Data use lakehouses (Delta
Mart Lake: raw, Lake, Iceberg) to
schema-on-read (e.g., combine flexibility and
S3, ADLS). Data Mart: structure.
subset of DWH for a
business line.
Data Modeling Entity-Relationship Interview tip: Be ready
(ER) diagrams, to whiteboard a simple
surrogate keys star schema and explain
(auto-increment) vs relationships.
natural keys (business
identifiers). Cardinality:
one-to-one, one-to-many,
many-to-many. Bridge
tables resolve
many-to-many.
Degenerate dimension:
dimension attribute
stored in fact (e.g.,
order number).
Statistics
2
Term Definition Interview Example
Mean, Median, Central tendency Median is robust to
Mode measures. outliers – use for skewed
distributions like salary.
Variance, Std Dev Spread around the Used in risk analysis
mean. (financial portfolios).
Skewness, Kurtosis Shape of distribution. Skewed data may need
transformation for
linear models.
p-value, Hypothesis Probability of observing p < 0.05 is common
Testing data if null hypothesis is significance threshold.
true. Explain Type I (false
positive) and Type II
(false negative) errors.
Confidence Interval Range containing “We are 95% confident
population parameter that the true conversion
with certain confidence. rate is between 10% and
12%.”
Central Limit Distribution of sample Enables parametric
Theorem means approaches tests on non-normal
normal as sample size data with large samples.
increases, regardless of
population distribution.
Correlation vs Correlation does not Spurious correlations
Causation imply causation. example: ice cream
sales and drowning
incidents (both caused
by summer heat).
A/B Testing Randomized experiment Sample size calculation
with control and (power analysis),
treatment. significance level,
practical significance
(minimum detectable
effect).
Bias-Variance Bias: error from wrong Overfitting (high
Tradeoff assumptions. Variance: variance) vs underfitting
error from sensitivity to (high bias).
fluctuations. Cross-validation helps
balance.
3
Concept Definition Business Application
Supervised vs Supervised: labeled Customer segmentation
Unsupervised data (regression, (unsupervised), churn
classification). prediction (supervised).
Unsupervised: no labels
(clustering, association).
Regression vs Regression predicts Regression: sales
Classification continuous values; forecast. Classification:
classification predicts fraud detection.
discrete classes.
Linear Regression Models linear Baseline model;
relationship. interpretable
Assumptions: linearity, coefficients.
independence,
homoscedasticity,
normality of errors.
Logistic Regression Predicts probability of Customer conversion,
binary outcome. Uses credit default.
sigmoid function.
Decision Trees Tree-like model splitting Easy to explain to
on feature values. Prone stakeholders.
to overfitting.
K-Means Clustering Partitions data into k Customer segmentation,
clusters based on anomaly detection
distance. Choose k (small clusters).
using elbow method.
Regularization (L1, L1 (Lasso) adds Prevents overfitting;
L2) absolute penalty, can handle multicollinearity.
shrink coefficients to
zero (feature selection).
L2 (Ridge) adds
squared penalty, keeps
all features but reduces
magnitude.
Gradient Descent Optimization algorithm Learning rate controls
to minimize loss step size; too high may
function by updating diverge, too low slow
parameters in direction convergence.
of negative gradient.
Clustering Metrics Silhouette score (how Evaluate cluster quality.
similar points are to
own cluster vs other
clusters), elbow method
(inertia).
4
Concept Definition Business Application
Model Evaluation Regression: MAE, MSE, Choose metric based on
Metrics RMSE, R². business goal (e.g.,
Classification: accuracy, recall for fraud to catch
precision, recall, F1, as many as possible).
ROC-AUC, confusion
matrix.
Multicollinearity & High correlation Inflates standard errors,
VIF between predictors. VIF unstable coefficients.
> 5–10 indicates Detect via correlation
problematic matrix or VIF.
multicollinearity.
Sample
Syntax / Performance
Tool Method Steps Best For Notes Pitfalls
Excel Import Data > Small Manual Data type
Wizard, Get Data datasets, refresh; inference
Power > From ad-hoc limited errors;
Query, File > rows truncation
Text-to- From (~1M)
Columns Text/CSV
SQL LOAD DATA COPY Large Use bulk Transaction
INFILE, table volume, operations; log growth;
BULK FROM scheduled disable deadlocks
INSERT, '[Link]' loads indexes
INSERT DELIMITER during
INTO ... ',' CSV load
SELECT HEADER;
(Post-
greSQL)
Python pd.read_csv(),
df = Medium Specify Memory
(Pandas) pd.read_sql(), data, pro-
pd.read_csv('[Link]',dtypes to blow-up
requests totyping,
dtype={'col': reduce with large
+ str}) API inte- memory; files
json_normalize gration chunk
large files
5
Sample
Syntax / Performance
Tool Method Steps Best For Notes Pitfalls
NumPy [Link](),
data = Numeric- Memory- Limited to
[Link](), heavy mapped
[Link]('[Link]', numeric
large
[Link]() delimiter=',', arrays for data
(binary) arrays
skip_header=1) out-of-core
Power BI Import (in- Connect > Interactive Query DirectQuery
memory), Select dash- folding can be
Direct- data > boards pushes slow if
Query, Load or transfor- source not
Live Con- Transform mations to optimized
nection, source; use
Incremen- Incremen-
tal Refresh tal Refresh
for large
fact tables
Tableau Extract Connect Visual ex- Extracts Extract
(.hyper) vs to server ploration are refresh
Live Con- or file, columnar, scheduling
nection choose com- needed
Extract or pressed;
Live Live for
real-time
but may
be slower
Interview Question: How would you load a 50GB CSV into a database for
analysis?
Answer: Use bulk load tools (e.g., COPY in PostgreSQL, BULK INSERT in
SQL Server). If memory constrained in Python, read in chunks with Pan-
das (chunksize) and process incrementally. Consider splitting file or using
distributed processing (Spark).
Data Cleaning
Power
Query Tableau
Task Excel SQL Pandas (M) Prep
Handle IFERROR(A1,0),
COALESCE(col,0),
[Link](0)[Link],
IFNULL([Field],0)
NULLs ISBLANK() ISNULL [Link]
6
Power
Query Tableau
Task Excel SQL Pandas (M) Prep
Remove Data > DISTINCT df.drop_duplicates() Remove
[Link]
Dupli- Remove or Duplicate
cates Duplicates ROW_NUMBER() Rows step
OVER
(PARTITION
BY ...)
Change Format CAST(col df['col'].astype(int) Change
[Link]
Data Cells, Text AS INT) data type
Type to in profile
Columns pane
Outlier Quartile Use CTE Q1 = Custom Calculated
Detec- formulas, with column field with
df['col'].quantile(0.25);
tion condi- NTILE or filter by with LOD or
(IQR) tional percentile IQR percentile table calc
formatting functions logic
String LEFT, [Link], Calculated
SUBSTRING, df['col'].[Link](),
Manipu- RIGHT, [Link],fields
CHARINDEX, .[Link](r'pattern')
lation MID, TRIM, TRIM, [Link] using
SUBSTITUTE REPLACE string
functions
Missing Fill with UPDATE [Link]([Link]()), ZN()
[Link]
Data mean (forward
SET col = [Link]() (replace
Strategy using (SELECT fill) null with
formula AVG(col) zero) in
...) Tableau
WHERE col
IS NULL
Interview Question: You receive a dataset with 20% missing values in a key
numeric column. How do you handle it?
Answer: First, investigate missingness pattern (MCAR, MAR, MNAR).
Options: drop rows if missing is random and dataset large; impute with
mean/median (simple but biases variance); use regression imputation or
model-based methods. Document assumptions and trade-offs.
Filtering Data
7
Tool Syntax / Method Notes
SQL WHERE (row filter), WHERE before GROUP BY,
HAVING (post-aggregate HAVING after. Use
filter) indexes on filtered
columns.
Pandas df[df['col'] > 5], query() is often more
[Link]('col > 5'), readable; use boolean
.loc[], .iloc[] indexing.
Power BI Visual-level, page-level, Cross-filter direction
report-level filters; matters; avoid
slicers; filter pane high-cardinality filters
on large data.
Tableau Dimension filters (order Use context filters for
of operations: extract, performance; data
data source, context, source filters for RLS.
dimension, measure)
Power
Task Excel SQL Pandas Query Tableau
Conditional =IF(A1>10,"High","Low") Conditional
CASE WHEN [Link](df['col']>10, Calculated
Column col > 10 'High', column in field with
THEN 'Low') Add IF [col]
'High' Column > 10 THEN
ELSE 'High'
'Low' END ELSE
'Low' END
Pivot Power UNPIVOT [Link](df, Unpivot Pivot in
(Wide to Query: (SQL Columns
id_vars=['id'], Data
Long) Unpivot Server) or var_name='year', Interpreter
use CROSS value_name='sales') or use
JOIN + Tableau
UNION Prep
Unpivot PivotTable PIVOT Pivot
[Link](index='id', Not
(Long to (SQL Column
columns='year', directly;
Wide) Server) values='sales') use
with custom
aggregate SQL or
Tableau
Prep
8
Power
Task Excel SQL Pandas Query Tableau
Aggregate PivotTable, SELECT Group By Drag di-
[Link]('category')['sales'].sum()
/ Group SUMIFS category, mensions
By SUM(sales) and
FROM measures;
table use table
GROUP BY calcs for
category subtotals
Join / VLOOKUP, JOIN Merge
[Link](df1, Relationships
Merge XLOOKUP, (INNER, df2, Queries (logical) or
INDEX-MATCH LEFT, on='key', blends (ag-
etc.) how='left') gregated)
SQL
(OVER Power BI
Function Clause) Pandas (DAX) Tableau
Row ROW_NUMBER() df['rn'] = INDEX() or
RANKX(ALL(Table),
Number OVER Table[salary],RANK() table
[Link]('dept')['salary'].rank(method='first',
(PARTITION ascending=False)
, DESC, calculation
BY dept Dense) for
ORDER BY dense rank
salary
DESC)
Lag / Lead LAG(sales,1) CALCULATE(SUM(sales),
df['prev_sales'] LOOKUP(SUM([sales]),
OVER = PREVIOUSMONTH(date))
-1)
(PARTITION [Link]('product')['sales'].shift(1)
BY product
ORDER BY
date)
Running SUM(sales) [Link]('product')['sales'].cumsum()
TOTALYTD(SUM(sales),
RUNNING_SUM(SUM([sales]))
Total OVER 'Date'[Date])
(PARTITION
BY product
ORDER BY
date ROWS
UNBOUNDED
PRECEDING)
9
SQL
(OVER Power BI
Function Clause) Pandas (DAX) Tableau
Moving AVG(sales) df['sales'].rolling(3).mean()
CALCULATE(AVERAGE(sales),
WINDOW_AVG(SUM([sales]),
Average OVER (ORDER DATESINPERIOD('Date'[Date],
-2, 0)
BY date LASTDATE('Date'[Date]),
ROWS -3, MONTH))
BETWEEN 2
PRECEDING
AND CURRENT
ROW)
10
• Loops vs Vectorization: Vectorized operations (using NumPy/Pandas)
are C-optimized and much faster. Avoid explicit loops over DataFrame
rows; use .apply() only if vectorization not possible.
• Data Structures:
– List: ordered, mutable, allows duplicates; O(1) append/pop from
end, O(n) lookup.
SQL Specifics
• Join Types:
– INNER JOIN: only matching rows.
11
rollback (in most RDBMS).
• Indexes:
– Clustered index determines physical order; only one per table.
– Covering index includes all columns needed for query, avoiding key
lookup.
• CTEs vs Subqueries: CTEs improve readability, can be recursive. Some
databases materialize CTEs, others inline them; performance may vary. In
PostgreSQL, CTEs are optimization fences (materialized by default).
• Transactions and Isolation Levels:
– Read Committed: default in many; sees only committed data.
Performance Optimization
• SQL:
– Use EXPLAIN to analyze query plan.
– Use .at and .iat for scalar access, not .loc for single values.
12
– Reduce cardinality of columns used in relationships.
13
– Degenerate dimension: dimension attribute stored in fact table (e.g.,
order number) because no separate dimension.
• Data Security:
– Encryption at rest (TDE) and in transit (TLS/SSL).
14
– SAMEPERIODLASTYEAR('Date'[Date])
15
• Cognitive biases:
– Confirmation bias: stakeholders seek data that confirms their beliefs.
Mitigate by showing both sides.
Storytelling Framework
• Context: What is the business problem? (e.g., declining sales in region)
• Result: What did you find and what is the recommended action? (e.g.,
target high-value customers with retention campaign)
16
with both old and new views.
Sample 3: Performance Issue
- Situation: A Power BI report was timing out due to large data volume.
- Task: Improve performance to load under 5 seconds.
- Action: Analyzed the data model, identified high-cardinality columns in rela-
tionships, switched to DirectQuery for some tables but then changed to Import
with incremental refresh, optimized DAX measures by removing unnecessary
iterators.
- Result: Report loaded in 3 seconds, user satisfaction improved.
Python/Pandas Questions
1. How do you apply a function to each row in a DataFrame?
• [Link](lambda row: func(row['col1'], row['col2']),
axis=1). But prefer vectorized operations if possible.
2. What is the difference between .loc and .iloc?
• .loc uses label-based indexing, .iloc uses integer position.
3. How to handle missing values in a DataFrame?
• [Link](), [Link](), [Link](). Choose based on
context.
17
DAX/Tableau Questions
1. Explain the difference between CALCULATE and CALCULATETABLE.
• CALCULATE returns a scalar, CALCULATETABLE returns a table.
2. When would you use a FIXED LOD instead of a table calculation
in Tableau?
• When you need a dimension not in the view, or when you want the
calculation to be independent of view filters.
Pandas Snippets
• Read CSV: pd.read_csv('[Link]', parse_dates=['date'],
dtype={'col': str})
• Groupby + agg: [Link]('category').agg({'sales':'sum','profit':'mean'})
• Merge: [Link](df1, df2, on='key', how='left')
DAX Patterns
• YTD: TOTALYTD(SUM(Sales[Amount]), 'Date'[Date])
• Previous month: CALCULATE(SUM(Sales[Amount]), PREVIOUSMONTH('Date'[Date]))
18
• Dynamic ranking: RANKX(ALL(Product[Name]), [Total Sales], ,
DESC, Dense)
19
ON [Link] = [Link]
WHEN MATCHED AND T.last_update < S.last_update THEN
UPDATE SET [Link] = [Link], T.last_update = S.last_update
WHEN NOT MATCHED THEN
INSERT (id, col, last_update) VALUES ([Link], [Link], S.last_update);
• SCD Type 2 Implementation
UPDATE dim_customer
SET end_date = CURRENT_DATE, is_current = 0
WHERE customer_id = @customer_id AND is_current = 1;
20
Pandas Notebook Snippets
# Cleaning
df = df.drop_duplicates()
df['date'] = pd.to_datetime(df['date'])
df['category'] = df['category'].astype('category')
# Feature engineering
df['revenue'] = df['quantity'] * df['price']
df['month'] = df['date'].[Link]
# Window functions
df['running_total'] = [Link]('product')['sales'].cumsum()
df['sales_rank'] = [Link]('category')['sales'].rank(method='dense', ascending=False)
# Cohort
cohort_data = [Link](['cohort_month', 'period']).size().unstack(0)
DAX Snippets
// Sales YTD
Sales YTD = TOTALYTD(SUM(Sales[Amount]), 'Date'[Date])
21
□ Columns: hide foreign keys, sort by appropriate columns.
□ Measures: use variables for complex logic.
□ RLS: defined and tested.
□ Incremental refresh: set for large fact tables.
22