← TikTok Interview Insights

TikTok·Data Scientist·Technical Phone Screen·Senior

Senior
May 2026

Summary

TikTok data scientist interview that went deep on multicollinearity and feature attribution, specifically what happens when two features are nearly identical and you still need to explain your model. Pretty technical throughout, more stats-heavy than I expected for a DS role.

Questions Asked (4)

Q1

You have two features A and B with a correlation of 0.98 in a binary classification problem. How would you compute or estimate VIF for each, and what thresholds would you use to flag problematic multicollinearity?

Technical Trade-offsData Modeling
Author's notes

VIF I knew cold, regress each feature on the rest and use 1/(1-R^2).

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Explain that VIF is computed as 1/(1-R²) from regressing each feature on all others, and for binary features this is equivalent to the inverse of (1 - φ²) where φ is the phi coefficient. Note that a correlation of 0.98 implies R² ≈ 0.96, so VIF ≈ 25, which exceeds common thresholds of 5 or 10, indicating problematic multicollinearity.

Pro tip: Mention that for binary features, the correlation is the phi coefficient, and VIF can be computed directly from the 2x2 contingency table without running a regression. Also, note that in practice, you might drop one feature or combine them, but always validate with domain knowledge.

1. Define VIF and its formula

State that VIF for feature i is 1/(1 - R_i²), where R_i² is the R-squared from regressing feature i on all other features. For two features, R_i² is the squared correlation between them.

2. Compute correlation and R²

Given correlation r = 0.98, compute R² = r² = 0.9604. This is the proportion of variance in one feature explained by the other.

3. Calculate VIF

Plug into formula: VIF = 1/(1 - 0.9604) = 1/0.0396 ≈ 25.25. So each feature has VIF ≈ 25.

4. Interpret and apply thresholds

Use common thresholds: VIF > 5 or 10 indicates problematic multicollinearity. Here VIF ≈ 25 far exceeds these, so flag as problematic.

5. Discuss implications and remedies

Explain that high VIF can inflate coefficient variance and make interpretation unreliable. Suggest remedies: drop one feature, combine them, or use regularization.

Key Points to Mention

  • VIF formula: VIF_i = 1 / (1 - R_i²)
  • For two features, R_i² is the squared correlation (r²)
  • Correlation of 0.98 gives R² ≈ 0.96, VIF ≈ 25
  • Common thresholds: VIF > 5 or 10 indicates multicollinearity
  • Binary features: correlation is phi coefficient, VIF can be computed from 2x2 table
  • High VIF implications: unstable coefficients, difficulty in interpretation
  • Remedies: feature selection, dimensionality reduction, regularization

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

When two features are near-duplicates, how do SHAP values behave differently under interventional versus conditional SHAP, and why can attributions become unstable or split unpredictably between the two?

Technical Trade-offsRoot Cause Analysis
Author's notes

This is where things got genuinely hard.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining interventional and conditional SHAP in terms of their underlying assumptions about feature dependence. Then explain how near-duplicate features violate these assumptions differently, leading to distinct attribution behaviors. Finally, discuss the practical implications for model interpretation and stability.

Pro tip: Emphasize that conditional SHAP can split credit arbitrarily among correlated features due to the conditional expectation, while interventional SHAP may assign credit to one feature based on the data distribution, but both can be unstable. Mention that using SHAP with correlated features requires caution and often domain knowledge to interpret correctly.

1. Define the two SHAP variants

Explain that interventional SHAP (also known as marginal SHAP) breaks feature dependencies by perturbing features independently, while conditional SHAP (also known as observational SHAP) respects the data distribution by conditioning on other features.

2. Explain behavior with near-duplicates

With near-duplicate features, interventional SHAP may assign all credit to one feature if the model relies on it, but if both are used, it can split credit based on marginal contributions. Conditional SHAP, however, may split credit more evenly because it accounts for the fact that when one feature is present, the other is likely present, leading to arbitrary splits.

3. Discuss instability and unpredictability

Instability arises because small changes in the data or model can shift which feature gets credit, especially under conditional SHAP where the conditional distribution is estimated. Interventional SHAP can also be unstable if the model uses both features in a complementary way, as perturbations may create unrealistic data points.

4. Connect to practical implications

Highlight that this instability makes interpretation challenging, and suggest strategies like grouping correlated features, using domain knowledge, or employing alternative methods like SHAP with correlation-aware adjustments.

Key Points to Mention

  • Interventional SHAP assumes feature independence, while conditional SHAP respects dependencies.
  • Near-duplicate features cause credit assignment ambiguity due to multicollinearity.
  • Conditional SHAP can split attributions arbitrarily because it conditions on correlated features.
  • Interventional SHAP may assign credit to one feature based on marginal contributions, but can create unrealistic instances.
  • Instability arises from model sensitivity and estimation of conditional distributions.
  • Practical mitigation: group features, use domain knowledge, or consider alternative attribution methods.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

