Microsoft Interview Question: a) Develop a XML parser (rule... |

Interview Question

Senior Software Development Engineer Interview Redmond, WA (US)

a) Develop a XML parser (rules: Node closures and single

  root node..i.e. root node cannot be duplicated in structure). b) Count occurrences of words in a string (with string too large to be processed in memory).

Interview Answer

1 Answer


a) Use a primary stack for storing found open nodes. Pop upon locating closing nodes and see if they match. Last node to be popped should be root node. No intermediate node can be the root node. Used an intermediate stack for creating a node as I processed characters.
b) Dictionary...with processing of string in stages (to account for size being too large to fit in memory).

Interview Candidate on 08-Jul-2015

Add Answers or Comments

To comment on this, Sign In or Sign Up.