Data Science MCQ Questions And Answers

91. What is the difference between INNER JOIN, LEFT JOIN, and FULL OUTER JOIN in SQL?

  1. INNER JOIN returns all rows; LEFT JOIN returns half the rows; FULL OUTER JOIN returns one row
  2. INNER JOIN returns only matching rows from both tables; LEFT JOIN returns all rows from the left table and matching rows from the right; FULL OUTER JOIN returns all rows from both tables regardless of matches
  3. All three JOIN types return identical results for tables with no missing keys
  4. LEFT JOIN only works when the left table is smaller than the right table

Answer : B
Explanation: SQL JOINs are essential for data science data extraction. INNER JOIN: returns only rows where the join condition matches in BOTH tables — unmatched rows from either table are excluded. LEFT JOIN (LEFT OUTER JOIN): returns ALL rows from the left table; matched rows from the right table are included; unmatched right-side values are NULL. This is the most commonly used join in data analysis. RIGHT JOIN: mirror of LEFT JOIN. FULL OUTER JOIN: returns ALL rows from both tables; NULLs where there is no match on either side. CROSS JOIN: Cartesian product — every row from left combined with every row from right. Understanding these is critical for data extraction interviews.

92. What is the difference between classification and regression in data science?

  1. Classification predicts continuous outputs; regression predicts categorical outputs
  2. Classification predicts discrete class labels (which category); regression predicts continuous numerical values (how much/how many)
  3. Regression is always more accurate than classification for the same dataset
  4. Classification and regression use identical algorithms with different evaluation metrics

Answer : B
Explanation: Classification predicts which category/class an input belongs to — the output is discrete. Examples: email spam/not spam, disease diagnosis (positive/negative), digit recognition (0-9), customer churn (yes/no). Algorithms: Logistic Regression, Decision Trees, Random Forest, SVM, KNN, Neural Networks. Evaluation: accuracy, precision, recall, F1, AUC-ROC. Regression predicts a continuous numerical value. Examples: house price prediction, temperature forecasting, stock price prediction, age estimation. Algorithms: Linear Regression, Ridge, Lasso, Random Forest Regressor, Gradient Boosting. Evaluation: MAE, RMSE, R². Some algorithms (Decision Trees, Random Forest, Neural Networks) can perform both.

93. What is the purpose of the Seaborn pairplot in data science?

  1. To compare the performance of paired machine learning models on the same dataset
  2. A grid of scatter plots showing the relationships between every pair of numerical features in a dataset simultaneously, with histograms or KDE plots on the diagonal showing individual distributions
  3. To plot paired time series data showing before and after values for each data point
  4. A visualization that plots the training and test performance of a model side by side

Answer : B
Explanation: The seaborn pairplot (sns.pairplot()) is one of the most powerful and commonly used EDA tools. It creates a grid of plots where: Off-diagonal plots show scatter plots between every pair of numerical features, revealing linear/non-linear relationships, clusters, and outliers. Diagonal plots show the distribution of each individual feature (histogram by default, or KDE). The hue parameter colors points by a categorical variable — making class separability immediately visible. Pairplots help identify which features are most predictive, detect multicollinearity, and spot outliers — all critical before building any ML model. For datasets with many features, pairplots become cluttered; use correlation heatmaps instead.

94. What is the difference between Spark and Hadoop in data science?

  1. Hadoop is used for real-time processing; Spark is used for batch processing only
  2. Hadoop is a distributed storage and batch processing framework using MapReduce; Spark is a faster, in-memory distributed computing engine that processes data 10-100x faster and supports batch, streaming, ML, and graph processing
  3. Spark is a programming language; Hadoop is a data visualization framework
  4. Both Hadoop and Spark produce identical performance results for all workloads

Answer : B
Explanation: Hadoop (2006): a distributed framework with two components — HDFS (Hadoop Distributed File System) for distributed storage and MapReduce for distributed batch processing. It reads/writes to disk between each MapReduce step, making it slow for iterative algorithms. Apache Spark (2014): processes data in-memory (RAM), making it 10-100x faster than Hadoop MapReduce for many workloads. Spark supports: batch processing (Spark Core), streaming (Spark Streaming), SQL queries (Spark SQL), ML (MLlib), and graph processing (GraphX). Spark has largely replaced Hadoop MapReduce for processing but still often uses HDFS or cloud storage (S3) as its storage layer. PySpark is the Python API for Spark, widely used by data engineers and data scientists.

95. What is the concept of class imbalance in data science and how is it handled?

  1. Class imbalance occurs when training and test sets have different numbers of rows
  2. Class imbalance occurs when one class has significantly more samples than others in a classification dataset, causing models to be biased toward the majority class; handled via resampling, class weights, or specialized algorithms
  3. Class imbalance refers to unequal numbers of features across different data types
  4. Class imbalance only affects neural networks and not traditional ML algorithms

Answer : B
Explanation: Class Imbalance is extremely common in real-world data science problems (fraud: 0.1% positive; cancer: 1% positive). A model that always predicts the majority class can achieve 99% accuracy while being useless. Handling strategies: Resampling — Oversampling minority class (SMOTE: Synthetic Minority Over-sampling Technique creates synthetic minority examples; random oversampling), Undersampling majority class (random undersampling), or Combination. Class Weights — set class_weight=’balanced’ in sklearn algorithms to penalize misclassifying the minority class more. Algorithm Choice — tree-based methods handle imbalance better than linear models. Evaluation — use F1-score, Precision-Recall curve, and AUC-ROC instead of accuracy.

