🚀 Admissions Open for Winter Training Programs 2026
Datadrix Company
Data ScienceTier-1 Interview Bank10 min read

Data Science Interview Questions with Practical Python and SQL Answers

25 high-frequency technical interview questions asked at top Indian analytics firms and MNCs: bias-variance tradeoff, SQL window functions, cross-validation, and live coding challenges with solutions.

AV
Aditya VardhanVerified Mentor
Lead GenAI Architect @ Datadrix • Published May 24, 2026
#Data Science Interview Questions#SQL Python Interview#Accenture Amazon Deloitte#Interview Prep India
Datadrix Technical SpecInteractive Architecture
Domain: Data ScienceVerified by Datadrix Technical Council
Executive Overview

Technical interview rounds for Data Scientist and Machine Learning roles at firms like Amazon India, Accenture, Deloitte, Swiggy, and Tier-1 GCCs evaluate theoretical depth, SQL fluency, and live algorithmic coding. Below are high-frequency questions with complete technical explanations.

11. What is the Bias-Variance Tradeoff and How Do Ensembles Address It?

Bias is error introduced by approximating a complex real-world problem with an overly simplistic model (leading to underfitting).

Variance is error introduced by extreme sensitivity to small fluctuations in training data (leading to overfitting).

Bagging (Random Forest) reduces variance by averaging predictions of uncorrelated deep trees. Boosting (XGBoost/LightGBM) sequentially corrects errors of weak shallow learners, reducing both bias and variance.

22. High-Frequency SQL Interview Problem: Cumulative Running Total & Department Ranking

Candidates are frequently asked to compute 30-day rolling sums and employee rankings within departments using SQL window functions:

Production Code Snippet
-- SQL Window Functions Asked in Tier-1 Tech Interviews
SELECT 
  employee_id,
  department,
  salary,
  -- 1. Consecutive rank without gaps
  DENSE_RANK() OVER (PARTITION BY department ORDER BY salary DESC) as salary_rank,
  -- 2. Running cumulative payroll by department
  SUM(salary) OVER (
    PARTITION BY department 
    ORDER BY employee_id 
    ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
  ) as cumulative_payroll
FROM employees;

33. When Should You Use Stratified K-Fold vs. Standard K-Fold Cross Validation?

Standard K-Fold randomly splits data into K subsets. On severely imbalanced datasets (e.g. 98% non-fraud, 2% fraud), a random fold might contain zero positive fraud cases, severely destabilizing evaluation.

Stratified K-Fold guarantees that each fold preserves the exact class percentage ratio of the complete dataset, ensuring reliable evaluation metrics.

Key Architectural Takeaways:
  • Always explain trade-offs rather than simply giving definitions
  • For SQL rounds, clarify tie-breaking rules and indexing considerations
  • Practice writing Python functions on whiteboards or plain text editors without auto-complete

Mentor Conclusion & Industry Next Steps

Datadrix conducts weekly 1:1 mock technical interviews with senior industry architects to guarantee you walk into your placement rounds with total confidence.

Hands-On Technical Mentorship

Want to Master These Skills in Production?

Join Datadrix’s live cohort with 1:1 mentor code reviews, capstone projects, and 400+ hiring partner referrals.

Book Free Demo Class
Continue Reading

Related Guides & Insights

View All Articles