More to the point, if I'm asking you in an interview how to build a DOM parser, take it as given that, if you get the job, and we need a DOM parser, you will be actively encouraged to go use a library rather than build from scratch.
And if I am asking you in an interview, it would be a given that you would be actively encouraged to figure out how to break it. One key skill in knowing how to break it knowing how one might be built.
Learning how to think abstractly is one thing, but the ability to "puncture" abstractions is quite another. The latter is more valuable in this context.