DataDriven
LearnPracticeInterviewDiscussDailyJobs

Execution Timer Wrapper

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
Seniority
L6

Interview Prompt

Implement make_timed(fn) that returns a wrapper which invokes fn with any positional and keyword args, measures elapsed seconds, and returns fn's return value unchanged (timing is not verified by tests). Also implement run_timed(fn, args=(), kwargs=None): given fn as a lambda source string, args list, and kwargs dict, eval the source into a callable, wrap it with make_timed, invoke it with the given args/kwargs, and return the result.

Summary

Function wrapped with a timer. Duration captured on exit.

How This Interview Works

  1. Read the vague prompt (just like a real interview)
  2. Ask clarifying questions to the AI interviewer
  3. Write your python solution with real code execution
  4. Get instant feedback and a hire/no-hire decision

Related

  • All Mock Interviews
  • Practice Mode (untimed)
  • Python Interview Questions
  • Data Engineering Interview Prep Guide
  • Practice Problems
  • Daily Challenge