S&T interview question

What is “factory pattern”, provide an example of a problem being solved by using this pattern