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

EasyPython

What is GIL and how does it affect multithreading in Python?

multithreadinggil
Practice in bot
EasyPython

Explain the difference between multiprocessing and threading in Python.

threadingmultiprocessing
Practice in bot
EasyPython

What are decorators with arguments and how do they work?

decorators
Practice in bot
MediumPython

How do generators work and when should you use yield?

generatorsyield
Practice in bot
MediumPython

Explain what async/await is and how the event loop works.

asyncawaitevent loop
Practice in bot
MediumPython

Compare dataclasses, NamedTuple, and attrs. What are their differences?

dataclassesnamedtupleattrs
Practice in bot
HardPython

How does MRO work and what is C3 linearization?

mroc3 linearization
Practice in bot
HardPython

What are descriptors and how do they work with __get__ and __set__?

descriptors
Practice in bot
HardPython

When and why should you use __slots__ in classes?

slots
Practice in bot
MediumPython

When and why should you use decorators with arguments?

decoratorsarguments
Practice in bot
EasyPython

What are generators and how does the yield operator work?

generatorsyield
Practice in bot
MediumPython

Compare dataclasses and NamedTuple. In what cases is it better to use each?

dataclassesnamedtuple
Practice in bot
MediumPython

How does reference counting work in Python?

memory managementreference counting
Practice in bot
HardPython

What are metaclasses and how are they used in Python?

metaclasses
Practice in bot
HardPython

Explain how __slots__ work and how they help with memory management.

__slots__memory management
Practice in bot
MediumPython

How does a context manager work and what advantages does it provide?

context manager__enter____exit__
Practice in bot
HardPython

What are ABC and how are they used to create abstract base classes?

abcabstract classes
Practice in bot
EasyPython

Explain how the GIL works in Python and how it affects multithreading.

gilmultithreading
Practice in bot
EasyPython

What are decorators with arguments and how do they differ from regular decorators?

pythondecorators
Practice in bot
MediumPython

Compare dataclasses, NamedTuple, and attrs. What are the advantages and disadvantages of each?

dataclassesnamedtupleattrs
Practice in bot

Prepare for your next interview with Vibe Interview.

Download Vibe Interview
Python interview questions | Vibe Interview