#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →

Interview Insights · Data Analytics

What Happens When a Candidate Cannot Explain Their Notebook

A Jupyter notebook on your resume is an invitation. I will open it, scroll to a cell and ask why it is there. If you cannot answer, the conversation changes quickly. Here is exactly what happens next, and how to make every cell defensible.

Tracks
Explain This Cell · Live Interactive
My question
—
What I point at
Their answer
—
What the candidate says
Round shift
—
Where the interview goes
Open→Point→Explain→Probe
Click a cell to see the question I ask about it, a typical answer, and how that answer changes the rest of the round.

Home / Tutorials / Career Guides / What Happens When a Candidate Cannot Explain Their Notebook

Interview Insights · Data Analytics

What Happens When a Candidate Cannot Explain Their Notebook

STEP 1STEP 2STEP 3STEP 4Cell pickedCleaning or joinChosen at randomProbeNo reasonVague or copiedAnswer givenDoubtSecond probeAnother cellChecks a patternConfirmRound shiftProject droppedBasics testedOutcome
One unexplained cell leads to a second probe. Two unexplained cells usually move the round away from your project and towards basic questions.

Quick summary — Notebook explanation

When you cannot explain your notebook, the interviewer stops treating it as evidence. A notebook is the most detailed proof of your work you can bring to an interview, and that is exactly why interviewers dig into it. When a candidate cannot explain why a column was dropped, why missing values became zero, or why a cell runs out of order, I stop learning about their project and start testing whether they know pandas at all. The round becomes harder, colder and shorter. The good news is that every one of those questions is predictable.

In this guide you will learn:

  1. What I actually do when a notebook cell has no explanation
  2. The cells interviewers probe most: missing values, drops, joins and filters
  3. How hidden state and out-of-order cells give the game away
  4. How to rewrite a cell so its reason is visible in the notebook itself
  5. A self-audit you can run on any notebook before an interview

SECTION 01The moment the notebook stops counting as your work

Here is the honest sequence from my side of the table. I open the notebook you linked, scroll past the imports and stop at the first cleaning cell. I ask a simple question: 'Why did you fill missing values with zero here?' If you give a reason, even an imperfect one, we have a conversation about your choices. If you say 'that removed the error' or 'I am not sure, I followed a tutorial', I make a quiet note and move to a second cell.

One unexplained cell is forgivable. Everyone copies a line now and then. Two in a row form a pattern, and at that point I stop using the notebook as evidence. The rest of the round turns into basic questions, such as the difference between loc and iloc or how merge works, because I can no longer assume you know them. That shift is what candidates feel as the interview 'going cold'.

What you sayWhat I noteMy next moveEffect on the round
It removed the NaN errorFixing symptoms, not dataAsk what the missing values meanDoubt starts
The tutorial did itWork may not be yoursPick another cell to confirmTrust drops
I am not sure now, let me reasonHonest, can thinkLet you reason aloudOften recovers
Missing means no purchase, so zero is correctUnderstands the dataProbe a harder decisionRound deepens
df = pd.read_csv('orders.csv')
df = df.drop(['col7', 'Unnamed: 0', 'discount'], axis=1)
df = df.fillna(0)
df = df[df['amount'] < 50000]
df['month'] = pd.to_datetime(df['date']).dt.month

# Interview questions this invites:
# Why drop 'discount'? Why fill every column with 0?
# Where does 50000 come from? Month without year?
cleaning_cell.py

The second version is longer, but every line now answers its own interview question. Notice also the fix at the end: taking only .dt.month merges January of two different years, while to_period('M') keeps year and month together. Bugs like that are what I find when I probe a cell, and finding them yourself first is much better.

Key insight: A comment that explains why is worth more than ten comments that explain what. 'Fill with zero' is obvious from the code. 'Missing means no return was logged' is the reason I want to hear.

SECTION 02The cells interviewers probe first, and why

Interviewers do not pick cells at random for long. With experience, you learn where weak notebooks hide their problems. The imports and the final chart are rarely interesting. The interesting parts are the decisions in the middle: how missing values were handled, which rows were removed, how tables were joined, and how a metric was defined.

