Firing someone is a difficult task. Usually you will not be asked this question unless it is for a management position. You should emphasize a couple of key things when you answer this question. First, you should be very professional about firing someone. Second, you should mention the procedures you took so the action of firing is justified. I'll give an example for someone who has never fired someone and an example for having fired someone.
Both of these are good answers. They mention that a manager should take actions to make the worker better, but sometimes turning something bad to something good is impossible, so the only action is to fire someone. The person with experience outlines the steps taken. For example, the probation, assigning different work, providing a mentor, etc. Then in the end he was fired. The second example shows despite experience, that he or she would fire someone in a professional manner following procedure.