United Airlines interview question

What is factory design pattern, why we use it, write code for it. What does factory does in it? Where does local/instance/object store?