Interview Insights · Pandas
Why Pandas Eliminates More Candidates Than They Expect
Quick summary — Pandas eliminations
Pandas eliminates candidates quietly, because it is rarely a named round but sits underneath several of them. Few job descriptions list a 'Pandas round'. Instead, Pandas sits inside the take-home assignment, the notebook review and the live data cleaning task. Candidates who spent their preparation on SQL queries and ML theory often lose points here on things they considered basic: row counts that change after a merge, dates stored as text, missing values ignored, and notebooks that cannot be re-run. None of these feel like failures at the time, which is why the rejection surprises them.
In this guide you will learn:
- The hiring stages where Pandas skills are tested without being named
- Why take-home assignments filter out more candidates than live rounds
- The data type and date problems that sink cleaning tasks
- What a reviewer looks for when they open your notebook
- A preparation plan for each Pandas-heavy stage
SECTION 01Take-home assignments: where most Pandas eliminations happen
A take-home assignment usually looks simple: here are two or three CSV files, answer these business questions. Candidates often spend most of their time on charts and conclusions. Reviewers spend most of their time checking whether the numbers are right, and wrong numbers almost always trace back to a Pandas step.
The most common cause is a merge that silently changes the row count. Join orders to a customers table with duplicate customer IDs, and every affected order is counted twice. Revenue looks higher, every chart built on it is wrong, and the reviewer can spot it in minutes.
| Common take-home mistake | How it shows in results | How a reviewer spots it | The prevention step |
|---|---|---|---|
| Merge on non-unique keys | Revenue or counts too high | Compares row counts before and after | merge(..., validate='many_to_one') |
| Inner join drops unmatched rows | Totals too low, customers missing | Checks totals against raw files | Use how='left' and count NaNs |
| Duplicates never removed | Inflated counts | Runs df.duplicated().sum() | Define the key, then drop_duplicates(subset=...) |
| Filters applied in the wrong order | Different answer than expected | Reproduces the steps | Write each filter as a named, checked step |
import pandas as pd
orders = pd.read_csv('orders.csv')
customers = pd.read_csv('customers.csv')
print('orders rows:', len(orders))
print('dup customer ids:', customers['customer_id'].duplicated().sum())
# Fail loudly if customers has duplicate keys
merged = orders.merge(customers, on='customer_id',
how='left', validate='many_to_one',
indicator=True)
print('merged rows:', len(merged)) # must equal orders rows
print(merged['_merge'].value_counts()) # left_only = no customer
assert len(merged) == len(orders)import pandas as pd
# If validate fails, inspect the duplicates first
dups = customers[customers['customer_id'].duplicated(keep=False)]
print(dups.sort_values('customer_id').head(10))
# Decide a rule and write it down, for example:
# keep the most recently updated record per customer
customers = (customers
.sort_values('updated_at')
.drop_duplicates(subset='customer_id', keep='last'))
# In the notebook, add a markdown note:
# 'Customers had duplicate IDs. Kept the latest
# record per ID, based on updated_at.'
The written note matters as much as the code. Reviewers want to see that you noticed the problem and made a deliberate choice. A silent fix looks the same as no fix if they cannot see your reasoning.
SECTION 02The notebook review: when someone reads every cell
After a take-home, or in place of one, many teams ask to see a project notebook. A reviewer opens it and reads it like a colleague would. They are asking one question: would I be comfortable maintaining this code?
Notebooks that cannot be re-run from top to bottom, that use loops for everything, or that overwrite the same variable many times make that answer no. The analysis might be fine. The reviewer still cannot trust it, because they cannot reproduce it.
| What the reviewer sees | What it suggests | What they would prefer | Cost to fix |
|---|---|---|---|
| Cells run out of order, numbers 14, 3, 27 | Results may not be reproducible | Restart and Run All before sharing | Minutes |
| df, df1, df2, df_final, df_final2 | Hard to follow which data is used | Named stages: raw, clean, monthly | An hour |
| iterrows for simple calculations | Thinks in rows, not columns | Vectorised operations | An hour |
| No shape or null checks anywhere | Never verified the data | A check after each major step | Minutes |
df1 = df[df['status'] != 'cancelled']
df2 = df1.merge(cust, on='cid')
for i, r in df2.iterrows():
if r['amount'] > 5000:
df2.loc[i, 'big'] = 1
else:
df2.loc[i, 'big'] = 0
df3 = df2.groupby('city').sum()
df3
# Reviewer questions:
# Which join type? What happened to unmatched rows?
# Why sum every column, including IDs?
# Why a loop for a simple flag?import numpy as np
active = orders.query("status != 'cancelled'")
print('active orders:', len(active))
with_cust = active.merge(customers, on='customer_id',
how='left', validate='many_to_one')
assert len(with_cust) == len(active)
with_cust['is_big'] = np.where(with_cust['amount'] > 5000, 1, 0)
city_summary = (with_cust
.groupby('city', as_index=False)
.agg(orders=('order_id', 'count'),
revenue=('amount', 'sum'),
big_orders=('is_big', 'sum')))
city_summary.sort_values('revenue', ascending=False)
The second version is not much longer. It just answers the reviewer's questions before they ask them: which rows were removed, which join was used, what was checked and exactly which columns were aggregated.
SECTION 03Live cleaning tasks: data types and dates decide the outcome
Live cleaning tasks are short, often fifteen or twenty minutes. You get a messy file and a simple question, such as total sales per month. The difficulty is not the question. It is that the amount column has commas and currency signs, and the date column mixes formats.
Candidates who never check dtypes try to sum a text column, get string concatenation or an error, and lose half the time debugging. Candidates who run df.dtypes in the first minute see the problem immediately and fix it in a few lines.
| Messy column | What df.dtypes shows | Correct fix | Check after fixing |
|---|---|---|---|
| Amount like 'Rs 1,250' | object | Remove non-digits, then pd.to_numeric | df['amount'].isna().sum() for bad values |
| Dates like 05/03/2025 | object | pd.to_datetime with format='%d/%m/%Y' | Min and max dates look sensible |
| City with ' delhi', 'Delhi ' | object | .str.strip().str.title() | value_counts shows one Delhi |
| Quantity with 'NA' text | object | pd.to_numeric(errors='coerce') | Count how many became NaN |
import pandas as pd
df = pd.read_csv('sales_messy.csv')
print(df.dtypes)
df['amount'] = pd.to_numeric(
df['amount'].astype(str).str.replace(r'[^0-9.]', '', regex=True),
errors='coerce')
df['order_date'] = pd.to_datetime(df['order_date'],
format='%d/%m/%Y', errors='coerce')
df['city'] = df['city'].str.strip().str.title()
print(df[['amount', 'order_date']].isna().sum())
print(df['order_date'].min(), df['order_date'].max())# Q: Total sales per month
monthly = (df.dropna(subset=['amount', 'order_date'])
.groupby(df['order_date'].dt.to_period('M'))['amount']
.sum())
print(monthly)
# What to say out loud:
# 'I dropped rows where amount or date could not be
# parsed. There were N of them, which I would report
# to the business rather than hide.'
# Why the format matters: without format='%d/%m/%Y',
# a date like 05/03/2025 can be read as 3 May
# instead of 5 March.
Notice the habit of counting what could not be parsed. Using errors='coerce' is fine, but only if you then report how many values became NaN. Silently dropping bad rows is one of the most common reasons a cleaning task fails review.
SECTION 04Preparation plan for Pandas-heavy hiring stages
Prepare for each stage separately, because each one tests a different habit. Use these three plans over two or three weeks before you start applying for analyst or data science roles.
TAKE-HOME PREPARATION
Pick a public dataset with 2-3 related tables.
Write 5 business questions yourself.
For every merge:
[ ] rows before and after printed
[ ] validate= argument used
[ ] indicator=True checked for unmatched rows
For every headline number:
[ ] recomputed a second way (e.g. pivot_table)
[ ] written in a markdown cell with the logic
Final: Restart & Run All. Fix anything that fails.BEFORE SHARING ANY NOTEBOOK
[ ] Title cell: question, data, key findings
[ ] Imports and file paths in the first cell
[ ] Variable names describe the stage
raw_orders -> clean_orders -> monthly_sales
[ ] No iterrows for simple logic
[ ] Shape or null check after each major step
[ ] Markdown note for every assumption
[ ] Charts have titles and axis labels
[ ] Runs top to bottom on a fresh kernel20-MINUTE DRILL (do it three times)
Minute 0-2 df.shape, df.dtypes, df.head()
Minute 2-4 df.isna().sum(), df.duplicated().sum()
Minute 4-10 Fix numbers, dates, text columns
Minute 10-12 Count values lost to coercion
Minute 12-17 Answer the business question
Minute 17-20 Say the answer and the caveats
Make your own messy file: add currency signs,
mixed date formats, extra spaces and 'NA' text.
SECTION 05Habits that keep Pandas from eliminating you
Each of these habits takes seconds and closes one of the quiet gaps where candidates get filtered out.
- Count rows around every merge — Printing the row count before and after a merge catches the most common cause of wrong totals in take-home tasks.
- Check dtypes before maths — A numeric-looking column stored as object will break sums and averages. df.dtypes reveals it in the first minute.
- Give dates a format — Passing an explicit format to pd.to_datetime avoids day and month swaps on Indian-style dates.
- Report what you dropped — Whenever you remove rows or coerce values, say how many and why. Reviewers trust visible decisions.
- Restart and run all — A notebook that fails on a fresh kernel is often the reviewer's last impression of your work.
SECTION 06Interview Q&A — Pandas eliminations
Q1How do you make sure a merge does not duplicate rows?
I check that the key is unique on the side that should be unique, using duplicated().sum(). Then I pass validate='many_to_one' or 'one_to_one' to merge, so Pandas raises an error if the assumption is wrong. I also compare row counts before and after the merge.
Q2How do you convert a text amount column like 'Rs 1,250' to numbers?
I remove everything except digits and the decimal point with str.replace and a regex, then use pd.to_numeric with errors='coerce'. After that I count how many values became NaN, and I look at a few of them to make sure I am not losing real data.
Q3Why should you pass a format to pd.to_datetime?
Because ambiguous dates like 05/03/2025 can be read as month first or day first. Giving format='%d/%m/%Y' makes the parsing explicit and consistent. It also makes conversion faster and errors easier to spot when combined with errors='coerce'.
Q4What is the indicator argument in merge used for?
indicator=True adds a _merge column that says whether each row came from both tables, only the left or only the right. With a left join, rows marked left_only are the ones with no match, which helps me count and investigate missing keys.
Q5How do you group sales by month in Pandas?
Once the date column is a real datetime, I group by df['date'].dt.to_period('M') and sum the amount. Another option is to set the date as the index and use resample('MS').sum(). I make sure dates are parsed correctly first, or the months will be wrong.
SECTION 07Test yourself — Pandas eliminations quiz
Five questions. No sign-up.
0 / 5Pick an answer to see why it is right or wrong.
SECTION 08Frequently asked questions
Do data analyst interviews test Pandas?
Many do, especially at companies that use Python for analysis. Pandas usually appears inside a take-home assignment, a live coding task or a project discussion rather than as a separately named round.
What is a typical Pandas take-home assignment?
Usually two or three CSV files and a set of business questions, such as monthly revenue, top customers or churn by segment. You submit a notebook with code, results and conclusions. Correct numbers and clear reasoning matter more than fancy charts.
Why was I rejected after a take-home assignment?
Common reasons are wrong totals from merges or duplicates, notebooks that do not run from top to bottom, unexplained cleaning choices and conclusions not backed by the data. Review your notebook against these points before your next submission.
How much Pandas do I need for a data science job?
You should be comfortable with reading and cleaning data, filtering, groupby, merge, pivot tables, dates, missing values and creating features. You should also be able to check your work, such as row counts and dtypes, without being reminded.
How do I practise data cleaning in Pandas?
Take a clean dataset and deliberately make it messy: add currency signs, extra spaces, mixed date formats and duplicates. Then clean it back under a timer, checking dtypes and counting lost values at each step.
How can I prepare for Pandas interview questions with a trainer?
Yes. Uncodemy's Python Training Course in Noida (classroom and online) includes live projects, one-to-one mock interviews and resume reviews, so you practise Pandas interview questions with trainer feedback before the real interview. You can book a free demo class from this page to see how the sessions work.
SECTION 09Related reads
Classroom & online · Noida
Get past the stages where Pandas filters
Our Python Training Course trains you on Pandas through real take-home style assignments, notebook reviews and live cleaning tasks, the stages where most quiet eliminations happen.
Talk to a counsellor for current fees- Take-home style projects
- Notebook code reviews
- Live data cleaning drills
- Weekday & weekend batches