By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Interview preparation for data‑science roles is a focused practice of three pillars: SQL case studies, product‑sense thinking, and ML fundamentals (plus the ever‑present behavioral interview). It matters because every hiring manager wants to see that you can (1) extract and wrangle data with SQL, (2) translate a vague business problem into a concrete analytical plan, and (3) build, evaluate, and communicate a model that drives product decisions. Example: a retailer asks “Why are high‑value customers churning?” – you’ll write a SQL query to pull the last 90‑day activity, sketch a churn‑prediction product metric, train a logistic‑regression model, and explain the impact to the product team.
SELECT col FROM table WHERE condition
HAVING
HAVING COUNT(*) > 100
ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY event_ts)
python df = pd.read_sql("""SELECT user_id, event_date, revenue FROM events WHERE event_date >= '2023-01-01'""", con=engine) df.head()
df.describe()
df.isnull().sum()
pd.get_dummies
python X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, stratify=y, random_state=42)
python model = LogisticRegression(class_weight='balanced') model.fit(X_train, y_train) preds = model.predict_proba(X_test)[:,1] print('AUC:', roc_auc_score(y_test, preds))
GridSearchCV
Mistake: Pulling all columns with SELECT * and later discovering irrelevant or PII data. Correction: Explicitly list needed columns; add a data‑privacy check early.
SELECT *
Mistake: Using accuracy on a 95 % non‑churn dataset and claiming “90 % accuracy”. Correction: Report precision, recall, and AUC; for imbalanced data, focus on recall or PR‑AUC.
Mistake: Forgetting to stratify during train‑test split, leading to a test set with no churn cases. Correction: Always pass stratify=y to train_test_split when the target is categorical.
stratify=y
train_test_split
Mistake: Over‑engineering features (e.g., dozens of one‑hot columns) without checking multicollinearity. Correction: Use variance‑inflation factor (VIF) or regularization to prune redundant features.
Mistake: Giving a product answer that sounds “data‑driven” but lacks a concrete metric (e.g., “increase retention”). Correction: Tie every recommendation to a KPI (e.g., “reduce churn by 5 % → increase LTV by $X per month”).
Scenario: Your churn model has high variance on the validation set. Answer: Apply L2 regularization or increase bagging (e.g., Random Forest) to shrink variance.
Scenario: The business cares about catching every high‑value churner, even at the cost of false alarms. Answer: Optimize for Recall (or use a low‑threshold PR‑AUC) rather than precision.
Scenario: You need to compute the rolling 7‑day revenue per user in SQL. Answer: Use a window function: SUM(revenue) OVER (PARTITION BY user_id ORDER BY event_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW).
SUM(revenue) OVER (PARTITION BY user_id ORDER BY event_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW)
HAVING SUM(revenue) > 1000
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.