PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Optiver

Detect currency arbitrage with costs

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's competency in algorithmic problem modeling, graph-based cycle detection, and numerical reasoning about exchange rates and transaction costs.

  • Medium
  • Optiver
  • Coding & Algorithms
  • Software Engineer

Detect currency arbitrage with costs

Company: Optiver

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

You are given a K×K matrix R of currency exchange rates where R[i][j] is the amount of currency j obtainable for one unit of currency i, and R[i][i] = 1 for all i. A closed cycle of exchanges incurs a transaction cost of 0.01% of the initial amount (applied once per completed cycle). Determine whether there exists any cycle of exchanges that yields a strictly higher final amount than the initial after accounting for this cost. Return true if such an arbitrage opportunity exists, otherwise return false.

Quick Answer: This question evaluates a candidate's competency in algorithmic problem modeling, graph-based cycle detection, and numerical reasoning about exchange rates and transaction costs.

Related Interview Questions

  • Find missing numbers in sequences - Optiver (hard)
  • Design a circular queue data structure - Optiver (medium)
  • Optimize flight and cargo bookings for profit - Optiver (hard)
  • Compare two programs for equivalence - Optiver (Medium)
  • Design a satellite propagation simulator - Optiver (Medium)
Optiver logo
Optiver
Jul 16, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
21
0

You are given a K×K matrix R of currency exchange rates where R[i][j] is the amount of currency j obtainable for one unit of currency i, and R[i][i] = 1 for all i. A closed cycle of exchanges incurs a transaction cost of 0.01% of the initial amount (applied once per completed cycle). Determine whether there exists any cycle of exchanges that yields a strictly higher final amount than the initial after accounting for this cost. Return true if such an arbitrage opportunity exists, otherwise return false.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Optiver•More Software Engineer•Optiver Software Engineer•Optiver Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.