Coinbase interview
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2024-08-25Added By Anonymous
Source: Link
1I was asked this question in interview last week: any ideas are appreciated.
2So, we have a vector of Transactions(Tid, profit, amt, parentTransactionId) and CapacityAmt. We need to return maximum total profit that can be calculated within CapacityAmt. (knapsack dp )
3Part 1. Need performance efficent soln (fractional knapsack - profit/amt factor) than optimised soln(memoised dp)
4Part 2. Parent Transaction must be done before doing child Transaction.
5
6I did part 1, but not sure how to approach part2.