Logo

Question preview

What does Tom do?

What this preview is

About this preview

What does Tom do? is a cooked quant interview question on language knowledge in Python.

Unlock full access to getcracked

Join to unlock this question, detailed solutions, and our complete library of quant finance interview prep.

Understanding decorator patterns for instrumentation at scale

This practical Python question tests whether you understand how to solve a real infrastructure problem under tight time and resource constraints. Rather than asking you to implement from scratch, it probes your knowledge of Python's built-in language features and your judgment about which tool fits a specific engineering context.

The scenario presents a common challenge in large codebases: adding cross-cutting concerns (like timing or logging) to many functions without rewriting each one individually. Your answer should reflect awareness of how Python's decorator mechanism works, when it is the appropriate choice, and why alternatives might be slower to deploy or harder to maintain across thousands of call sites.

  • Decorator syntax and semantics
  • Metaprogramming vs. direct code modification
  • Trade-offs between centralized instrumentation and per-function changes
  • Practical constraints in production environments