Prepping for the 2027 recruiting cycle? Use code 2027RC for 10% off, valid until July 31st! Oh, and check out our members-only recruitment services.

Logo

Coding preview

Triangular Arbitrage Detection

What this preview is

About this preview

Triangular Arbitrage Detection is a easy quant coding problem on finance in Python, asked at Quant.

Unlock full access to getcracked

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

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