A per-request timeout of 2.0 seconds cancels any fetch that takes longer
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
A per-request timeout of 2.0 seconds cancels any fetch that takes longer. Given fetch durations {'a':1.2,'b':3.5,'c':2.0,'d':0.4,'e':5.0}, return the names of fetches that COMPLETE within the timeout (duration <= 2.0), sorted alphabetically. Print the list. (Model it, no asyncio.)
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