Snap·Software Engineer·Technical Phone Screen
- You're given a set of 2D circles representing stones in a river. Determine whether the stones collectively block the full width of the river. You can define your own input format.
- Given a sequence of HTML-like tokens (for example: open paragraph, raw text 'ABC', close paragraph), parse them and build a DOM tree, then print it. Follow-up: add support for inserting and deleting nodes.
“The 'define your own input format' part threw me a little, felt like a trick but it's probably just them being flexible.”