| 1 | In what order do multiple decorators applied to the same declaration execute? TypeScript › Decorators | TypeScript | Decorators | Advanced |
| 2 | How do parameter decorators work, and what is a common real-world use for them? TypeScript › Decorators | TypeScript | Decorators | Advanced |
| 3 | How do the newer, TC39 'Stage 3' decorators differ from TypeScript's legacy experimentalDecorators implementation? TypeScript › Decorators | TypeScript | Decorators | Advanced |
| 4 | Why can decorators make code harder to statically analyze or tree-shake, and what's a common criticism of overusing them? TypeScript › Decorators | TypeScript | Decorators | Advanced |
| 5 | How do you stack MULTIPLE decorators on the same function, and in what order do they actually execute? Python › Decorators | Python | Decorators | Advanced |
| 6 | How does @functools.wraps preserve metadata when writing decorators? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Intermediate |
| 7 | How would you implement a function that dynamically inspects its own call arguments at runtime using the 'inspect' module, useful for building generic validation or logging decorators? Python › Functions & Scope | Python | Functions & Scope | Advanced |
| 8 | What is a decorator in TypeScript, and what does the @ syntax mean? TypeScript › Decorators | TypeScript | Decorators | Beginner |
| 9 | What must be enabled in tsconfig.json to use the (legacy, 'experimental') decorator syntax? TypeScript › Decorators | TypeScript | Decorators | Beginner |
| 10 | What is a decorator, and how does the @decorator_name syntax relate to a plain function call? Python › Decorators | Python | Decorators | Beginner |
| 11 | How do you write a basic decorator that adds a print statement before and after calling the decorated function? Python › Decorators | Python | Decorators | Beginner |
| 12 | How does a class decorator work, and what can it do to the class it's applied to? TypeScript › Decorators | TypeScript | Decorators | Intermediate |
| 13 | How does a method decorator work, and what can it access via the PropertyDescriptor? TypeScript › Decorators | TypeScript | Decorators | Intermediate |
| 14 | What is a decorator factory, and why would you use one instead of a plain decorator function? TypeScript › Decorators | TypeScript | Decorators | Intermediate |
| 15 | Why should you use functools.wraps when writing a decorator, and what problem does it solve? Python › Decorators | Python | Decorators | Intermediate |
| 16 | How do you write a decorator that itself accepts arguments, like @retry(times=3)? Python › Decorators | Python | Decorators | Intermediate |
| 17 | How do you write a decorator as a CLASS instead of a function, implementing __call__? Python › Decorators | Python | Decorators | Intermediate |
| 18 | How do you use functools.lru_cache to add memoization to a function with a single decorator? Python › Decorators | Python | Decorators | Intermediate |
| 19 | How does a property decorator differ from a method decorator in what it receives and what it can do? TypeScript › Decorators | TypeScript | Decorators | Advanced |
| 20 | How do you write a decorator that works correctly on BOTH regular functions and methods (instance methods) of a class? Python › Decorators | Python | Decorators | Advanced |
| 21 | How would you implement a caching/memoization decorator from scratch, similar to functools.lru_cache? Python › Decorators | Python | Decorators | Advanced |
| 22 | How does functools.singledispatch let you implement function overloading based on an argument's TYPE? Python › Decorators | Python | Decorators | Advanced |
| 23 | How would you write a decorator that validates a function's arguments against its type hints at RUNTIME, since Python doesn't enforce type hints by default? Python › Decorators | Python | Decorators | Advanced |
| 24 | How do you preserve a decorated function's original SIGNATURE (parameter names, defaults) for introspection tools, beyond what functools.wraps alone provides? Python › Decorators | Python | Decorators | Advanced |
| 25 | How would you implement a thread-safe caching decorator that correctly handles concurrent calls from multiple threads? Python › Decorators | Python | Decorators | Advanced |
| 26 | How do you write a decorator that works correctly on an async function (coroutine), given that a regular decorator's wrapper would break 'await' usage? Python › Decorators | Python | Decorators | Advanced |
| 27 | How would you build a decorator-based plugin/registration system, similar to how Flask's @app.route() registers view functions? Python › Decorators | Python | Decorators | Advanced |
| 28 | What does it mean that functions are 'first-class objects' in Python? Python › Functions & Scope | Python | Functions & Scope | Beginner |
| 29 | What is the functools module used for in Python? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Beginner |
| 30 | 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 |
| 31 | Why do most Python developers rarely need to write a custom metaclass in everyday code? Python › Metaclasses & Class Customization | Python | Metaclasses & Class Customization | Beginner |
| 32 | How does @contextlib.contextmanager let you write a context manager using a generator function instead of a full class? Python › File I/O & Context Managers | Python | File I/O & Context Managers | Intermediate |
| 33 | How do *args and **kwargs let a function accept an arbitrary number of positional and keyword arguments? Python › Functions & Scope | Python | Functions & Scope | Intermediate |
| 34 | How does functools.partial work and when is it useful? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Intermediate |
| 35 | How does __call__ let an instance of a class be invoked like a function? Python › Magic Methods & Operator Overloading | Python | Magic Methods & Operator Overloading | Intermediate |
| 36 | How do you create a class dynamically using type() with three arguments instead of a class statement? Python › Metaclasses & Class Customization | Python | Metaclasses & Class Customization | Intermediate |
| 37 | How does __init_subclass__ provide a simpler alternative to metaclasses for many customization needs? Python › Metaclasses & Class Customization | Python | Metaclasses & Class Customization | Intermediate |
| 38 | What is the difference between a class decorator and a metaclass for customizing class behavior? Python › Metaclasses & Class Customization | Python | Metaclasses & Class Customization | Intermediate |
| 39 | How would you implement an async context manager that also supports being used as a decorator, similar to contextlib.contextmanager's decorator support? Python › Async Generators & Async Context Managers | Python | Async Generators & Async Context Managers | Advanced |
| 40 | How would you implement a retry-with-backoff decorator that catches specific transient exceptions and retries with increasing delays? Python › Exception Handling | Python | Exception Handling | Advanced |
| 41 | How would you write a reusable context manager decorator using contextlib.contextmanager that ALSO works when applied directly to a function, like @contextmanager-decorated functions support? Python › File I/O & Context Managers | Python | File I/O & Context Managers | Advanced |
| 42 | How does functools.singledispatch enable function overloading based on argument type? Python › functools & Functional Programming Tools | Python | functools & Functional Programming Tools | Advanced |
| 43 | 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 |
| 44 | How do you write a custom metaclass by subclassing type, and when would you do so? Python › Metaclasses & Class Customization | Python | Metaclasses & Class Customization | Advanced |
| 45 | How does importlib let you dynamically import a module by name at runtime? Python › Modules & Packaging | Python | Modules & Packaging | Advanced |