Propose a design pattern for an XML-to-object document parser which allows for a construct of a new parser base on a new set of elements augmented to an existing schema without applying any modification to an existing parser code.
Sigiloso
Since the interviewer popped this arbitrary question without himself having a clear idea as to how to solve it, and the allotted time was limited, I simply offered to create a representation of each element-to-object hierarchy, and have them created via a corresponding parser classes with a defined interface so they can be reconstructed via a common contract in each of these parser classes depending on the schema's structure. The solution promotes flexibility to add new components to an existing structure without fiddling with the existing code but each new addition would have to be implemented in a customized fashion, basically allowing flexibility as to what information the parser needs to extract with the help of an already established parser classes doing the work on various subtrees in the DOM tree. It's an ugly hack and certainly needs to be redesigned.