Oleg Dulin
- Home
- About
- Blog
- Career Patterns (and anti-patterns)
- InterviewQuestions
This website uses cookies. Get over it.
Given a generic XML document as an input, write an algorithm in pseudo-code or in your favorite programming language [^It doesn’t have to compile, but you need to be able to discuss it] that will store this document in an SQL table.
Be mindful that you will need to be able to query the SQL table by element name, attribute name, attribute value, and you will need to reconstruct the XML document from the table.
Start by assuming the XML document will have no text nodes and only attributes, i.e.:
<example>
<a foo="bar">
<b />
<c>
<d baz="bat" />
</c>
</a>
<e />
</example>
What I look for:
Write SQL statements that:
Write an algorithm that will reconstruct the XML document from the SQL tables.