Trees & Hierarchies
Most of Snowflake's data is organized as hierarchies. An account holds databases, a database holds schemas, a schema holds tables, and access control is a graph of roles granted to other roles. A query plan is a tree of operators too, and when a warehouse runs one in parallel, partial results move up that tree toward a single coordinator. The four problems in this lesson use those shapes: a Premium question, a Premium question edit, deletions that cap a tree's height, and a node count over async messages.
None of them gives you a node class with left and right pointers. The tree shows up as an edge list you have to root yourself, a flat parent array, grant pairs keyed by role name, or processes on separate hosts that can only message each other. Work out the representation first. After that, the pass over it is usually short, and the sections below show how to walk each one in the right order.
SnowflakePremium lesson · Coding round
The 4 Snowflake problems are below.
- A Premium questionCoding · Hard
- A Premium questionCoding · Medium
- A Premium questionCoding · Medium
+ 1 more in this lesson
Each with hints, the follow-up and a tested solution.
Get the Snowflake questions$49 a year · all 100 companies · cancel anytime
From 111 Snowflake reports, forum threads behind logins and write-ups in Chinese.
Snowflake interview guideKnow what Snowflake asks before you walk in.
31 coding · 5 system design · 18 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.