These tiny insects will try to get in through window screens or through crevices around windows or doors. Often they simply hitch a ride on the skin of very ripe fruits or vegetables.
Once they are in the house it is difficult to get rid of them. They can quickly multiply in number because they have a very fast life cycle. It takes them only 8-10 days to go from egg to adult.
But the common fruit fly or Drosophila melanogaster is not only considered a nuisance. It is also a very important laboratory animal. It is widely used for biological research in studies of genetics, evolution, and physiology. For example it was fruit flies that helped to unlock some mysteries about DNA.