Cooking a soft-boiled egg to perfection is a matter of taste. However, one common technique involves boiling the egg for about four to five minutes to achieve a soft yolk and firm white.