Python data engineering interview problem. Difficulty: beginner. Pattern: OOP. About 10 minutes. Part of the Pro drill bank.
A job wrapper should record that a function ran (and optionally how long) so a log line exists even when the function itself prints nothing useful.
Call a function with logging around it as the tests specify.
Input: call_with_log('sum', [1, 2, 3]) Output: {'name': 'sum', 'args': [1, 2, 3], 'result': 6} This input follows the stated rules and produces this output.
Topics: lakebench, python, decorators.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Write a decorator that measures and reports how long a wrapped function takes to run.
Call a function with logging around it as the tests specify.