We use optional cookies for analytics and affiliate attribution. Essential cookies and marketing measurement are always on. Read our privacy policy

We just launched our Black Friday sale. You can use code BF2026 to get 25% off all subscriptions, valid until Nov 30th. There is a limit of 100 redemptions.

Logo

Delta-Hedged P&L Attribution

What this preview is

Delta-Hedged P&L Attribution is a medium quant coding problem on option theory in Python, asked at Quant.

Difficulty
Medium
Topic
Option Theory
Discipline
Quant trading
Language
Python

Implementing delta-hedged options P&L attribution in Python

This medium-difficulty coding problem tests whether you can translate the Black-Scholes Greeks and daily P&L decomposition into clean, correct Python. It's the kind of task you'd encounter in a quant trading or options-analytics role: take raw Greeks from a market-data feed, apply the first-order P&L formula, and produce daily attribution breakdowns that traders use to understand where their money came from.

The core challenge is applying the formula accurately: theta decays by a fixed fraction of the year, gamma P&L is a quadratic function of the realized spot move, and vega P&L is linear in the vol change. Rounding and handling empty inputs matter for production robustness. Strong solutions compute all three components cleanly, return the correct structure, and handle the time-scaling constant without mistakes.

  • Greeks and their units in options markets
  • First-order P&L decomposition and the Greeks formula
  • Time-value conventions (252 trading days per year)
  • Precision and data structure handling

Unlock full access to getcracked

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