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