Write a decorator called call_counter that counts how many times a function is called
A medium Python mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.
- Domain
- Python
- Difficulty
- medium
Interview Prompt
Write a decorator called call_counter that counts how many times a function is called. Add a .count attribute to the wrapper. Decorate a function say_hi() that prints 'hi'. Call it 3 times, then print the count.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write your python solution with real code execution
- Get instant feedback and a hire/no-hire decision