🐍27 questions
Python
Data structures, comprehensions, decorators, the GIL.
Lists & DictsComprehensionsDecoratorsGeneratorsOOPAsync
Sample Questions (27 live)
Lists & DictsEasy
What is the difference between a list and a tuple in Python?
InfosysTCSAccentureRead →
DecoratorsMedium
What is a decorator in Python?
AmazonDeloitteRead →
Data TypesEasy
What is the difference between mutable and immutable types in Python?
InfosysTCSAccentureRead →
Data TypesEasy
What is the difference between `is` and `==` in Python?
InfosysWiproAccentureRead →
ListsEasy
What is the difference between append() and extend() on a list?
TCSInfosysCognizantRead →
ListsEasy
How does slicing work, and how do you reverse a string or list with it?
AmazonInfosysAccentureRead →
TuplesEasy
When would you use a tuple, and what are packing, unpacking and namedtuple?
InfosysTCSDeloitteRead →
DictionariesEasy
How do you safely read and update dictionary values (get, setdefault, Counter)?
AmazonInfosysTCSRead →
SetsEasy
What is a set in Python and when should you use one?
AmazonInfosysCognizantRead →
StringsEasy
Are Python strings mutable, and how do you build/format them efficiently?
InfosysTCSWiproRead →
LambdaEasy
What is a lambda function and when should you use one?
InfosysAccentureDeloitteRead →
ComprehensionsEasy
What is a list comprehension and why is it preferred over a loop?
AmazonInfosysTCSRead →
ExceptionsEasy
How does exception handling work in Python (try/except/else/finally)?
InfosysTCSAccentureRead →
File HandlingEasy
What is the right way to read and write files in Python?
InfosysTCSCognizantRead →
OOPEasy
What are __init__ and self in a Python class?
InfosysTCSAccentureRead →
ModulesEasy
What are modules and packages, and how does import work?
InfosysTCSWiproRead →
EnvironmentsEasy
What is a virtual environment and why does every Python project need one?
InfosysTCSAccentureRead →
Data TypesMedium
What is the difference between a shallow copy and a deep copy?
AmazonDeloitteMicrosoftRead →
FunctionsMedium
Why is a mutable default argument (like def f(x, items=[])) dangerous?
AmazonMicrosoftDeloitteRead →
FunctionsMedium
What are *args and **kwargs, and how do you use them?
AmazonDeloitteMicrosoftRead →
GeneratorsMedium
What is a generator and how does yield work?
AmazonGoogleMicrosoftRead →
IteratorsMedium
What is the difference between an iterable and an iterator?
AmazonMicrosoftDeloitteRead →
InheritanceMedium
How does inheritance work in Python, and what does super() do?
AmazonMicrosoftDeloitteRead →
PolymorphismMedium
What is polymorphism and duck typing in Python?
AmazonMicrosoftDeloitteRead →
EncapsulationMedium
How does encapsulation work in Python (_ , __ , and @property)?
AmazonDeloitteMicrosoftRead →
ConcurrencyMedium
When should you use multithreading vs multiprocessing in Python?
AmazonGoogleMicrosoftRead →
GILHard
What is the GIL (Global Interpreter Lock) and what are its implications?
AmazonGoogleMicrosoftRead →
Advertisement
Google AdSense slot