Walk through a defensible interpretation workflow for a model where two features are near-duplicates. What diagnostics would you run, and what would you expect to see?

Technical Trade-offsProduct Analytics & Metrics
Author's notes

Talked about clustering features by correlation first, then grouped SHAP to treat A and B as a unit, then permutation importance conditioned on the other feature to see if one is redundant.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the problem as a multicollinearity issue that affects model interpretability and stability, then outline a step-by-step diagnostic workflow. Emphasize that the goal is to decide whether to drop, combine, or keep both features based on their incremental value and business context.

Pro tip: Always tie the decision back to the model's purpose: if interpretability matters (e.g., for stakeholder trust), favor dropping one; if pure predictive power is key, consider regularization or feature engineering. Mention that you'd validate with a holdout set to ensure no performance loss.

1. Quantify the relationship

Compute correlation (Pearson, Spearman) and check for perfect or near-perfect linear dependence. Also inspect scatterplots and calculate VIF to confirm multicollinearity.

2. Assess impact on model

Fit the model with both features and examine coefficient stability, standard errors, and feature importance. Compare with models using only one feature to see if performance drops.

3. Evaluate business context

Determine if the features are semantically redundant or if they capture different nuances (e.g., time-decayed vs. raw counts). Consult with domain experts to understand if both are needed for interpretability.

4. Choose a resolution strategy

Decide among: dropping one feature, combining them (e.g., PCA, averaging), or using regularization (L1/L2) to handle collinearity. Justify based on model goals and interpretability needs.

5. Validate and monitor

Test the chosen approach on a holdout set and compare metrics. Set up monitoring to detect if the relationship between features changes over time, which could affect the decision.

Key Points to Mention

  • Variance Inflation Factor (VIF) and correlation coefficients as diagnostics
  • Impact on coefficient estimates and standard errors in linear models
  • Regularization techniques (Lasso, Ridge) to mitigate multicollinearity
  • Feature importance and permutation importance for tree-based models
  • Business interpretability vs. predictive performance trade-off
  • Validation using cross-validation and holdout sets to ensure no performance degradation

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

What modeling changes would you recommend to handle near-duplicate features, both for a logistic regression and a gradient-boosted tree? How would you validate that you haven't sacrificed predictive performance while improving interpretability?

Technical Trade-offsA/B Testing & Experimentation
Author's notes

Elastic net for the GLM was the obvious answer and I led with that.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining near-duplicate features and their impact on model stability and interpretability. Then, for each model type, propose tailored strategies: for logistic regression, use regularization or feature clustering; for GBT, leverage feature importance and drop one of each correlated pair. Finally, outline a validation plan that compares predictive performance (e.g., AUC, log loss) and interpretability metrics (e.g., feature importance stability) using cross-validation and holdout sets.

Pro tip: Emphasize that near-duplicates can cause multicollinearity in logistic regression, inflating variance, and in GBT, they can split importance arbitrarily. Propose a combined approach: use correlation-based pruning and then validate with a business metric to ensure no performance drop.

1. Identify and quantify near-duplicate features

Compute pairwise correlations (Pearson, Spearman) and use variance inflation factor (VIF) for linear models. For GBT, use feature importance and SHAP values to detect redundancy.

2. Apply model-specific handling techniques

For logistic regression: use L1/L2 regularization, drop one of each correlated pair, or combine via PCA. For GBT: drop redundant features based on importance, or use feature selection algorithms like Boruta.

3. Validate predictive performance

Use cross-validation to compare models with and without changes on metrics like AUC, log loss, and calibration. Perform statistical tests (e.g., DeLong's test) to ensure differences are not significant.

4. Assess interpretability improvements

Measure feature importance stability across bootstrapped samples, and check for reduced multicollinearity (e.g., lower VIF). Use SHAP dependence plots to ensure simpler explanations.

5. Iterate and document trade-offs

If performance drops, consider keeping some duplicates or using domain knowledge to combine features. Document the rationale and monitor model in production.

Key Points to Mention

  • Multicollinearity and its effect on coefficient estimates in logistic regression
  • Regularization techniques (L1, L2, elastic net) for handling correlated features
  • Feature importance and SHAP values for gradient-boosted trees
  • Cross-validation and holdout validation for performance comparison
  • Metrics: AUC, log loss, calibration, and interpretability metrics like feature importance stability
  • Business impact: ensuring no degradation in key business metrics (e.g., CTR, conversion)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.