← Optiver Interview Insights

Optiver·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Interviewed for a software engineering role at Optiver and got hit with a graph traversal problem dressed up as a currency conversion puzzle. The constraint that you can't revisit currencies is what makes it interesting, and I did not figure that out fast enough.

Questions Asked (1)

Q1

Given a list of directional currency exchange rate pairs, find the maximum achievable conversion rate from a source currency to a target currency by chaining exchanges. Paths cannot revisit the same currency, and if the same directed pair appears more than once, use the highest rate.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

My first instinct was Dijkstra but that minimizes, not maximizes, and I lost maybe three minutes mentally fumbling with log transformations before just going with DFS and tracking visited nodes.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the problem as a directed graph where currencies are nodes and exchange rates are weighted edges, then find the maximum product path from source to target without revisiting nodes. Use DFS with backtracking to explore all simple paths, or adapt Bellman-Ford for longest path in a DAG if the graph is acyclic; handle duplicate pairs by keeping the highest rate.

Pro tip: Clarify whether the graph can contain cycles and whether the problem guarantees a path; if cycles exist, mention that the longest path problem is NP-hard in general, so the no-revisit constraint is crucial. Also, discuss using logarithms to convert multiplication to addition, enabling standard shortest-path algorithms with negated weights.

1. Clarify requirements and constraints

Ask about graph size, possibility of cycles, and whether rates are positive. Confirm that paths cannot revisit currencies and that duplicate directed pairs should use the maximum rate.

2. Model as a graph

Represent currencies as nodes and exchange rates as directed edges with weights equal to the rate (or its logarithm). Deduplicate edges by keeping the maximum rate for each directed pair.

3. Choose an algorithm

If the graph is a DAG, use topological sort with dynamic programming to find the maximum product path. If cycles are possible, use DFS with backtracking to explore all simple paths, or discuss NP-hardness and potential heuristics.

4. Implement and optimize

Code the chosen algorithm, using logarithms to avoid floating-point underflow/overflow and to convert multiplication to addition. Prune paths that cannot beat the current best.

5. Analyze complexity and trade-offs

Discuss time and space complexity: DFS is exponential in worst case, while DAG DP is O(V+E). Mention trade-offs between exactness and efficiency, and potential optimizations like memoization if applicable.

Key Points to Mention

  • Graph representation: nodes as currencies, edges as exchange rates with weights.
  • Handling duplicate directed pairs by taking the maximum rate.
  • Using logarithms to transform multiplication into addition for easier path optimization.
  • DFS with backtracking for simple paths, ensuring no node revisits.
  • Dynamic programming with topological sort for DAGs to achieve polynomial time.
  • Complexity analysis: exponential for general graphs (NP-hard), polynomial for DAGs.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.