Three friends wish to divide five different tasks among themselves, such that every friend must handle at least one task. In how many different ways can this be done?
If there were no restriction that all friends are assigned a task, the number of ways to assign would simply be $3^{5}=243$. So we will use complementary counting.

Call the friends $A, B$, and $C$. The number of ways to assign the tasks such that $A$ and $B$ have at least one task, but $C$ has no tasks, is $2^{5}-2=30$. This is obtained by noting that one has two choices of who to give each task, subtracting off the two possibilities where $A$ receives all tasks or $B$ receives two tasks.

Similarly, the number of ways to assign the tasks such that $B$ and $C$ have at least one task, but $A$ has no tasks, is $2^{5}-2=30$.

Similarly, the number of ways to assign the tasks such that $C$ and $A$ have at least one task, but $B$ has no tasks, is $2^{5}-2=30$.

Finally, there are three ways to assign all tasks to one person.

In summary, the answer should be $3^{5}-3 \cdot 30-3 \cdot 1=150$.