Ripple·Software Engineer·Technical Phone Screen
- Given a list of sell orders for XRP (each with a price per XRP and a quantity), and a USD budget, write a function that calculates exactly how much XRP a customer can purchase. Partial fills on the last order are allowed.
“The greedy part clicked pretty fast: sort by price ascending, buy cheap orders first.”