Last updated: June 26, 2026
10 of 10 questions
Lists are mutable and meant for homogeneous, changing collections; tuples are immutable, hashable, and suited to fixed records.
A default argument is evaluated once at definition, so a mutable default like [] is shared across all calls, accumulating state unexpectedly.
Comprehensions build lists, sets, or dicts in one readable expression with an optional filter, replacing simple map/filter loops.
*args collects extra positional arguments into a tuple; **kwargs collects extra keyword arguments into a dict, enabling flexible variadic functions.
A decorator is a callable that wraps a function to extend its behaviour — logging, caching, auth — without modifying the original function’s code.
Generators yield values one at a time and compute lazily, so they process large or infinite sequences without holding everything in memory.
== compares values for equality; is compares identity (whether two names point to the same object in memory).
Context managers guarantee setup and cleanup via __enter__/__exit__, so the with statement reliably releases resources like files and locks even on errors.
The Global Interpreter Lock lets only one thread execute Python bytecode at a time, so threads help I/O-bound work but not CPU-bound parallelism.
asyncio runs an event loop where async functions cooperatively yield at await points, enabling high-concurrency I/O on a single thread without the GIL’s limits.
Upload your resume and get an instant ATS score with keyword gaps — free, no sign-up.
Java Interview Questions
10 questions
Node.js Interview Questions
Advanced JavaScript Interview Questions