On this page
article
Interview Q&A #8
Python Core interview question #8.
Category: Python Core
Question
[Python Core] Question #8: What are decorators?
Answer
Functions that wrap other functions to extend behavior without modifying the original. Syntax: @decorator above def.
Expand your answer with examples from your projects and link to Interview Prep.
Follow-Up Questions
- Can you explain a trade-off involved?
- How would you test this in production?
- What could go wrong at scale?