What strategy should I use to sovle this interview problem? May I apply DP on this? The problem description is as below and it feels like a DP problem but I am not sure, thank you for helping!

You have a certain dose of a drug, say, 200 milliliters, and now some patients need this drug. The doses for each patient may vary from person to person, for example, 2.5 milliliters for A, B, C, 5 milliliters for D, E, and 7 milliliters for F, and so on. The question is, in short, how can you allocate the drugs so that you have the least amount of drugs left?
Example input: total drug dose 10 (milliliters).
A needs 3, B needs 5, C needs 2, D needs 4, E needs 2.
Output: A, B, C or A, B, E (perfect allocation with no drugs left).
Note: there may be decimals.

I appreciate any hints or solutions to this problem.
This problem is NP-hard. The decision problem, whether a perfect allocation exists, it self is NP-hard. The decision variant is actually the same as the subset sums problem. Given a set of numbers $S$ and a target number $k$, is there a subset of $S$ that sum up to $k$. The problem itself is a variation of the Knapsack problem.

However, the subset sum problem and the knapsack problem are both weak NP-hard problem. Both admit pseudo polynomial dynamic programming solutions (polynomial in the values of the input). So here is a dynamic programming solution for your problem. For each $i \in \{0, \dots n\}$, let us define the function $dp_i : [M] \rightarrow {0, 1}$, where $M$ is the sum of all needs of drugs from all patients. Now set $dp_0(0) = 1$. And for each $i$, we compute $dp_i$ as $dp_i(k)$ equals to 1 if and only if there is a subset of the first $i$ patients that need exactly $k$ units. The transitions are as follows:
$$dp_i(s) = \max\{dp_{i-1}(s), dp_{i-1}(s) - \mathrm{need}(i)\}.$$

An efficient way to implement it is by using bitwise operations on bitsets (a standard trick), where $dp_i = dp_{i-1} | (dp_{i-1}&lt;&lt; \mathrm{need}(i))$, where $|$ is logical or-operator and the $&lt;&lt;$ is left-shifting.