These are the places where a copied notebook shows its seams, because the person who wrote the tutorial made those decisions for their own data, not yours. If your notebook drops the same columns or uses the same thresholds as a popular tutorial on a different dataset, the cell cannot be explained, because there is no reason behind it in your context. Prepare each of the cell types below before you share any notebook.

Cell typeTypical probeWhat a good answer includesRed flag
Missing valuesWhy this fill method?What a blank means in the sourceSame fill for every column
Row filtersWhere does this threshold come from?A check you ran, such as a percentileA round number with no reason
Joins and mergesDid row count change after this?Expected key relationship, count checkNever checked the shape
Metric definitionHow is this KPI calculated?Formula, numerator and denominatorCannot say what is divided by what
orders = pd.read_csv('orders.csv')
customers = pd.read_csv('customers.csv')

print('orders before:', len(orders))

# Each order has one customer; each customer appears once.
# validate raises an error if that assumption is false.
merged = orders.merge(
    customers,
    on='customer_id',
    how='left',
    validate='many_to_one',
    indicator=True,
)

print('after merge:', len(merged))
print(merged['_merge'].value_counts())
# 'left_only' rows are orders with no matching customer.
merge_check.py

The validate and indicator arguments of merge are small, but they let you answer the join question with evidence rather than hope. Very few freshers use them, so they also make your notebook stand out when someone reads it.

Remember: Before sharing a notebook, go to every cell that changes the number of rows and write one line above it explaining why that change is correct.

SECTION 03Hidden state: when the notebook itself contradicts you

Notebooks have a trap that scripts do not. Cells can run in any order, and variables stay in memory after you delete the cell that created them. A notebook that worked on your machine may fail when someone else runs it top to bottom, or the outputs saved in it may come from code that no longer exists.

Interviewers notice this quickly. The execution counters next to each cell, like [12], [3], [27], show the order things ran in. If they jump around, or a cell uses a variable that is never defined above it, the notebook looks assembled rather than built. Worse, if I ask you to rerun a section during a screen share and it breaks, you now have to explain an error under pressure. Clearing hidden state before an interview is basic hygiene.

SymptomWhat it suggestsHow I spot itFix before the interview
Execution numbers out of orderCells were run in a random sequenceCounters such as [14] above [3]Restart kernel and run all
Variable used but never definedDefining cell was deletedNameError on a fresh runSearch for each variable's first use
Outputs do not match the codeCode edited after it ranChart title differs from the codeRerun and resave outputs
Hard-coded local file pathsOnly runs on one machinePaths with personal folder namesUse relative paths in a data folder
# From a terminal, in the project folder:
# executes every cell top to bottom in a fresh kernel
# and saves a new copy, so the original stays untouched.

jupyter nbconvert --to notebook --execute analysis.ipynb \
    --output analysis_clean_run.ipynb

# If any cell fails, the command stops and shows the error.
# Fix it in the original notebook, then run again until it passes.
clean_run.sh

Running the notebook end to end in a fresh kernel takes a few minutes and removes a whole category of awkward moments. If it reveals a cell you cannot fix or explain, that is a strong sign the cell should be removed or rewritten before anyone else sees it.

Pro move: Mention in the interview that you checked the notebook runs top to bottom in a fresh kernel. It is a small sentence that signals you think like someone whose work others will reuse.
How Uncodemy helps: Uncodemy trainers cover answers like these as part of the Data Analytics Training Course: project reviews, mock interviews and resume feedback, with placement assistance once you are interview-ready.

SECTION 04A notebook self-audit before you share the link

Run these three checks on every notebook listed on your resume or portfolio. Each one targets a type of question that causes candidates to freeze.

For EVERY cell that changes data, answer:

[ ] What does this cell change? (rows, columns, values)
[ ] Why is that change correct for THIS dataset?
[ ] What would happen if I skipped it?
[ ] Is the reason written in a comment or markdown cell?

Mark cells you cannot answer with  # TODO-EXPLAIN
Fix or delete every TODO-EXPLAIN before the interview.
notebook-self-audit.md