Artificial Intelligence (AI) MCQ Questions and Answers

96. What is the difference between parametric and non-parametric statistical tests?

  1. Parametric tests use many parameters; non-parametric tests use no parameters at all
  2. Parametric tests assume data follows a specific distribution (usually normal) with fixed parameters; non-parametric tests make no distributional assumptions and work on ranks or signs
  3. Non-parametric tests are always more powerful than parametric tests for all datasets
  4. Parametric tests work only on categorical data; non-parametric tests work only on numerical data

Answer : B
Explanation: Parametric Tests assume data comes from a known distribution (usually normal) and test hypotheses about distribution parameters (mean, variance). Examples: t-test (comparing means), ANOVA (comparing multiple group means), Pearson correlation. They are more powerful when assumptions are met. Non-parametric Tests make no distributional assumptions — they work on ranks or signs. Examples: Mann-Whitney U (non-parametric t-test equivalent), Kruskal-Wallis (non-parametric ANOVA), Spearman correlation, Chi-Square test. Use non-parametric tests when: data is ordinal, sample size is small, or normality is violated. Non-parametric tests are less powerful but more broadly applicable.

97. What is the concept of model interpretability in data science?

  1. The ability of a model to interpret the input data and clean it automatically
  2. The degree to which humans can understand and explain how a machine learning model makes its predictions — critical for trust, debugging, regulatory compliance, and business adoption
  3. A model’s ability to interpret and handle different programming languages as input
  4. The speed at which a model interprets and processes new input data during inference

Answer : B
Explanation: Model Interpretability (or Explainability) is increasingly critical in data science. Interpretable models: Linear/Logistic Regression (coefficients directly show feature impact), Decision Trees (visual tree structure), Rule-based systems. Black-box models: Neural Networks, Random Forest, XGBoost — high accuracy but opaque decisions. Explainability techniques for black-box models: LIME (Local Interpretable Model-agnostic Explanations), SHAP (SHapley Additive exPlanations), Partial Dependence Plots (PDPs), Individual Conditional Expectation (ICE) plots. Interpretability is non-negotiable in high-stakes domains — healthcare (why was this diagnosis made?), finance (why was this loan rejected? — GDPR’s “right to explanation”), and criminal justice.

98. What is the difference between quantitative and qualitative data in data science?

  1. Quantitative data is always more useful than qualitative data for machine learning
  2. Quantitative data is numerical and measurable (age, salary, temperature); qualitative data is categorical and descriptive (color, gender, product category) — each requires different analysis techniques
  3. Qualitative data can only be stored in text databases; quantitative data only in relational databases
  4. Both types of data are processed identically using the same statistical techniques

Answer : B
Explanation: Quantitative Data (numerical): Discrete (countable integers — number of children, clicks) and Continuous (infinite possible values in a range — height, weight, temperature). Analyzed using mean, standard deviation, regression, correlation. Qualitative Data (categorical): Nominal (no inherent order — colors, country names, product category) and Ordinal (ordered categories — education level: high school < bachelor's < master's; customer satisfaction: poor < fair < good < excellent). Analyzed using frequency counts, mode, chi-square test. ML handling: quantitative features can be used directly (after scaling); qualitative features require encoding (label encoding for ordinal, one-hot encoding for nominal).

99. What is MLOps in data science?

  1. A machine learning library that provides operations-focused optimization algorithms
  2. A set of practices combining machine learning, DevOps, and data engineering to reliably and efficiently deploy, monitor, and maintain ML models in production at scale
  3. A project management methodology specifically designed for data science team operations
  4. A cloud computing platform developed by Microsoft for ML model training and deployment

Answer : B
Explanation: MLOps (Machine Learning Operations) addresses the gap between ML development and production deployment. Key components: Version Control (Git for code, DVC for data and models), Experiment Tracking (MLflow, Weights & Biases — logging parameters, metrics, artifacts), CI/CD Pipelines (automated testing and deployment of model updates), Model Registry (storing and versioning production models), Feature Stores (sharing and reusing features across teams), Model Monitoring (detecting data drift, model degradation in production), and Model Serving (REST APIs via Flask, FastAPI, or platforms like SageMaker, Vertex AI). MLOps is essential because most ML models that work in development fail in production without proper operational practices.

100. What is the difference between data science and business intelligence (BI)?

  1. Business intelligence uses ML; data science uses only traditional statistics
  2. Business intelligence focuses on describing and reporting historical data using dashboards and reports to support decision making; data science focuses on building predictive models and discovering insights from data using advanced analytics and ML
  3. Data science is entirely contained within business intelligence as a subset
  4. Both fields are identical — the terms are used interchangeably in all organizations

Answer : B
Explanation: Business Intelligence (BI) answers “What happened?” and “What is happening now?” through historical data reporting, dashboards, KPIs, and ad-hoc queries. Tools: Tableau, Power BI, Looker, SQL. Focus: descriptive analytics. Data Science answers “Why did it happen?”, “What will happen?”, and “What should we do?” using statistical modeling, machine learning, and experimentation. Tools: Python, R, Spark, ML frameworks. Focus: diagnostic, predictive, and prescriptive analytics. The two fields complement each other — BI provides the data infrastructure and reporting that data scientists use to identify problems worth solving with ML. In many organizations, data scientists also build BI dashboards to communicate their findings.