Snowflake interview question

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