📊 2026 Career Guide
⚡ 2026 Verified Program Offer: 6 Months 100% Live Training • ₹1,20,000 Flat Fee (₹10,000/mo 0% EMI) • Official IBM & Microsoft Badges • Guaranteed 6-Mo Paid Internship*
📥 Download 2026 Syllabus & Fee PDF →
FREE 2026 PDF DOWNLOAD • VERIFIED LAB CODE

📥 Download Complete 2026 Printable PDF Notes, Architecture Diagrams & GitHub Code

Get instant free access to the 2026 printable PDF cheat-sheet, runnable lab repositories, interview evaluation rubric, and AI Campus 6-Month Paid Corporate Internship roadmap.

Download Free PDF & Syllabus Roadmap →

Top 10 Senior Python, Pandas & NumPy for Data Science Technical Interview Questions & Answers (2026)

Rigorous technical interview questions, mathematical foundations, code implementations, and architectural explanations asked during senior engineering and specialist hiring rounds at FAANG, Tier-1 MNCs, and high-growth AI unicorns.

Q1 How does Pandas handle missing data (NaN vs None), and what is the difference between dropna() and fillna() methods?

Pandas uses NumPy NaN (float) to represent missing numerical data, while None is Python's native null object.

dropna() eliminates entire rows or columns along an axis according to threshold criteria, while fillna() replaces null values with mean, median, forward-fill (ffill), or backward-fill (bfill) methods to maintain dataset continuity.

PYTHON EXAMPLE
import pandas as pd
import numpy as np

df = pd.DataFrame({'A': [1, np.nan, 3], 'B': [np.nan, 5, 6]})
df['A_filled'] = df['A'].fillna(df['A'].median())
clean_df = df.dropna(subset=['B'])

Q2 What is the memory and performance difference between apply(), map(), and vectorized operations in Pandas?

Vectorized operations utilize precompiled C routines through NumPy ufuncs, executing orders of magnitude faster without Python interpreter overhead.

apply() iterates across rows or columns in Python bytecode, which is slow for large datasets. Vectorization should always be prioritized.

PYTHON EXAMPLE
# Vectorized (Fastest O(N))
df['total'] = df['price'] * df['quantity']

# apply() with lambda (10-50x slower)
df['total'] = df.apply(lambda row: row['price'] * row['quantity'], axis=1)

Q3 Explain the difference between loc and iloc in Pandas with multi-indexing.

loc is label-based selection where both start and stop boundaries are inclusive.

iloc is purely integer position-based (0 to length-1) where the stop boundary is exclusive, matching standard Python slicing.

PYTHON EXAMPLE
df.loc[df['salary'] > 80000, ['emp_name', 'department']]
df.iloc[0:10, 0:3] # First 10 rows, first 3 columns

Q4 How does Pandas groupby() work under the hood (Split-Apply-Combine)?

GroupBy partitions dataframe rows into subsets by hash values of the key columns, applies an aggregation or transformation function to each group in parallel, and combines the results into an output DataFrame.

PYTHON EXAMPLE
df.groupby('department').agg({'salary': ['mean', 'max'], 'experience': 'median'})

Q5 What is broadcasting in NumPy and what are the strict rules for dimension compatibility?

Broadcasting allows NumPy to perform arithmetic operations on arrays of different shapes without unneeded memory copying.

Two dimensions are compatible when: 1. They are equal, or 2. One of them is 1. If lengths differ, dimensions are prepended with 1 on the left.

PYTHON EXAMPLE
a = np.array([1, 2, 3]) # shape (3,)
b = np.array([[10], [20], [30]]) # shape (3, 1)
result = a + b # shape (3, 3)

Q6 Explain memory optimization techniques for massive Pandas DataFrames (downcasting & categoricals).

Default float64 and int64 consume 8 bytes per value. Converting int64 to int16/int32 and object columns with low cardinality to 'category' dtypes often reduces memory usage by 80-90%.

PYTHON EXAMPLE
df['category_col'] = df['category_col'].astype('category')
df['id_col'] = pd.to_numeric(df['id_col'], downcast='integer')

Q7 How do you merge, join, and concatenate DataFrames in Pandas?

pd.concat() stacks dataframes along an axis (rows or columns) preserving indices.

pd.merge() performs database-style joins (inner, left, right, outer) based on common key columns, while DataFrame.join() merges on index values by default.

PYTHON EXAMPLE
merged = pd.merge(orders, customers, on='customer_id', how='left')

Q8 How do you detect and handle outliers in Pandas using IQR and Z-Score?

IQR method calculates Q1 (25th percentile) and Q3 (75th percentile). Any data point below Q1 - 1.5*IQR or above Q3 + 1.5*IQR is flagged as an anomaly.

PYTHON EXAMPLE
Q1 = df['revenue'].quantile(0.25)
Q3 = df['revenue'].quantile(0.75)
IQR = Q3 - Q1
clean = df[(df['revenue'] >= Q1 - 1.5*IQR) & (df['revenue'] <= Q3 + 1.5*IQR)]

Q9 What is method chaining and pipe() in Pandas and why is it preferred for production code?

Method chaining produces readable, functional transformations without creating unnecessary intermediate variables in memory.

PYTHON EXAMPLE
def clean_data(df):
    return (df
            .dropna(subset=['email'])
            .assign(name=lambda d: d['name'].str.strip().str.title())
            .query('age >= 18'))

Q10 How do you handle DateTime data in Pandas (resample, rolling window, timezones)?

Converting columns to pd.to_datetime enables powerful time-series operations such as resample('M') for monthly aggregates and rolling(window=7).mean() for moving averages.

PYTHON EXAMPLE
df['date'] = pd.to_datetime(df['date'])
df.set_index('date', inplace=True)
weekly_avg = df['sales'].rolling(window=7).mean()
2026 Career Fast-Track

Accelerate Your Career with Guaranteed Paid Internship*

Transparent ₹1,20,000 Fee (Inclusive of GST) • ₹10,000/month No-Cost EMI • 6-Month Corporate Paid Internship (₹15,000 – ₹35,000/mo stipend) with official IBM & Microsoft Credly credentials.

DATA SCIENCE & AI TRACK • Guaranteed 6-Month Paid Corporate Internship*

Data Science, Python, Machine Learning & GenAI

Master Python, SQL, XGBoost, PyTorch & RAG with official IBM & Microsoft credentials + Guaranteed 6-Month Paid Corporate Internship* (₹1,20,000 / ₹10,000 per month 0% EMI).

🔗 Explore Official 2026 Career & Certification Pathways