ALEX interview question

When you should use Factory pattern and why?