Amex came to my college for placements. This was the OA round.
Question 1
Suppose you are given a set of exchange rates among certain currencies and you want to determine if an arbitrage is possible, i.e, if there is a way by which you can start with one unit of some currency C and perform a series of barters which results in having more than one unit of C. Let's assume that
transaction costs are zero
exchange rates do not fluctuate
fractional quantities of items can be sold.

The above picture shows such chart.
USD -> EUR -> CAD -> USD
Let's suppose we start with 10000 USD then exchange it for EUR. We get 7410 EUR. Now I want to exchange this with CAD.
7410 EUR = 7410 * 1.366 = 10122 CAD
Now let's exchange this for USD.
10122 CAD = 10122 * 0.995 = 10071
There you go. We started with 10000 USD and ended up having 10071 USD. That is a good 71 USD profit. Design an efficient algorithm to determine whether there exists an arbitrage - a way to start with a single unit of some currency and convert it back to more than one unit of that currency through a sequence of exchanges.
Question 2
https://leetcode.com/problems/3sum/
Question 3
There are n servers numbered from 0 to n-1 connected by undirected server-to-server connections forming a network where connections[i] = [a, b] represents a connection between servers a and b. Any server can reach any other server directly or indirectly through the network.
A critical connection is a connection that, if removed, will make some server unable to reach some other server.
Return all critical connections in the network in any order.
Example:
.....2
.../|
../ |
../ |
.1 |
| \ |
|....|
| ...0
|
3
Input: n = 4, connections = [[0,1],[1,2],[2,0],[1,3]]
Output: [[1,3]]
Explanation: [[3,1]] is also accepted.
Solution for 3 is simple.
Just find bridges in the connected undirected graph.