InterviewLegend

Design an Elastic Query Engine

Frequently asked
Alex Chen45 min readUpdated 111 real interview reports

Two teams share one warehouse; the finance team kicks off a quarter-close report that scans a year of data and runs for twenty minutes. At the same moment the product team has three hundred dashboards auto-refreshing every few seconds. On a classic shared-nothing warehouse, where the data is partitioned across the same boxes that run the queries, these two workloads fight. The big report saturates CPU and the dashboards crawl; size the cluster for the dashboards and the report never finishes. Whoever shouts loudest gets the machines. This is the contention the design exists to dissolve, by making compute something you add for one workload without touching another, and by making the data something you never scale at all.

Stated plainly, "design a query engine" is enormous, so cut it to the spine: compute scales independently of storage. In a traditional MPP warehouse the table is sharded onto the nodes' local disks. To add a node you reshuffle data, and to run two workloads you either share the nodes or copy the whole dataset. Snowflake's answer, and the answer this round is looking for, is to stop coupling them. Put the data once in cheap object storage as the single source of truth, and let any number of independent compute clusters read it. Storage becomes a shared, durable substrate, and compute becomes disposable, elastic, and per-workload.

The Snowflake angle
If you take one instinct into a Snowflake design round, take this one: separate the durable store from the elastic compute. It is the founding idea of the product and it is what interviewers listen for, on this prompt and on half the others. A candidate who keeps data and compute welded together, sharding the table onto the query nodes, has rebuilt the 2005 warehouse and will spend the round explaining why resizing means a data reshuffle. A candidate who says "data lives once in object storage, and compute clusters are stateless readers I can add and kill at will" has the architecture before drawing a second box. You do not need to have run Snowflake to get there.
What's inside
  • 1 diagram
  • 5 sections
  • about 45 min

Premium lessonSnowflake interview guide

These took digging.

What candidates walked out with, from 20,000+ reports, forum threads behind logins and write-ups in Chinese. Then solved step by step.

100 companies. Checked every month.

Unlock all 100 companies

$49 a year · less than $1 a week · Cancel anytime

Had your Snowflake interview?Tell us what they asked. Reviewed before it goes in, never with your name.
Snowflake interview guide

Know what Snowflake asks before you walk in.

10 coding · 5 system design · 18 behavioral questions

Get Premium$49 a year · Cancel anytime
Or start freeNo card.

Get their questions first.

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.