Technical Round 5 May 2026 9 min read
Top 10 Python Questions Asked in Data Analyst Interviews (2026)
Every one of these questions was asked in an actual data-analyst interview at an Indian mid-to-large company in the last 6 months. Learn the answer and the mistake the average fresher makes.
MockMate AI Team
We aggregated 450+ interview transcripts submitted by MockMate AI users interviewing for data-analyst roles in the last 6 months. Below are the 10 Python questions that repeated the most — with a quick answer, and the common trap.
- 1What is the difference between
listandtuple? Lists are mutable, tuples aren’t. Trap: don’t stop there — add “tuples are hashable, so they can be dict keys”. - 2What is the GIL and why does it matter for a data analyst? Global Interpreter Lock — CPython runs one thread at a time. For data work it means multi-processing scales your pandas jobs, threading usually doesn’t.
- 3Explain
mergevsjoinvsconcatin pandas.mergeis SQL-style joining on keys,joinis index-based and syntactic sugar over merge,concatstitches by axis. - 4How do you handle NaN in a large dataframe? Prefer
fillna()with a domain-specific default, ordropna()only when the column is <5% missing. Trap: never blindly fill with zero for a currency column. - 5Difference between
apply,map, andapplymap? Series:map. DataFrame column-wise:apply. Every cell:applymap. Vectorised numpy is usually 10x faster than all three — mention this. - 6What does
@staticmethodvs@classmethoddo? staticmethod ignoresselfandcls, classmethod receivescls(the class itself). Use classmethod for alternate constructors. - 7Deep copy vs shallow copy — which one does
df.copy()do? By defaultdeep=True, so it’s a deep copy. Settingdeep=Falseonly copies the metadata. - 8How do you optimise a pandas group-by on 10M rows? Use categorical dtypes for group keys,
sort=False, and prefer.agg()with numpy functions over lambdas. - 9What are Python generators — give a data example. Lazy iterators. Reading a 5 GB CSV in chunks with
pd.read_csv(..., chunksize=100_000)yields a generator — you never load the whole file. - 10Write a one-liner to find the second-highest salary in a dataframe.
df.nlargest(2, ‘salary’).iloc[-1]. Trap: don’t saysort_values().iloc[1]unless you handle duplicates.
Practising in MockMate AI’s Technical mode pastes your target JD and returns 15 questions tuned to it — so you get the exact 10 above (and 5 more surprises) for your specific company.
Tags#python#data analyst#technical