PYTHON
INTERVIEW
2026
[Link]/@teknouf
UBK ANNA
1 . L I S T E N C A R E F U L LY
PAY C L O S E AT T E N T I O N T O T H E Q U E S T I O N .
I F U N C L E A R , A S K F O R C L A R I F I C AT I O N B E F O R E S TA R T I N G .
2. THINK ALOUD
S H A R E Y O U R T H O U G H T P R O C E S S S T E P - B Y- S T E P S O T H E
I N T E R V I E W E R U N D E R S TA N D S Y O U R A P P R O A C H .
EVEN IF THE FINAL ANSWER IS WRONG, A GOOD APPROACH
CAN STILL IMPRESS.
3 . S TA R T S I M P L E
B E G I N W I T H T H E M O S T S T R A I G H T F O R WA R D S O L U T I O N .
T H E N D I S C U S S P O S S I B L E O P T I M I Z AT I O N S I F T I M E P E R M I T S .
4 . H A N D L E M I S TA K E S G R A C E F U L LY
I F Y O U G E T S T U C K , E X P L A I N W H AT Y O U ’ R E T RY I N G A N D W H Y
IT’S NOT WORKING.
S M A L L C O R R E C T I O N S A R E F I N E — S H O W P R O B L E M - S O LV I N G
S K I L L S , N O T PA N I C .
5. SHOW CONFIDENCE
M A I N TA I N G O O D P O S T U R E , M A K E E Y E C O N TA C T, A N D S P E A K
C L E A R LY.
AV O I D F I L L E R W O R D S L I K E " U M M " A N D " I T H I N K " — R E P L A C E
W I T H " I N M Y U N D E R S TA N D I N G . . . " .
6. ASK BEFORE USING SHORTCUTS
I F Y O U WA N T T O U S E I N B U I LT F U N C T I O N S , C O N F I R M I F I T ’ S
ALLOWED.
S O M E I N T E R V I E W S P R E F E R A M A N U A L I M P L E M E N TAT I O N .
7 . E N D W I T H A S U M M A RY
ONCE DONE, EXPLAIN YOUR FINAL APPROACH, TIME
C O M P L E X I T Y, A N D W H Y I T W O R K S .
T H I S S H O W S Y O U U N D E R S TA N D B O T H I M P L E M E N TAT I O N A N D
E F F I C I E N C Y.
1. Explain OOPS Concepts in Python
Encapsulation : Encapsulation means binding of data (attributes) and
methods (behaviors) that operate on the data into a single unit, called
F
a class. This helps keep the implementation details hidden from the
outside world, allowing for better organization and security.
U
By encapsulation we can keep data related to two different Department
separate.
For example in a company there are two department Sales and
O
Accounts. So here sales data and people are separate from Accounts
data and people.
KN
Abstraction: Abstractionmeansshowingonlythenecessarydetails
to user and hiding the implementation of it.
For example : We use ATM , we just press some buttons and cash
comes out , but we dont know what actually is happening behind
TE
machine.
Polymorphism : It means existing in various forms . Two important
types of Polymorphism are CompileTime(method overloading) and
Runtime Polymorphism(method overriding).
Inheritance : Inheritance is a way to create new classes based on
existing ones. It allows a new class (called a derived class or subclass)
to inherit properties and behaviors from an existing class (called a
base class or superclass). This promotes code reuse and helps
establish a hierarchy of classes.
For all materials
Must visit - [Link]/tekno_uf/
2. Explain Access modifiers in Python
Public:
● Syntax:Nounderscores(_)beforethename.
● Example:[Link]
● Description:Publicmembersareaccessiblefromanywhere,bothinside
F
and outside the class. By default, all class members are public.
U
Protected:
● Syntax:Asingleunderscore(_)beforethename.
● Example:self._name
● Description:Protectedmembersareintendedtobeaccessedonlywithin
O
the class and its subclasses. This is just a convention, and technically, they
can still be accessed from outside the class.
KN
Private:
● Syntax:Doubleunderscores(__)beforethename.
● Example:self.__name
● Description:Privatemembersareintendedtobeaccessedonlywithinthe
class where they are defined. Python performs name mangling to make it
harder to access private members from outside the class. They can still be
TE
accessed using a specific name-mangled syntax.
3. Explain Self Keyword In python
The self keyword in Python is used in class methods to refer
to the instance of the class that is calling the method. It allows
you to access the attributes and other methods of the class
F
within its methods. Here’s a simple explanation with an
example:
U
O
KN
TE
4. Difference between a Mutable data
type and an Immutable data type?
F
U
O
KN
TE
5. What is the difference between a Set
and Dictionary?
F
U
O
KN
TE
For all materials
Must visit - [Link]/tekno_uf/
6. Differentiate between List and Tuple?
F
U
O
KN
TE
7. What is a pass in Python?
pass is a null statement, meaning it does nothing when
executed. It's typically used as a placeholder in
situations where a statement is syntactically required but
F
no action is needed. Here's a simple example:
U
O
KN
TE
8. What is List Comprehension?
List comprehension is a concise way of creating lists in
Python. It allows you to generate a new list by applying an
F
expression to each item in an existing iterable (like a list,
tuple, or range) and optionally filtering the items based on a
U
condition. Here's a simple explanation with an example:
O
KN
TE
For all materials
Must visit - [Link]/tekno_uf/
9. What is Dictionary Comprehension?
Give an Example
F
Dictionary comprehension is similar to list comprehension,
but instead of creating lists, it allows you to create
U
dictionaries in a concise and efficient way. You can
generate a new dictionary by specifying key-value pairs
based on an expression and optionally filtering them based
on a condition. Here's a simple explanation with an
O
example:
KN
TE
10. What is a lambda function?
A lambda function in Python is a small anonymous function
defined using the lambda keyword. It can take any number
F
of arguments but can only have one expression. Lambda
functions are often used when you need a short function for
U
a short period of time. Here's a simple explanation with an
example:
O
KN
TE
11. How is Exceptional handling done in
Python?
F
Exception handling in Python allows you to gracefully
handle errors or exceptional situations that may occur
U
[Link] try, except,
else, and finally blocks to catch and handle
exceptions.
O
KN
TE
For all materials
Must visit - [Link]/tekno_uf/
● We use a try block to execute the code that may raise
an exception.
● If an exception occurs (e.g., division by zero), the
control jumps to the corresponding except block.
● In the except block, we handle the exception (e.g.,
F
print an error message).
● If no exception occurs, the code inside the else block
U
is executed.
● Finally, the finally block is executed regardless of
O
whether an exception occurred or not. It's often used
for cleanup operations.
KN
TE
12. What is the difference between a
shallow copy and a deep copy?
F
U
O
KN
TE
13. What are *args and **Kwargs
F
U
O
KN
TE
For all materials
Must visit - [Link]/tekno_uf/
14. Explain Datatypes in python
List : Represents ordered collections of items enclosed
F
within square brackets []. Items can be of different data
types and mutable (modifiable). Example: [1, 'hello',
U
3.14].
Tuple: Represents ordered collections of items enclosed
O
within parentheses (). Items can be of different data types
and immutable (cannot be modified after creation).
Example:(1, 'world', 3.14).
KN
Dictionary : Represents unordered collections of key-value
pairs enclosed within curly braces {}. Keys are unique and
immutable, values can be of any data type. Example:
TE
{'name': 'John', 'age': 25}.
Set : Represents unordered collections of unique elements
enclosed within curly braces {}. Sets do not allow duplicate
elements. Example: {1, 2, 3}, { 'apple',
'banana', 'orange'}.
15. What is slicing in Python?
Slicing in Python allows you to extract a portion of a
sequence (like a string, list, or tuple) by specifying a start
F
index, stop index, and an optional step size. It's a powerful
and efficient way to work with sequences. Here's a simple
U
explanation with an example:
O
KN
TE
16. What is monkey patching in Python?
Monkey patching in Python refers to the practice of
dynamically modifying or extending the behavior of a class
F
or module at runtime. It allows you to change the behavior
of existing code without altering its original source code.
U
Here's a simple explanation with an example:
O
KN
TE
17. What is __init__() in Python?
In Python, __init__() is a special method (also known
as a constructor) that is automatically called when a new
instance of a class is created. It is used to initialize the
F
object's attributes or perform any setup that needs to be
done when the object is created. Here's a simple
U
explanation with an example:
O
KN
TE
For all materials
Must visit - [Link]/tekno_uf/
18. What is the difference between / and
// in Python?
F
U
O
KN
TE
19. What is the difference between '=='
and 'is' in Python?
F
U
O
KN
TE
For all materials
Must visit - [Link]/tekno_uf/
20. What is Docstring in Python
docstring is a string literal that occurs as the first statement
in a module, function, class, or method definition. Its
purpose is to provide documentation about the object it
belongs to, such as its purpose, usage, parameters, and
return values. Docstrings are accessible through the
__doc__ attribute of the object.