Skip to main content
Backend & APIs

Python 3.12+ Core Idioms & Architecture Quiz (2026)

15 Questions15 MinsPass: 80%

Test your mastery of Python 3.12+: Global Interpreter Lock (GIL), asyncio event loop, generators, decorators, typing, and memory model.

Question 1 of 150% Completed
Single Choice

What is the Global Interpreter Lock (GIL) in CPython and how does Python 3.13 address it?

Select an option above

Python: Assessment Scope & Sample Focus Areas

15 questions • 80% pass target

This interactive technical assessment checks your practical understanding of Python (Backend & APIs) across syntax behavior, edge cases, and architectural decisions.

Topic 1 of 15

What is the Global Interpreter Lock (GIL) in CPython and how does Python 3.13 address it?

Topic 2 of 15

What is the difference between a Generator function (using `yield`) and a standard function returning a list?

Topic 3 of 15

How does `asyncio.gather(*tasks)` execute multiple coroutines in Python?

Topic 4 of 15

What does the `@functools.wraps(fn)` decorator do when authoring custom Python decorators?

Topic 5 of 15

What is the difference between `is` and `==` in Python?

Topic 6 of 15

What is the function of `__slots__` in a Python class definition?

Frequently Asked Questions

Python Assessment: Key Technical Questions & Answers

5 Questions Answered
1How does the Global Interpreter Lock (GIL) affect Python multi-threading and what changes in Python 3.13?
The CPython GIL is a mutual exclusion lock that prevents multiple native OS threads from executing Python bytecode simultaneously, preserving CPython's non-thread-safe reference counting memory management. Consequently, multi-threaded CPU-bound programs in Python do not scale across multiple CPU cores (requiring `multiprocessing`). Python 3.13 introduces experimental free-threaded mode (PEP 703), allowing the GIL to be disabled for true multi-core parallel execution.
2What is the difference between Generators, Iterators, and Iterables in Python?
An Iterable is an object capable of returning an iterator via `__iter__()` (e.g. `list`, `dict`). An Iterator is an object with state that yields items one at a time via `__next__()`, raising `StopIteration` when exhausted. A Generator is a function containing the `yield` statement; when called, it returns a generator object that produces values lazily on-demand, executing in $O(1)$ memory without creating large in-memory collections.
3How does Python manage memory via Reference Counting and the Cyclic Garbage Collector?
CPython primarily manages memory via Reference Counting: every object tracks how many references point to it. When an object's reference count drops to zero, its memory is deallocated immediately. To detect and reclaim circular reference loops (where Object A references B and B references A, keeping ref counts above zero), Python's cyclic garbage collector periodically runs generation-based tracking (Generations 0, 1, and 2) using double-linked lists.
4What are Python Decorators and how does `functools.wraps` preserve metadata?
A decorator is a callable that takes a function as an argument and returns an augmented wrapper function (`@decorator` syntax). Without `functools.wraps`, the decorated function loses its original introspection metadata: `__name__`, `__doc__`, and parameter signatures are replaced by the wrapper's details. `@functools.wraps(func)` copies these metadata attributes from the wrapped function to the wrapper.
5What is the difference between `__new__` and `__init__` in Python object construction?
`__new__` is the static method responsible for creating and allocating a new instance of the class; it is the true constructor and must return an instance of `cls`. `__init__` is the initializer method that receives the freshly created instance (`self`) along with arguments to configure object attributes. Overriding `__new__` is required when subclassing immutable types (`tuple`, `str`) or implementing the Singleton design pattern.

Next Steps for Mastery

Reinforce your knowledge with cheatsheets, interactive sandboxes, and interview prep.