July 15, 2026
25 Must-Know Data Science Concepts
An Interview-Style Question-and-Answer Guide from Basic to Advanced

By Sajid Khan
19 min read
- 1 Level 1: Basic Foundations
- 2 1. What is data science and how do you approach building a solution for a DS Project?
- 3 2. What are observations, features, targets, and data types? Also highlight common mistakes you've faced in a DS project.
- 4 3. What is the difference between a population and a sample and how do you differentiate bw the two?
- 5 4. What are mean, median, mode, variance, and standard deviation. Which metric would you use while defining a dataset?
Not a Medium Member, Read this article here!
There is no single official list of data science concepts, but the following 25 topics cover the knowledge most frequently needed in interviews and real-world projects.
Table of Contents:
· Level 1: Basic Foundations · 1. What is data science and how do you approach building a solution for a DS Project? · 2. What are observations, features, targets, and data types? Also highlight common mistakes you've faced in a DS project. · 3. What is the difference between a population and a sample and how do you differentiate bw the two? · 4. What are mean, median, mode, variance, and standard deviation. Which metric would you use while defining a dataset? · 5. What is probability, and why is it important in data science? · Level 2: Practical Data Analysis Questions · 6. What is exploratory data analysis? · 7. How do you clean a dataset? · 8. What is the difference between correlation and causation? · 9. What are hypothesis testing, p-values, and confidence intervals? · Level 3: Machine Learning Foundations · 10. What is the difference between supervised and unsupervised learning? · 11. What is the difference between regression and classification? · 12. Why do we divide data into training, validation, and test sets? · 13. What is feature engineering? · 14. What are encoding, standardization, and normalization? · 15. How does linear regression work? · 16. How does logistic regression work? · Level 4: Model Evaluation · 17. How do you evaluate a regression model? · 18. How do you evaluate a classification model? · 19. What are underfitting, overfitting, bias, and variance? · 20. What is cross-validation? · Level 5: Advanced Modeling Concepts · 21. What is regularization? · 22. How do decision trees, random forests, and gradient boosting differ? · 23. What is clustering? · 24. What is principal component analysis? · 25. How is time-series forecasting different from ordinary machine learning? · A Strong Interview Answering Framework
Level 1: Basic Foundations
1. What is data science and how do you approach building a solution for a DS Project?
Answer: I think of data science as the process of using data to answer questions, make predictions, and support decisions.
It combines three main areas:
- Statistics, to understand uncertainty and patterns.
- Programming, to collect, clean, and analyze data.
- Domain knowledge, to make sure the analysis solves the correct problem.
A typical data science project follows these steps:
- Understand the business problem. 10%
- Collect the relevant data. 10%
- Clean and prepare the data. 30%
- Explore the data. 10%
- Build a model or analysis. 15%
- Evaluate the result. 10 %
- Communicate or deploy the solution. 10%
- Monitor the solution over time. 5%
For example, I worked in a DS project for a telecom client wanted to reduce customer cancellations. I first define what "cancellation" means, study historical customer behavior, build a churn-prediction model, and then help the company decide how to act on those predictions.
2. What are observations, features, targets, and data types? Also highlight common mistakes you've faced in a DS project.
Answer: In a typical dataset, each row represents an observation, and each column represents a variable.
For example, in a customer dataset:
- One row may represent one customer.
- Age, income, and account type may be features.
- Whether the customer cancelled may be the target.
A feature is an input used to describe an observation. A target, sometimes called a label, is the value we are trying to predict.
I also need to understand the type of each variable because different data types require different treatment.
Common data types include:
- Continuous numerical data: height, income, temperature.
- Discrete numerical data: number of purchases or complaints.
- Nominal categorical data: city, department, product type.
- Ordinal categorical data: low, medium, high.
- Binary data: yes or no, fraud or not fraud.
- Datetime data: order date, login time.
- Unstructured data: text, images, audio, and video.
One practical mistake is treating every numerical column as a meaningful number. A customer ID may contain digits, but calculating its average is meaningless. I always look at what the variable represents, not only how it is stored.
3. What is the difference between a population and a sample and how do you differentiate bw the two?
Answer: A population is the complete group I want to understand. A sample is the smaller group from which I actually collect data.
For example, if I want to understand all users of a mobile application, every user is part of the population. If I survey 5,000 users, those 5,000 users form my sample.
The goal is for the sample to represent the population well. A very large sample can still be misleading if it is biased.
For example, suppose I want to understand customer satisfaction but send the survey only to customers who recently contacted customer support. That sample may contain more dissatisfied customers than the overall population.
Common sampling problems include:
- Selection bias: certain groups are more likely to enter the sample.
- Non-response bias: people who respond differ from those who do not.
- Survivorship bias: only successful or surviving cases are analyzed.
- Convenience sampling: data is collected from whoever is easiest to reach.
My main rule is that more data does not automatically solve biased data. A smaller representative sample can be more useful than a huge unrepresentative sample.
4. What are mean, median, mode, variance, and standard deviation. Which metric would you use while defining a dataset?
Answer: These are descriptive statistics that summarize a dataset.
The mean is the arithmetic average. I calculate it by adding the values and dividing by the number of observations.
The median is the middle value after sorting the data. It is usually more reliable when the data contains extreme values.
The mode is the most frequently occurring value. It can be useful for categorical data, such as the most common product category.
The variance measures how spread out values are around the mean. The standard deviation is the square root of the variance, so it is expressed in the same units as the original variable.
For example, imagine five salaries:
₹30,000, ₹32,000, ₹35,000, ₹38,000, ₹500,000
The unusually high salary pulls the mean upward. The median better represents a typical salary in this example.
I would not describe a dataset using only its mean. I would also examine its median, standard deviation, minimum, maximum, quartiles, and overall distribution.
5. What is probability, and why is it important in data science?
Answer: Probability is a way of measuring uncertainty. A probability ranges from 0 to 1:
- A probability of 0 means an event is impossible.
- A probability of 1 means it is certain.
- A probability of 0.7 means the event is expected to occur about 70% of the time under similar conditions.
Conditional probability is the probability of one event given that another event has occurred. It is written as:
P(A∣B)
For example, I may want to know the probability that a transaction is fraudulent given that it occurred in a new country.
A probability distribution describes the possible values of a variable and how likely those values are. Common distributions include:
- Normal distribution: often used for continuous measurements.
- Bernoulli distribution: represents a single yes-or-no outcome.
- Binomial distribution: represents the number of successes in several trials.
- Poisson distribution: often models counts of events over time.
Probability is important because predictions are rarely completely certain. A classification model usually does not simply say "fraud." It may say that a transaction has an 82% estimated probability of fraud. The business must then decide how to act on that uncertainty.
Level 2: Practical Data Analysis Questions
6. What is exploratory data analysis?
Answer: Exploratory data analysis, or EDA, is the process of understanding the data before building a model.
During EDA, I try to answer questions such as:
- What does each row represent?
- How many observations and variables are present?
- Are values missing?
- Are there unusual values?
- Are the variables highly skewed?
- Is the target balanced?
- Which features appear related to the target?
- Are there suspicious columns that could cause leakage?
I normally use summary statistics and visualizations such as histograms, box plots, scatter plots, bar charts, and correlation matrices.
For example, while working on a house-price dataset, I discovered that price is heavily skewed, some houses have impossible negative areas, and several location categories are spelled differently.
The purpose of doing EDA on a dataset is to discover data problems, understand patterns, generate hypotheses, and guide later decisions.
I also avoid repeatedly examining the final test set during EDA. Otherwise, I may unintentionally design the model around the test data and make the final performance look better than it really is.
7. How do you clean a dataset?
Answer: Data cleaning means identifying and correcting problems that could make the analysis unreliable.
I usually check for:
- Missing/Null records.
- Duplicate records.
- Incorrect data types.
- Inconsistent category names.
- Impossible values.
- Outliers.
- Incorrect units.
- Formatting problems.
- Records that violate business rules.
For missing values, I first try to understand why they are missing. Missing data may itself contain information. For example, a missing income value may mean that a customer chose not to disclose it.
Depending on the situation, I may:
- Remove rows or columns.
- Fill numerical values with a median or model-based estimate.
- Fill categorical values with an "unknown" category.
- Add a feature indicating that the value was missing.
For outliers, I do not automatically delete them. An outlier may be a data-entry error, but it may also be a genuine and important event, such as a large fraudulent transaction.
I also make sure that imputation, scaling, and other preprocessing steps are fitted only on the training data. Using information from the full dataset can cause data leakage.
8. What is the difference between correlation and causation?
Answer: Correlation means that two variables move together. Causation means that changing one variable actually produces a change in the other.
For example, ice-cream sales and sunburn cases may both increase during summer. They are correlated, but buying ice cream does not cause sunburn. Hot weather influences both variables.
A correlation may be caused by:
- A third variable, called a confounder.
- Reverse causality.
- Coincidence.
- Selection bias.
- A real causal relationship.
Pearson correlation measures linear association, while Spearman correlation measures rank-based or monotonic association.
A high correlation does not prove causation. A low correlation also does not necessarily mean there is no relationship because the relationship may be nonlinear.
To make a stronger causal claim, I would prefer a randomized controlled experiment. When experiments are not possible, I would use careful observational methods and clearly state the assumptions.
To summarize: correlation tells me that variables are associated; causation tells me that changing one variable changes the other.
9. What are hypothesis testing, p-values, and confidence intervals?
Answer: Hypothesis testing is a structured way to evaluate whether an observed result is likely to be real or could reasonably occur because of random variation.
I begin with:
- A null hypothesis, usually representing no effect or no difference.
- An alternative hypothesis, representing the effect I want to investigate.
For example:
- Null hypothesis: the new website design does not change conversion.
- Alternative hypothesis: the new design changes conversion.
A p-value tells me how unusual the observed data would be if the null hypothesis were true. A small p-value provides evidence against the null hypothesis.
However, a p-value is not the probability that the null hypothesis is true.
A confidence interval gives a range of plausible values for an estimated effect. I usually prefer reporting a confidence interval because it shows both the direction and uncertainty of the estimate.
I also consider:
- Type I error: detecting an effect that is not real.
- Type II error: failing to detect a real effect.
- Statistical power: the probability of detecting an effect when it exists.
- Practical significance: whether the effect is large enough to matter.
A result can be statistically significant but commercially unimportant.
Level 3: Machine Learning Foundations
10. What is the difference between supervised and unsupervised learning?
Answer: In supervised learning, the training data contains both input features and a known target or expected output.
For example:
- Predicting house prices from historical house data.
- Predicting whether a customer will leave.
- Predicting whether a transaction is fraudulent.
The model learns a relationship between the inputs and the known answers.
In unsupervised learning, there is no known target. The goal is to discover structure/pattern in the data.
Examples include:
- Grouping similar customers.
- Reducing the number of dimensions.
- Detecting unusual observations.
- Discovering topics in documents.
There is also semi-supervised learning, where a small portion of the data is labeled and a larger portion is unlabeled.
The main point is that I choose the learning approach based on the problem and available data. I would not use clustering simply because it seems sophisticated if the business already has a clear target that can be predicted with supervised learning.
11. What is the difference between regression and classification?
Answer: Regression and classification are both supervised-learning problems, but they predict different types of outcomes.
Regression predicts a numerical value, such as:
- House price.
- Monthly sales.
- Delivery time.
- Customer lifetime value.
Classification predicts a category or probability, such as:
- Fraud or not fraud.
- Customer will churn or will not churn.
- Low, medium, or high risk.
- Which product category an image belongs to.
The same business problem can sometimes be framed in different ways.
For example, instead of predicting the exact amount a customer will spend, I could classify the customer as a high spender or low spender. The better choice depends on how the prediction will be used.
I also use different evaluation metrics. Regression commonly uses MAE or RMSE, while classification commonly uses precision, recall, F1-score, ROC-AUC, or log loss.
12. Why do we divide data into training, validation, and test sets?
Answer: The training set is used to fit the model.
The validation set is used to c_ompare models_, tune hyperparameters, and choose decision thresholds.
The test set is used only at the end to estimate how the final model is likely to perform on unseen data.
This separation is important because a model can memorize patterns in the training data without learning patterns that generalize.
A common split might be:
- 70% training.
- 15% validation.
- 15% test.
However, the correct split depends on the amount and structure of the data.
I also consider how the split should be performed:
- For ordinary independent observations, I use a random split.
- For imbalanced classification, I may use a stratified split.
- For multiple rows from the same customer, I may split by customer.
- _For time-series data, I split _chronologically.
This is closely connected to data leakage. Leakage occurs when the model receives information that would not be available when making a real prediction.
For example, using a customer's cancellation date to predict whether the customer will cancel would create an unrealistically strong model.
13. What is feature engineering?
Answer: Feature engineering is the process of turning raw data into useful model inputs.
The goal is to represent the problem in a way that makes meaningful patterns easier for the model to learn.
Examples include:
- Extracting day, month, or weekday from a date.
- Calculating customer tenure from a signup date.
- Creating revenue per customer.
- Calculating the ratio of debt to income.
- Creating lagged values for time-series forecasting.
- Combining two variables through an interaction.
- Applying a logarithm to a heavily skewed variable.
- Converting raw text into numerical representations.
For a churn model, raw transaction records may be less useful than features such as:
- Number of purchases in the past 30 days.
- Days since the most recent purchase.
- Change in activity compared with the previous month.
- Number of support complaints.
Good feature engineering often comes from domain knowledge.
At the same time, every engineered feature must be checked for leakage. For example, a feature calculated using events that happened after the prediction date would not be valid.
14. What are encoding, standardization, and normalization?
Answer: Most machine-learning algorithms require numerical input, so categorical variables must usually be encoded.
Common encoding methods include:
- One-hot encoding: creates a binary column for each category.
- Ordinal encoding: assigns ordered numbers to ordered categories.
- Frequency encoding: replaces a category with its frequency.
- Target encoding: uses target-based statistics, but must be applied carefully to avoid leakage.
For example, a color variable containing red, blue, and green can be represented using one-hot columns.
Standardization transforms a numerical variable so that it has approximately zero mean and unit standard deviation:
z = ( x − μ ) / σ
Min-max normalization usually transforms values to a range such as 0 to 1.
Scaling is especially important for:
- K-nearest neighbors.
- K-means clustering.
- Support vector machines.
- Neural networks.
- Regularized linear models.
- Principal component analysis.
Tree-based models generally do not require scaling because they split variables using thresholds rather than distances.
I always fit encoders and scalers using only the training data and then apply the fitted transformation to validation, test, and production data.
15. How does linear regression work?
Answer: Linear regression models a numerical target as a linear combination of input features.
A simple form is:
y = β0 + β1x + ϵ
Here:
- y is the target.
- x is a feature.
- β0 is the intercept.
- β1 is the coefficient.
- ϵ represents unexplained error.
The model normally chooses coefficients that minimize the sum of squared residuals. A residual is the difference between the observed and predicted value.
If the coefficient for house area is 5,000, I might interpret that as: holding other included variables constant, one additional unit of area is associated with an estimated ₹5,000 increase in price.
Important assumptions include:
- The relationship is reasonably linear.
- Errors are independent.
- Error variance is reasonably constant.
- Features are not excessively collinear.
- Residual behavior is appropriate for the type of inference being performed.
Linear regression is useful because it is simple, fast, and interpretable. It also provides a strong baseline.
However, a coefficient represents an association unless the study design supports a causal interpretation.
16. How does logistic regression work?
Answer: Logistic regression is mainly used for binary classification_ problems._
Despite its name, it is a classification algorithm. It models the log-odds of an event as a linear combination of the features and then converts that value into a probability using the sigmoid function.
The predicted probability lies between 0 and 1.
For example, a churn model may produce:
P(churn) = 0.78
I can then apply a threshold. With a threshold of 0.5, the customer would be classified as likely to churn. However, 0.5 is not automatically the best threshold.
The threshold should depend on the cost of false positives and false negatives.
The coefficients can be interpreted using odds ratios. A positive coefficient generally means that increasing the feature increases the estimated probability of the positive class, assuming other variables remain fixed.
Logistic regression works well as an interpretable baseline. It can also model nonlinear patterns when I add transformations, interactions, or nonlinear features.
Its limitations include a mostly linear decision boundary in the engineered feature space and sensitivity to multicollinearity or poorly scaled inputs when regularization is used.
Level 4: Model Evaluation
17. How do you evaluate a regression model?
Answer: I select regression metrics based on the business cost of prediction errors.
Common metrics include:
Mean Absolute Error
- MAE is the average absolute difference between actual and predicted values.
- It is easy to interpret because it uses the same units as the target. If the MAE is ₹10,000, the model is wrong by approximately ₹10,000 on average.
Mean Squared Error
- MSE squares each error before averaging. It penalizes large errors more heavily.
Root Mean Squared Error
- RMSE is the square root of MSE, so it returns to the original units of the target. It is useful when large errors are especially costly.
R-squared
- R-squared measures how much variation the model explains compared with predicting the mean. It does not directly tell me the typical size of an error.
Mean Absolute Percentage Error
- MAPE expresses error as a percentage, but it behaves badly when actual values are zero or close to zero.
I also compare the model with a simple baseline, such as predicting the mean, median, or previous value. Finally, I inspect residuals because a single score may hide systematic errors across regions, product groups, or price ranges.
18. How do you evaluate a classification model?
Answer: I begin with the confusion matrix, which contains:
- True positives.
- True negatives.
- False positives.
- False negatives.
From these values, I calculate several metrics.
Accuracy measures the percentage of correct predictions. It can be misleading when the target is imbalanced.
For example, if only 1% of transactions are fraudulent, a model that predicts "not fraud" every time achieves 99% accuracy but has no practical value.
- Precision answers: Of the cases predicted as positive, how many were actually positive?
- Recall answers: Of all actual positive cases, how many did the model detect?
- F1-score combines precision and recall using their harmonic mean.
- ROC-AUC measures how well the model ranks positive observations above negative observations across thresholds.
- PR-AUC focuses on precision and recall and is often more informative when the positive class is rare.
- Log loss evaluates the quality of predicted probabilities and penalizes confident incorrect predictions.
For an imbalanced problem, I may also use class weights, resampling, anomaly-detection methods, or threshold adjustment. Resampling must be performed only on the training data.
The correct metric depends on the business cost. In cancer screening, missing a positive case may be more serious than creating a false alarm, so recall may be prioritized.
19. What are underfitting, overfitting, bias, and variance?
Answer: Underfitting occurs when a model is too simple to capture the important pattern. It performs poorly on both training and validation data.
Overfitting occurs when a model learns the training data too closely, including noise. It performs very well on training data but poorly on unseen data.
These ideas relate to bias and variance.
- High bias means the model makes overly simple assumptions.
- High variance means the model changes too much in response to small changes in the training data.
A shallow decision tree may have high bias. A very deep tree may have high variance.
I diagnose the problem by comparing training and validation performance:
- Poor training and validation performance suggests underfitting.
- Excellent training performance but much worse validation performance suggests overfitting.
Possible solutions to underfitting include:
- Adding useful features.
- Increasing model complexity.
- Reducing excessive regularization.
- Training longer.
Possible solutions to overfitting include:
- Collecting more representative data.
- Reducing model complexity.
- Applying regularization.
- Removing noisy features.
- Using cross-validation.
- Pruning trees.
- Using early stopping.
The goal is not to maximize training performance. The goal is to achieve the best performance on new/unseen data.
20. What is cross-validation?
Answer: Cross-validation estimates model performance by training and evaluating the model on several different subsets of the data.
In k-fold cross-validation, I divide the data into k folds. I train on k−1 folds and evaluate on the remaining fold. I repeat this process until every fold has been used for validation.
For example, in five-fold cross-validation, the model is trained and evaluated five times.
I then examine the average score and its variation across folds. This gives a more stable estimate than relying on one train-validation split.
Different problems need different forms of cross-validation:
- Stratified k-fold: preserves class proportions.
- Group k-fold: keeps related observations, such as records from the same customer, together.
- Time-series cross-validation: trains on past data and validates on later data.
- Nested cross-validation: separates hyperparameter selection from performance estimation.
All preprocessing must occur inside each fold. If I scale or impute the full dataset before cross-validation, information from validation folds can leak into training.
I still keep an untouched test set for the final evaluation when enough data is available.
Level 5: Advanced Modeling Concepts
21. What is regularization?
Answer: Regularization reduces overfitting by adding a penalty for model complexity.
Instead of minimizing only prediction error, the model minimizes:
Prediction error + regularization penalty
Two common methods are L1 and L2 regularization.
L1 regularization
- L1 adds a penalty based on the absolute values of the coefficients. It can push some coefficients exactly to zero, so it can perform a form of feature selection.
L2 regularization
- L2 adds a penalty based on squared coefficient values. It usually shrinks coefficients toward zero without making many of them exactly zero.
Elastic Net
- Elastic Net combines L1 and L2 regularization.
Regularization helps when:
- The model contains many features.
- Features are correlated.
- The model is fitting noise.
- The dataset is small relative to the number of variables.
The regularization strength is a hyperparameter. Too little regularization may leave the model overfitted, while t_oo much may cause underfitting._
For coefficient-based models, I normally standardize numerical features before regularization so that the penalty is applied more fairly across variables with different scales.
22. How do decision trees, random forests, and gradient boosting differ?
Answer: A decision tree makes predictions by repeatedly splitting the data using rules.
For example:
- Is customer tenure less than six months?
- Is monthly spending greater than ₹2,000?
- Has the customer contacted support more than three times?
Trees are easy to explain and can capture nonlinear relationships and interactions. However, a single deep tree can be unstable and may overfit.
A random forest builds many trees using different samples of rows and subsets of features. The predictions are then averaged or voted on.
This is a form of bagging. It mainly reduces variance and makes the model more stable.
Gradient boosting builds trees sequentially. Each new tree focuses on correcting errors made by the previous trees.
Popular implementations include XGBoost, LightGBM, and CatBoost.
A simple comparison is:
- Decision tree: one interpretable but potentially unstable model.
- Random forest: many independent trees combined to reduce variance.
- Gradient boosting: trees built sequentially to improve difficult predictions.
Tree ensembles perform strongly on many structured-data problems. Their disadvantages can include more complex tuning, lower interpretability, and the possibility of overfitting.
I also treat built-in feature importance carefully because importance does not automatically mean causation, and some importance measures favor particular variable types.
23. What is clustering?
Answer: Clustering is an unsupervised-learning technique used to group similar observations when there is no known target.
For example, a company may use clustering to identify groups such as:
- Frequent high-value customers.
- Occasional discount-focused customers.
- New low-engagement customers.
One common algorithm is K-means.
K-means works roughly as follows:
- Choose the number of clusters,
k. - Initialize
kcluster centers. - Assign each observation to its nearest center.
- Recalculate the centers.
- Repeat until the assignments stabilize.
K-means tries to minimize the distance between observations and their assigned cluster centers.
Its limitations include:
- The value of k must be selected.
- It is sensitive to feature scale.
- It is sensitive to outliers.
- It works best for roughly compact, spherical clusters.
- Results can depend on initialization.
Alternatives include hierarchical clustering and DBSCAN.
I may use the elbow method or silhouette score as guidance, but I would not choose clusters using a score alone. The clusters must also be stable, interpretable, and useful for the business.
Clusters are patterns created by an algorithm; they are not automatically natural or permanent truths about people.
24. What is principal component analysis?
Answer: Principal component analysis, or PCA, is a dimensionality-reduction technique.
It transforms the original variables into new variables called principal components. These components are combinations of the original features.
The first component captures the greatest possible amount of variation in the data. The second captures the greatest remaining variation while being uncorrelated with the first, and so on.
Suppose a dataset has 100 strongly correlated measurements. PCA may allow me to represent much of the variation using 10 or 20 components.
PCA can be useful for:
- Reducing the number of dimensions.
- Visualizing high-dimensional data.
- Removing some redundancy.
- Reducing multicollinearity.
- Speeding up certain algorithms.
- Compressing information.
I generally standardize variables before applying PCA because variables with large scales can dominate the components.
PCA also has limitations:
- Components can be difficult to interpret.
- It captures variance, not necessarily predictive usefulness.
- It is primarily a linear transformation.
- A low-variance feature may still be valuable for predicting the target.
I fit PCA only on the training data and then apply that fitted transformation to validation, test, and production data.
25. How is time-series forecasting different from ordinary machine learning?
Answer: Time-series data has an order. An observation from tomorrow is connected to observations from today and yesterday.
Because of this, I cannot usually shuffle time-series data and use an ordinary random split. Training on future information and testing on the past would produce an unrealistic result.
Important time-series components include:
- Trend: long-term upward or downward movement.
- Seasonality: repeating patterns, such as weekly or yearly behavior.
- Cycles: longer variations that may not repeat at fixed intervals.
- Noise: irregular random movement.
- Autocorrelation: relationships between current and earlier values.
- Stationarity: whether statistical properties remain reasonably stable over time.
Common time-series features include:
- Lagged values.
- Rolling averages.
- Rolling standard deviations.
- Day-of-week or month indicators.
- Holiday indicators.
- Changes from previous periods.
I evaluate a forecasting model using chronological backtesting. For example, I may train on January through June and validate on July, then train on January through July and validate on August.
I always compare the model with simple baselines, such as:
- Predicting the previous value.
- Predicting the value from the same day last week.
- Predicting a moving average.
I may use statistical approaches such as ARIMA or exponential smoothing, or machine-learning models using lagged features.
The main leakage rule is that every feature must be available at the time the forecast is made. A rolling average that accidentally includes future values would invalidate the evaluation.
Finally, I monitor performance after deployment because customer behavior, economic conditions, seasonality, and data collection processes can change. This is called data drift or concept drift.
A Strong Interview Answering Framework
For most data science questions, I would structure my answer in four steps:
First, define the concept simply. For example: "Overfitting means the model learns the training data too closely and does not generalize well."
Second, explain why it matters. For example: "A model that overfits may look excellent during development but fail in production."
Third, provide a practical example. For example: "A very deep decision tree may memorize individual training observations."
Fourth, mention limitations or trade-offs. For example: "Reducing complexity can control overfitting, but reducing it too much may create underfitting."
A strong candidate does not only define an algorithm. A strong candidate explains when it should be used, why it works, how it should be evaluated, and what can go wrong.