What this triangular arbitrage coding problem tests
This is an easy Python problem that quant trading firms use to assess whether a candidate can translate a financial concept into clean, correct code. Triangular arbitrage—exploiting inconsistencies across three currency pairs—is a foundational idea in algorithmic trading, and the ability to detect it quickly is a practical skill.
The problem rewards straightforward logic: tracing a conversion path through three currencies and computing the net profit ratio. Candidates should focus on accurate arithmetic, proper rounding, and defensive handling of edge cases. Interviewers often follow up by asking how you would scale this to detect arbitrage across larger currency graphs or how you would account for transaction costs.
- Currency conversion chains and composition
- Floating-point arithmetic and rounding precision
- Identifying and generalizing inefficiency patterns