Interview Insights · Python
Why Python Questions Reveal More Than Any Resume Line
Quick summary — Python depth
A resume line lists Python skills; a single well-aimed question shows which of them are real. Skills sections are written for keyword filters, so they look alike. Interviewers know that, and they use short, precise questions to turn each keyword into evidence. Ask a candidate who lists OOP when they would use @property, and you learn whether they have designed classes or only read about them. Ask a 'data processing' candidate to sort records by two fields, and you learn whether they know the key function. This page shows which Python questions reveal the most, what each answer level means and how to answer with evidence.
In this guide you will learn:
- Why Python skill lines carry little weight without questions behind them
- Small questions on OOP, sorting and environments, with code
- What weak, decent and strong answers reveal to the interviewer
- How *args and kwargs** expose real function-design experience
- A sheet to turn each keyword on your resume into a story
SECTION 01What a Python skills line hides
When two resumes both say 'Python, OOP, Flask, pandas', I cannot tell them apart. One candidate may have built and deployed an API. The other may have followed a course and never written a class of their own. The line is the same. So the first thing I do is pick a keyword and ask a question that only experience answers well.
The best questions are small. They target a decision people make when they really use the tool, not a definition they can memorise. Here is how I turn common Python keywords into questions.
| Keyword | What it hides | Revealing question | What a strong answer mentions |
|---|---|---|---|
| OOP | Whether you design classes or only use them | When would you use @property? | Validation or computed values behind attribute syntax |
| Data processing | Whether you handle real records | Sort employees by department, then salary descending | key with a tuple and a negative number |
| Flask / Django | Whether you have set up a real project | How do you manage dependencies? | venv, requirements.txt with pinned versions |
| Functions | Whether you write reusable code | What are *args and **kwargs for? | Wrappers, flexible APIs and passing arguments through |
class Account:
def __init__(self, owner, balance=0):
self.owner = owner
self.balance = balance # goes through the setter below
@property
def balance(self):
return self._balance
@balance.setter
def balance(self, value):
if value < 0:
raise ValueError("balance cannot be negative")
self._balance = value
acc = Account("Asha", 500)
acc.balance = 300 # validated
print(acc.balance) # 300
try:
acc.balance = -50
except ValueError as e:
print(e) # balance cannot be negativeQ: When would you use @property?
Weak: "It makes a method into a property."
-> Knows the word.
Decent: "To add getters and setters in Python."
-> Knows the purpose, sounds like Java thinking.
Strong: "When I want attribute syntax but need logic
behind it, like validating a balance or computing a
full name. It also lets me start with a plain
attribute and add validation later without changing
any code that uses the class."
-> Has designed and evolved a class.
The last sentence of the strong answer is what gives it away. Knowing that @property lets you change a plain attribute into a validated one without breaking callers is something you learn by maintaining code, not by reading about it.
SECTION 02Small Python questions that reveal real use
A few questions come up again and again because they reveal so much in so little time. Sorting by multiple fields shows whether you have handled real records. Dependency management shows whether you have set up a project from scratch. *args and **kwargs show whether you have written functions other code calls.
For each one, I am listening for the detail that only appears with real use: the negative sign in a sort key, the pinned version in requirements, the pass-through in a wrapper.
| Question | Weak answer | Strong answer | What it reveals |
|---|---|---|---|
| Sort by dept, then salary high to low | Sort twice in the wrong order | key=lambda e: (e['dept'], -e['salary']) | Has sorted real records |
| How do you isolate project packages? | pip install globally | python -m venv .venv, then pip freeze to a pinned file | Has set up and shared projects |
| What are *args and **kwargs? | Extra arguments | Collect positional and keyword arguments, often to pass through | Has written wrappers or flexible APIs |
| sort() vs sorted()? | Same thing | sort() is in place and returns None; sorted() returns a new list | Has hit the None bug |
employees = [
{"name": "Ravi", "dept": "QA", "salary": 42000},
{"name": "Asha", "dept": "Dev", "salary": 55000},
{"name": "Karan", "dept": "Dev", "salary": 61000},
{"name": "Meena", "dept": "QA", "salary": 48000},
]
ranked = sorted(employees, key=lambda e: (e["dept"], -e["salary"]))
for e in ranked:
print(e["dept"], e["name"], e["salary"])
# Dev Karan 61000
# Dev Asha 55000
# QA Meena 48000
# QA Ravi 42000
# For non-numeric descending fields, use two stable sorts:
# sort by the secondary key first, then by the primary key.
by_name_desc = sorted(employees, key=lambda e: e["name"], reverse=True)
final = sorted(by_name_desc, key=lambda e: e["dept"])import functools
import time
def timed(func):
@functools.wraps(func)
def wrapper(*args, **kwargs): # accept anything
start = time.perf_counter()
result = func(*args, **kwargs) # pass it all through
print(f"{func.__name__} took {time.perf_counter() - start:.4f}s")
return result
return wrapper
@timed
def build_report(rows, *, title="Report"):
return f"{title}: {len(rows)} rows"
print(build_report([1, 2, 3], title="Sales"))
# Spoken: "The wrapper does not know build_report's
# signature, so *args and **kwargs collect whatever is
# passed and forward it unchanged."
For the environment question, a strong spoken answer sounds like this: 'I create a virtual environment with python -m venv .venv, activate it, install what I need and save the exact versions with pip freeze > requirements.txt. Anyone cloning the project runs pip install -r requirements.txt and gets the same versions.' That answer shows you have shared a project with someone else, which a resume line never can.
SECTION 03Answering with evidence, not just facts
Since questions are how interviewers see past the resume, every answer is a chance to add what the resume could not. The simplest way is to follow each technical answer with one sentence of evidence: where you used it, or a problem it caused you.
This turns a correct answer into a credible one. Many candidates give correct definitions. Fewer can say 'I hit this when my report function returned None because I used sort() and returned the result'. That one line tells me you have written and debugged real Python.
| Answer part | Purpose | Example: sort() vs sorted() | Length |
|---|---|---|---|
| Direct answer | Answer what was asked | sort() changes the list in place; sorted() returns a new list | One sentence |
| Detail | Show precision | sort() returns None, sorted() works on any iterable | One sentence |
| Evidence | Show real use | I once returned data.sort() and got None in my API | One sentence |
| Choice | Show judgement | I use sorted() when the original order is still needed | One sentence |
Q: What is the difference between sort() and sorted()?
A: sort() is a list method and sorted() is a
built-in function.
(True, but it does not say anything about
behaviour, and nothing about experience.)Q: What is the difference between sort() and sorted()?
A: sort() sorts a list in place and returns None.
sorted() takes any iterable and returns a new list,
leaving the original alone.
I learned the None part the hard way: I wrote
return scores.sort(reverse=True)
in a Flask route, and the API returned null. The fix
was to sort first and then return the list, or use
return sorted(scores, reverse=True).
I use sorted() when other code still needs the
original order.
You do not need a dramatic story. A small, specific bug like returning None is more convincing than a large claim, because it is the kind of thing only someone who wrote the code would remember. In Uncodemy mock interviews, we ask students to prepare one such line for every keyword they list.
SECTION 04Turn every Python keyword into a story
Take your own resume and work through these sheets. By the end, each keyword should have a likely question, a strong answer and a line of evidence. Remove any keyword you cannot fill in.
KEYWORD MAP
Keyword Likely question
OOP -> ______________________________
Flask/Django -> ______________________________
pandas -> ______________________________
SQL -> ______________________________
Git -> ______________________________
APIs -> ______________________________
Testing -> ______________________________
Answer each aloud in under 60 seconds.
If you cannot, practise it or remove the keyword.EVIDENCE CARD (one per keyword)
Keyword: ______________
Project where I used it: ______________
What I built with it: ______________
A bug or surprise it caused: ______________
How I fixed it: ______________
A choice I made (X over Y) and why:
________________________________
One-line evidence sentence:
________________________________QUICK SELF-TEST (no notes)
[ ] Write a class with a validated @property
[ ] Sort a list of dicts by two keys, one descending
[ ] Write a decorator that uses *args and **kwargs
[ ] Create a venv and a pinned requirements file
[ ] Explain sort() returning None with an example
[ ] Use enumerate and zip in one loop
[ ] Read a JSON file and handle a missing key
Each one you cannot do in 10 minutes is a keyword
that may not survive its first question.
SECTION 05Habits that make Python answers reveal your best
These habits make sure each question shows your real level rather than hiding it.
- List fewer, deeper skills — A shorter skills line where every item survives a follow-up is far stronger than a long list with weak spots.
- Answer with a choice — Say when you would use something and when you would not. Choices reveal judgement.
- Keep a bug memory — Remember two or three small Python bugs you hit and fixed. They make the best evidence lines.
- Show a short snippet — Offer to write three lines of code when a topic allows. Code often explains faster than words.
- Know your project setup — Be able to describe how your project is installed and run from scratch. It proves the project is really yours.
SECTION 06Interview Q&A — Python depth
Q1When would you use @property in Python?
When you want simple attribute access but need logic behind it, such as validation, a computed value or lazy loading. It also lets you start with a plain attribute and add validation later without changing code that uses the class.
Q2How do you sort a list of dictionaries by two fields?
Use sorted with a key that returns a tuple, for example key=lambda e: (e['dept'], -e['salary']) to sort by department and then salary descending. For descending text fields, use two stable sorts, secondary key first, then primary key.
Q3What are *args and **kwargs?
*args collects extra positional arguments into a tuple, and **kwargs collects extra keyword arguments into a dict. They are common in decorators and wrappers that must accept any arguments and pass them through unchanged.
Q4How do you manage dependencies in a Python project?
Create a virtual environment for the project, install packages inside it and record exact versions in a requirements file with pip freeze. Others can recreate the same environment with pip install -r requirements.txt. Tools like Poetry offer a similar workflow with a lock file.
Q5What is the difference between sort() and sorted()?
sort() is a list method that sorts in place and returns None. sorted() is a built-in that accepts any iterable and returns a new sorted list, leaving the original unchanged.
SECTION 07Test yourself — Python depth quiz
Five questions. No sign-up.
0 / 5Pick an answer to see why it is right or wrong.
SECTION 08Frequently asked questions
What Python questions do interviewers ask to test real experience?
Short choice and behaviour questions, such as when to use @property, how to sort by two fields, sort() versus sorted(), *args and **kwargs, and how you manage project dependencies.
Should I list every Python library I have used on my resume?
No. List the ones you can answer a follow-up on. Interviewers often pick a keyword at random, so every listed item should hold up.
How do I prove my Python skills in an interview?
Give a direct answer, then add one sentence of evidence: where you used it or a problem it caused. Offer a short snippet when the topic allows.
What is a virtual environment in Python and why use it?
It is an isolated folder with its own Python packages for one project. It prevents version conflicts between projects and makes it easy to share exact dependencies through a requirements file.
Do interviewers check GitHub for Python candidates?
Some do, especially when two resumes look similar. A clean README, a requirements file and readable code help, but you still need to explain your choices in the interview.
How can I prepare for Python 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 Python 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
Make every Python keyword on your resume real
Our Python Training Course covers core Python, OOP, a web framework, data handling and project setup through hands-on work, so each skill you list has evidence behind it.
Talk to a counsellor for current fees- Core Python and OOP
- Flask or Django projects
- Resume and answer review
- Weekday & weekend batches