Difficulty: Hard
Category: systems
Practice quant interview questions from top firms including Jane Street, Citadel, Two Sigma, DE Shaw, and other leading quantitative finance companies.
Topics: floating-point, systems, numerical-analysis, c++
Maintaining an exact internal state of Profit and Loss (PnL) is critical, yet standard floating-point addition is not associative due to rounding errors. This lack of precision can lead to catastrophic cancellation when aggregating small fees or profits against large notional positions, requiring numerically stable summation algorithms to ensure deterministic results. Task Implement the PnLCalculator class to accurately compute the cumulative Net PnL from a stream of trades. You must implement
Practice this hard developer interview question on MyntBit - the all-in-one quant learning platform with 200+ quant interview questions for Jane Street, Citadel, Two Sigma, and other top quantitative finance firms.