SECTION 05Habits that make any notebook easy to explain

These habits make explanation part of the notebook, so the interview becomes a reading of reasons you already wrote down.

  • Write the why above the code — Use a short markdown cell or comment before each decision, describing what the data meant and why the step follows from it.
  • Print shapes after changes — After filters and merges, print the row count. It gives you evidence to point at when asked whether a step lost data.
  • Name variables for meaning — Use names such as orders_clean or bulk_orders instead of df2 and temp, so the interviewer can follow without your help.
  • Delete what you cannot defend — If a cell came from a tutorial and you cannot explain it for your data, remove it or redo it. A shorter notebook is safer.
  • Keep a decisions log — End the notebook with a short list of the main decisions and alternatives. It doubles as your interview revision sheet.
Pro tip: Explain your notebook to yourself out loud while scrolling, as if someone were watching. Any cell where you mumble or skip ahead is the cell an interviewer will choose.

SECTION 06Interview Q&A — Notebook explanation

Q1Why did you fill missing values with zero in this column?

Answer with what a blank means in the source. For example: 'In the returns column, a blank means no return was recorded, so zero is the correct value. For city, a blank means unknown, so I used an Unknown label instead, because zero would be meaningless there.'

Q2How do you know this merge did not duplicate rows?

I compared row counts before and after, and I used pandas merge with validate='many_to_one', which raises an error if the right table has duplicate keys. I also used indicator=True to count orders that had no matching customer.

Q3Where does this threshold in your filter come from?

Give the check behind it. For example: 'I looked at the distribution and the 99.9th percentile, and the orders above it were bulk business orders according to customer type. I analysed them separately so they would not distort the retail averages.'

Q4If I restart the kernel and run all cells, will this notebook work?

Yes, I checked that by executing it end to end in a fresh kernel with nbconvert before sharing it. The data is read from a relative data folder, so it runs on any machine that has the files.

Q5Which part of this notebook would you redo today?

Pick something real, such as: 'I would move the cleaning steps into a function so I could apply them to next month's file, and I would add checks that fail loudly if a column is missing.' This shows growth, not weakness.

SECTION 07Test yourself — Notebook explanation quiz

Five questions. No sign-up.

0 / 5

Pick an answer to see why it is right or wrong.

SECTION 08Frequently asked questions

What do interviewers look for in a Jupyter notebook?

They look for clear reasoning in the data cleaning and analysis steps, correct handling of joins and missing values, a notebook that runs top to bottom, and findings that answer a stated question. Clean code helps, but explained decisions matter more.

What if I used a tutorial to build my notebook?

That is common and acceptable if you have adapted it. Make sure every decision fits your dataset, rewrite cells whose reasons you cannot explain, and be honest that you started from a tutorial if asked.

How do I prepare to explain my data analysis notebook in an interview?

Restart the kernel and run all cells, add a reason above every cell that changes data, list every hard-coded number with its source, and practise explaining three random cells to a friend within thirty seconds each.

Should I share my notebook on GitHub before an interview?

Yes, if it runs cleanly and every key step is explained. A notebook full of errors or unexplained cells can hurt you more than having no link, so audit it first.

Is it okay to say I do not remember why I wrote a cell?

Saying it once, and then reasoning aloud about why the step might be needed, is acceptable and often recovers the moment. Saying it repeatedly suggests the work is not yours, so prepare the key cells in advance.

Where can I practise answers like these with expert feedback?

Yes. Uncodemy's Data Analytics Training Course in Noida (classroom and online) includes live projects, one-to-one mock interviews and resume reviews, so you practise answers like these with trainer feedback before the real interview. You can book a free demo class from this page to see how the sessions work.

Classroom & online · Noida

Build notebooks you can defend line by line

Our Data Analytics Training Course teaches Python, pandas and analysis workflows through projects, with reviews where trainers question your notebook the way an interviewer would.

₹15,500 · full programme ₹24,000
  • Hands-on pandas projects
  • Notebook code reviews
  • Project explanation mocks
  • Weekday & weekend batches