Skip to content
Sharp

Advanced Python · interview question

Which move is the best default when decorator factories becomes part of this workflow?

Multiple choiceMediumchapter-14-curatedpremiumadvanced-pythondecorator-factories
Choose one answer
Answer and explanation

Correct answer

A. Use decorator factories when the cross-cutting concern needs one explicit configuration knob, such as retry count or audit name.

Why

Use decorator factories when the cross-cutting concern needs one explicit configuration knob, such as retry count or audit name. That is the stronger engineering move because interviewers like hearing that decorator factories are just explicit higher-order functions with real tradeoffs. Stacking configurable decorators thoughtlessly can hide the true runtime behavior behind layers of indirection.

Test yourself on Advanced Python

A free test with instant, explained results. No account needed.

Start free test
All Advanced Python questions →