On this page
article
Interview Q&A #73
Algorithms interview question #8.
Category: Algorithms
Question
[Algorithms] 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?