The factory design pattern is a creational pattern that favor the abstraction of the objects creation's process.
The creation of an object can be a complex process where many properties must be setted and other nested objects must be created.
To reduce the code duplication and the coupling between classes, is better to put the creation code in a unique place (the factory), where you can access to get the instance of the objects.
A "factory" therefore, is an object for creating other objects.

As you can see from the schema below, a program must use a car object, create it using the CarFactory class, instead of create the istance by itself.

 

The factory design pattern

 

Code Sample

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FactorySample
{
    class Program
    {
        static void Main(string[] args)
        {
            CarFactory factory = new CarFactory();
            IVehicle car = factory.GetCar();
            Console.WriteLine(car.Engine.EngineType);

            Console.WriteLine("");
            Console.WriteLine("Press [ENTER] to quit.");
            Console.ReadLine();
        }
    }

    interface ICarFactory
    {
        Car GetCar();
    }

    class CarFactory : ICarFactory
    {
        public Car GetCar()
        {
            IEngine engine = new TurboEngine();
            Car c = new Car(engine);
            return c;
        }
    }

    interface IVehicle
    {
        string Model { get; set; }
        int WheelsDrive { get; set; }
        int Wheels { get; set; }
        IEngine Engine { get; set; }
    }

    class Car : IVehicle
    {
        public int WheelsDrive { get; set; }
        public int Wheels { get; set; }
        public string Model { get; set; }
        public IEngine Engine { get; set; }

        public Car(IEngine engine)
        {
            this.Engine = engine;
        }
    }

    interface IEngine
    {
        string EngineType { get; }
    }

    class TurboEngine : IEngine
    {
        public string EngineType
        {
            get { return "Turbo"; }
        }
    }

    class NormalEngine : IEngine
    {
        public string EngineType
        {
            get { return "Normal"; }
        }
    }

}