Snowflake Interview Question

1st: write a stream parser 2nd: tree problem