Pandas interviews test DataFrame mechanics, loc/iloc, groupby, merge, missing data, and performance intuition—common in Python data science loops after Python, NumPy, and Data Science.
High-frequency topics
- Series vs DataFrame; selection with [] vs loc vs iloc
- Boolean filtering and SettingWithCopyWarning
- groupby split-apply-combine; agg vs transform
- merge join types and duplicate key explosions
- Missing data strategies; dtype casting from CSV
- Vectorization vs apply/iterrows trade-offs
Whiteboard pattern
- State row count and column dtypes
- Write SQL equivalent for groupby/filter if helpful
- Choose loc for label-based conditional updates
- Mention validate= on merge for production code
Sample verbal answer
"I'd inspect dtypes and null counts, use groupby with named agg for summaries, and export numeric features with to_numpy() for sklearn—avoiding chained assignment by using loc."
Important interview questions and answers
- Q: loc vs iloc?
A: loc uses labels (inclusive slices); iloc uses integer positions (exclusive stop). - Q: SettingWithCopyWarning?
A: Pandas warns when assigning to a slice that might not modify the original—use loc.
Self-check
- Name four common Pandas interview topics.
- Explain inner vs left merge in one sentence.
- How do you avoid chained assignment pitfalls?
Tip: Practice explaining inner vs left merge with a two-table sketch.
Interview prep
- Top topics?
loc/iloc, groupby, merge types, missing data, vectorization vs apply.
- SettingWithCopy?
Assign via loc—not chained slice assignment.
- SQL mapping?
Verbalize GROUP BY and JOIN equivalents—shows dual fluency.