Design Classes for an Options Position and Delta Tracker

Last updated: November 29, 2026

Quick Overview

Design the classes for tracking positions in stocks and options from fills, computing realized PnL with average cost, and aggregating delta per underlying.

Akuna Capital
Software Engineering Fundamentals
Software Engineer
Akuna Capital
November 29, 2026
Software Engineer
Technical Screen
Software Engineering Fundamentals
Medium

0

0

0 solved


Design the classes for tracking positions in stocks and options from fills, computing realized PnL with average cost, and aggregating delta per underlying.

Akuna Capital's risk and trading tools all rest on position keeping that is exactly right across stocks and options. The interviewer checks object-oriented modeling (instruments vs positions vs a book), correct handling of fills that reduce or flip a position, contract multipliers, and where Greeks should come from.

What the Interviewer Expects
  • Separate immutable instrument definitions from mutable positions
  • Handle opening, adding, reducing and flipping fills
  • Apply contract multipliers in PnL and delta
  • Use polymorphism for instrument-specific delta
  • Keep the Greeks source outside the position model
Key Topics to Cover
object-oriented design
position keeping
PnL
options Greeks
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
  • How would you add gamma and vega aggregation by expiry bucket?
  • How do you make this safe when fills arrive from multiple threads?
  • Would you use average cost or FIFO lots, and why might accounting care?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Fills arrive as (instrument, signed qty, price). Track quantity, average price and realized PnL per instrument. Report net delta per underlying in shares, using deltas supplied by a pricing model....

High-Level Design

Instrument is a frozen dataclass with symbol, underlying and multiplier, and a delta() method returning 1 for stock. Option extends it with strike, expiry and call/put, and looks up its delta fr...


Submit Your Answer
Markdown supported

Related Questions