Coinbase·Software Engineer·Technical Phone Screen
- You have N transactions, each with an ID, a size, and a fee. Given a block with a fixed size capacity, choose which transactions to include in order to maximize the total fee collected.
“Looked like a classic knapsack at first and I started mentally reaching for a heap-based approach.”