Leo Tolstoy
Wrong does not cease to be wrong because the majority share in it.
Leo Tolstoy, A Confession
Should we have a moral obligation to act in a certain way even if it does not lead to a positive outcome, or should we keep the end result in mind and act in a way which leads to positive outcomes for everybody involved?

Of the three views on how moral questions should be answered, virtue ethics focuses on the character of those who are acting, while the remaining two, i.e., deontology and consequentialism, focus on the status of the action. As both ethical systems focus on the same thing, comparison becomes inevitable; the deontology vs. utilitarianism―utilitarianism being a widely popular form of consequentialism―comparison in particular. The fact, however, is that these two ethical systems are poles apart in terms of philosophical doctrines they follow.
How Deontology Differs from Utilitarianism?
Deontology or deontological ethics revolve around the belief that one must act to fulfill one's duty, adhering to a set code of conduct, irrespective of the consequence of the action. Utilitarianism, on the other hand, is based on the belief that an action is morally justified if the consequence benefits a greater number of people. Now that shouldn't come as a surprise, considering that the latter is a form of consequentialism, which in itself is based on the belief that the consequence of an action determines whether it is right or wrong.
Deontology―derived from the Greek words deon (binding duty) and logos (study of)―advocates that both, the actions and outcomes, should be ethical, and the action is right only when it is in accordance with a moral rule or principle. It is in complete contrast of the end justifies the means philosophy, which forms the core of utilitarianism.
Assault in office
Let's go through some examples to see the contrast in how these ethical systems work.

Situation: In a hostage situation, a gunman picks an individual and asks him to kill a fellow hostage, and threatens to kill all hostages if the individual doesn't comply.

Deontology Point of View
Deontology holds that certain actions are immoral, no matter what their outcome is. So the hostage should not kill the fellow hostage, as killing a fellow human being is an immoral act regardless of whether you follow moral absolutism* or divine command theory**.

Utilitarianism Point of View
Utilitarianism states that the action is morally justified if the consequence maximizes the benefits of most people involved and reduces their suffering. As the outcome will be beneficial in this case, i.e., it will save more lives, the hostage should kill the fellow hostage.
*Moral absolutism: A deontological philosophy, which states that certain actions are inherently right or wrong, regardless of the motives behind them or their consequences.

**Divine command theory: A deontological philosophy, which states that an action is morally right if God has decreed it.
Surgeons in operation theater
❍ In health care, physicians and surgeons adhere to deontological ethics to save patients deemed 'medically hopeless' at whatever costs it takes, resulting in what can be considered 'futile' medical treatment.

❍ If we are to take into account the greatest happiness principle, an apt example of the utilitarian approach in the field of medicine will be a case of euthanasia, wherein a terminally ill individual, with no hope of cure, wants to end his life.
Maternity patient ready for delivery
❍ During childbirth, if the mother and child both are at an equal risk, deontological ethics would prompt the doctors to try to save the lives of both mother and child, despite being aware of the fact that saving at least one of the two will be better. The utilitarian approach in this case will be to save the life of mother―better to save one life than none at all.
More recently, there have been attempts to modify utilitarianism, which has resulted in advent of new forms of the same, like act utilitarianism, rule utilitarianism, negative utilitarianism, etc. Of these, rule utilitarianism seems similar to deontology, as it suggests that we must look at potential rules when faced with a choice, but then, it also adds that it is important to adhere to the greatest happiness principle.

As for act utilitarianism, which states that we must consider the likely consequences of a particular action when faced with a choice, and negative utilitarianism, which promotes the idea of choosing lesser evil to prevent greater amount of suffering, they are quite different from deontology.

It's difficult to say which is better, considering that both deontology and utilitarianism have their pros and cons. At face value, it may seem like deontology is the answer, but then the concept of universal moral truth is too vague to be relied upon. In contrast, it's easier to gauge the end result of an action by assessing its benefits. Proponents of utilitarian ethics will argue that saving many lives at the cost of one, is the right thing to do. Deontologists, on the other hand, are repulsed by the idea of doing anything that is morally wrong ... leave alone taking someone's life.

Trivia: Immanuel Kant once famously argued that it is always wrong to lie, even if a murderer is asking for the location of a potential victim.