Short answer: Python interviews for freshers usually test basics: data types (list, tuple, set, dictionary), mutable vs immutable, functions and arguments, list comprehensions, exception handling, and a few intermediate ideas like generators and decorators. Prepare a one-line answer and a tiny example for each, and practise writing short programs (reverse a string, count words, find duplicates) without an editor's help.
Last updated: 3 November 2026
15 questions to practise
- List vs tuple? Lists can be changed (mutable); tuples can't (immutable).
- What is a set? An unordered collection with no duplicates.
- What is a dictionary? Key–value pairs, with fast lookup by key.
- Mutable vs immutable? Mutable objects can change after creation (list, dict, set); immutable ones can't (int, str, tuple).
- What is a list comprehension? A short way to build a list:
[x*x for x in range(5)]. - What are *args and **kwargs? A way to pass a variable number of positional and keyword arguments.
- What is the difference between == and is? == compares values; is checks if two names point to the same object.
- How do you handle errors? With try / except, plus optional else and finally.
- What is a lambda? A small anonymous function:
lambda x: x + 1. - What is a generator? A function that uses yield to produce values one at a time, saving memory.
- What is a decorator? A function that wraps another function to add behaviour, written with @.
- What is the difference between a module and a package? A module is one .py file; a package is a folder of modules.
- Shallow copy vs deep copy? A shallow copy shares nested objects; a deep copy copies them too.
- What does __init__ do? It initialises a new object of a class.
- What is PEP 8? Python's style guide for readable code.
Short programs to practise
- Reverse a string, and check if it's a palindrome
- Count how often each word appears in a sentence
- Find duplicates in a list
- Find the second-largest number in a list
- Read a file and count its lines
How to explain answers
Say the idea in one line, give a tiny example, and mention when you'd use it. "I'd use a set when I need to remove duplicates quickly" shows understanding, not just memory. OOPs questions often come next, so see our OOPs interview questions too. For data roles, read our data analyst interview practice page.
Rehearse it in an AI mock interview
Python answers sound different when you have to say them, not type them. In a Sanviora AI mock interview you choose your role and round, and an AI interviewer asks you five questions out loud. You answer by speaking, as you would in the real room. Afterwards you get a report with an overall score and marks for Communication, Confidence, Structure, Relevance and Depth. You also get feedback on each answer and a list of next steps. Take another interview for the same role and the report shows how you've improved. Start an interview.
FAQ
What Python topics are asked in fresher interviews?
Data types, mutability, functions, list comprehensions, exceptions, and sometimes generators, decorators and OOP.
Do I need to write code in a Python interview?
Usually yes, short programs like string reversal or finding duplicates. Practise without autocomplete.
What is the most common Python interview question?
The difference between a list and a tuple comes up very often.
How should I prepare for a Python interview in a week?
Revise these 15 questions, write five short programs a day, and do one spoken mock interview.
