| 1 | What is the difference between functools.cache and functools.lru_cache? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Beginner |
| 2 | What is the functools module used for in Python? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Beginner |
| 3 | How do you use functools.partial to fix keyword arguments for logging or callback functions? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Beginner |
| 4 | How does functools.partial work and when is it useful? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Intermediate |
| 5 | What does functools.reduce do, and why is it often discouraged in favor of loops? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Intermediate |
| 6 | How does @functools.wraps preserve metadata when writing decorators? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Intermediate |
| 7 | How does functools.total_ordering reduce boilerplate for comparison methods? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Intermediate |
| 8 | What does functools.reduce's initializer argument do, and why should you usually provide one? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Intermediate |
| 9 | What is the practical difference between using functools.reduce and a plain for-loop for accumulation? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Intermediate |
| 10 | How does functools.singledispatch enable function overloading based on argument type? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Advanced |
| 11 | What is functools.cached_property and how does it differ from @property combined with manual caching? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Advanced |
| 12 | How does functools.cmp_to_key bridge old-style comparison functions with Python 3's key-based sorting? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Advanced |
| 13 | How can functools.lru_cache be used with typed=True, and what does that change? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Advanced |
| 14 | How do you clear or inspect the cache of an lru_cache-decorated function? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Advanced |
| 15 | Why is caution needed when applying @lru_cache directly to instance methods? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Advanced |
| 16 | Why should you use functools.wraps when writing a decorator, and what problem does it solve? Python › Decorators | Python | Decorators | Intermediate |
| 17 | How do you use functools.lru_cache to add memoization to a function with a single decorator? Python › Decorators | Python | Decorators | Intermediate |
| 18 | How do you use functools.partial to create a new function with some arguments pre-filled? Python › Functions & Scope | Python | Functions & Scope | Advanced |
| 19 | How does the itertools module complement the iterator protocol? Python › Iterators & the Iterator Protocol | Python | Iterators & the Iterator Protocol | Intermediate |
| 20 | How does itertools.tee let you iterate over the same iterator multiple times independently? Python › Iterators & the Iterator Protocol | Python | Iterators & the Iterator Protocol | Advanced |
| 21 | How do you write an async context manager more concisely using @contextlib.asynccontextmanager? Python › Async Generators & Async Context Managers | Python | Async Generators & Async Context Managers | Intermediate |
| 22 | How does the 'nonlocal' keyword let a nested function modify a variable in its ENCLOSING (not global) scope? Python › Functions & Scope | Python | Functions & Scope | Intermediate |
| 23 | How do comparison magic methods like __lt__, __le__, __gt__, and __ge__ support custom sorting? Python › Magic Methods & Operator Overloading | Python | Magic Methods & Operator Overloading | Intermediate |
| 24 | How would you implement a memory-efficient sliding window or batching generator over a large iterable? Python › Comprehensions & Generators | Python | Comprehensions & Generators | Advanced |
| 25 | How would you use concurrent.futures.ProcessPoolExecutor together with asyncio to run CPU-bound work without blocking the event loop? Python › Concurrency (asyncio/threading/multiprocessing) | Python | Concurrency (asyncio/threading/multiprocessing) | Advanced |
| 26 | How would you efficiently merge two dictionaries in modern Python, and how do the different approaches handle overlapping keys? Python › Data Types & Structures | Python | Data Types & Structures | Advanced |
| 27 | How does Python evaluate default argument expressions ONLY ONCE at definition time, and what SAFE pattern exploits this for genuinely useful caching? Python › Functions & Scope | Python | Functions & Scope | Advanced |