50 most common Data Science interview questions and answers


🧠 GENERAL DATA SCIENCE

  1. What is Data Science?
    It is an interdisciplinary field that combines statistics, computer science, and domain knowledge to extract insights from data.
  2. Difference between Data Science, Machine Learning, and AI?
  • AI: Simulating human intelligence.
  • ML: Subset of AI focusing on pattern learning.
  • DS: Uses ML and statistics for data analysis.
  1. What are the types of Data?
  • Structured
  • Unstructured
  • Semi-structured
  1. What is the lifecycle of a data science project?
    Problem understanding → Data acquisition → Data preparation → Modeling → Evaluation → Deployment → Monitoring.
  2. What is EDA (Exploratory Data Analysis)?
    It involves visual and quantitative techniques to understand data patterns, spot anomalies, and check assumptions.
  3. What are features in a dataset?
    Independent variables or attributes used to predict the target variable.
  4. What is a target variable?
    The variable we aim to predict (dependent variable).
  5. What is feature engineering?
    Creating, transforming, or selecting variables to improve model performance.
  6. What is data wrangling?
    The process of cleaning and unifying complex data sets for analysis.
  7. What are outliers?
    Data points that differ significantly from other observations.

📊 STATISTICS & PROBABILITY

  1. What is the p-value?
    Probability of observing test results under the null hypothesis.
  2. What is a confidence interval?
    A range of values used to estimate a population parameter with a certain confidence level (e.g., 95%).
  3. What is correlation?
    Measures the relationship between two variables (-1 to +1).
  4. Difference between correlation and causation?
    Correlation is a relationship; causation implies one variable causes the other.
  5. What is variance?
    The average squared deviation from the mean.
  6. What is standard deviation?
    Square root of variance; indicates data dispersion.
  7. What is the Central Limit Theorem (CLT)?
    Distribution of sample means tends to be normal as sample size increases.
  8. What is a null hypothesis?
    A general statement that there is no effect or difference.
  9. What is hypothesis testing?
    Statistical method to evaluate assumptions about population parameters.
  10. What is A/B testing?
    A statistical method to compare two versions (A & B) and determine which one performs better.

📈 MACHINE LEARNING

  1. What is the difference between supervised and unsupervised learning?
  • Supervised: Labeled data
  • Unsupervised: Unlabeled data
  1. What is overfitting?
    Model performs well on training data but poorly on test data.
  2. What is underfitting?
    Model fails to capture patterns in training data.
  3. How to prevent overfitting?
  • Cross-validation
  • Pruning
  • Regularization
  • More data
  1. What is regularization?
    Technique to penalize model complexity (e.g., L1/L2).
  2. What is bias-variance tradeoff?
    Balance between error due to assumptions (bias) and error due to variance in training data.
  3. What is cross-validation?
    A method to evaluate model performance by partitioning the dataset into training and testing sets multiple times.
  4. What is a confusion matrix?
    A table to evaluate the performance of a classification model (TP, TN, FP, FN).
  5. Explain precision, recall, and F1-score.
  • Precision = TP / (TP + FP)
  • Recall = TP / (TP + FN)
  • F1 = 2 × (Precision × Recall) / (Precision + Recall)
  1. What are the assumptions of linear regression?
  • Linearity
  • No multicollinearity
  • Homoscedasticity
  • Normality of residuals
  • Independence

🧮 ALGORITHMS & MODELING

  1. What is logistic regression?
    Used for binary classification, outputs probabilities.
  2. What is a decision tree?
    A flowchart-like model for decision making and classification.
  3. What is Random Forest?
    An ensemble of decision trees for improved accuracy and reduced overfitting.
  4. What is Gradient Boosting?
    Sequential ensemble technique that builds models incrementally to correct errors of previous ones.
  5. What is KNN (K-Nearest Neighbors)?
    A non-parametric method that classifies a point based on majority vote of its neighbors.
  6. What is PCA (Principal Component Analysis)?
    A technique to reduce dimensionality by projecting data onto principal components.
  7. What is clustering?
    Unsupervised technique to group similar data points (e.g., K-Means).
  8. What is K-Means?
    A clustering algorithm that partitions data into K clusters.
  9. What is an ROC curve?
    A graph showing the performance of a classification model at all thresholds.
  10. What is AUC – ROC?
    Area under the ROC Curve; higher AUC indicates better model performance.

🛠️ TOOLS & PROGRAMMING

  1. What are common Python libraries for Data Science?
  • NumPy
  • Pandas
  • Matplotlib
  • Scikit-learn
  • TensorFlow
  • Seaborn
  1. What is the difference between NumPy and Pandas?
    NumPy handles numerical data; Pandas is built on NumPy and handles tabular data.
  2. What is the difference between .iloc[] and .loc[] in Pandas?
  • iloc[]: Index-based selection
  • loc[]: Label-based selection
  1. What is the difference between map(), apply(), and applymap() in Pandas?
  • map() for Series
  • apply() for Series or DataFrame
  • applymap() for element-wise operation on DataFrames
  1. What is the use of groupby() in Pandas?
    To split data into groups, apply a function, and combine results.
  2. What is serialization in Python?
    Converting a data structure to a format that can be saved and loaded (e.g., using pickle or joblib).
  3. How do you handle missing data in Pandas?
  • df.dropna()
  • df.fillna(value)
  • Imputation with statistical measures
  1. What are lambda functions in Python?
    Anonymous functions defined with the lambda keyword.
  2. What is vectorization in NumPy?
    Using arrays to apply operations without explicit loops, increasing performance.
  3. What is the difference between shallow copy and deep copy in Python?
  • Shallow Copy: Copies references to the objects
  • Deep Copy: Copies the actual objects recursively

Leave a Reply

Your email address will not be published. Required fields are marked *