Question Bank

Python interview questions

Working Python code does not by itself explain memory behavior, iteration or mutable objects. Use these questions to review language mechanisms. Support your answer with a small example and predict the result before running it.

1635
questions
16
categories
50
companies

Showing 20 of 114 questions

MediumPython

Explain how memory management works in Python, including reference counting and garbage collection.

gcmemory management
Practice in bot
HardPython

What are metaclasses in Python, and how do they differ from regular classes?

metaclasses
Practice in bot
HardPython

Explain how descriptors work, including the __get__ and __set__ methods.

descriptors
Practice in bot
HardPython

What is MRO and how does C3 linearization work in Python?

mro
Practice in bot
MediumPython

What are the differences between list comprehension and generator expression in Python?

list comprehensiongenerator expression
Practice in bot
MediumPython

How does the walrus operator work and in what cases should it be used?

walrus operator
Practice in bot
EasyPython

Explain how generators work and what their advantages are over regular functions.

generatorsyield
Practice in bot
MediumPython

Compare dataclasses, NamedTuple, and attrs. What are their main differences and when should each be used?

dataclassesnamedtupleattrs
Practice in bot
HardPython

What are metaclasses and what are they used for?

metaclassesadvanced
Practice in bot
HardPython

Explain the concept of descriptors and how they implement the __get__ and __set__ interfaces.

descriptorsadvanced
Practice in bot
HardPython

What is MRO (Method Resolution Order) and how does C3 linearization work?

mroinheritance
Practice in bot
EasyPython

Explain the difference between decorators with arguments and without arguments.

decorators
Practice in bot
MediumPython

When should you use asyncio instead of threading?

asynciothreading
Practice in bot
MediumPython

How do descriptors work in Python and where can they be useful?

descriptors
Practice in bot
MediumPython

Explain how garbage collection works in Python and what reference counting is.

memory managementgc
Practice in bot
MediumPython

What are the advantages of using dataclasses over NamedTuple?

dataclassesnamedtuple
Practice in bot
HardPython

Explain how MRO (method resolution order) works in Python.

mro
Practice in bot
HardPython

When should __slots__ be used and what are its limitations?

slots
Practice in bot
HardPython

Explain how the context manager mechanism works in Python.

context managers
Practice in bot
EasyPythonNNS

How would you rate your Python skills?

lang-python
Practice in bot

Prepare for your next interview with Vibe Interview.

Download Vibe Interview
Python interview questions — page 2 | Vibe Interview