Wednesday, 5 May 2021

Part 1 | Snowflake Developer Interview Questions

FREQUENTLY ASKED SNOWFLAKE DEVELOPER INTERVIEW QUESTIONS

In this post, we are going to explore snowflake interview questions. Topics Covered are Snowflake Architecture, warehouse, types of constraints, types of tables,  types of stages, and snowflake indexes.

This will majorly cover all the theoretical questions, starting with the basics and moving to advanced concepts. Hoping that it will be helpful and wishing the best for your interview.


Q1: What is Snowflake and how it is different from other databases?

Snowflake database is a cloud-based data warehouse-as-a-cloud-service i.e. SaaS that requires no hardware or software installation.

Advantages of Snowflake databases are

  1. Build on cloud
  2. Unlimited storage
  3. Data is encrypted by default
  4. Simple and transparent pricing
  5. Moves to idle mode when not used
  6. Time travel (1 - 90 days)

Q2: Explain the snowflake architecture?


Snowflake architecture consists of three layers.
    1. Cloud  Services
    2. Query Processing
    3. Database Storage

Snowflake Architecture
Snowflake Architecture
Detailed Explanation:
Cloud services

  • Collection of services that coordinate activities across snowflake.
  • Services managed in this layer include: Authentication, Metadata management, Query parsing and optimization and Access control

Query processing

  • Uses virtual warehouses. Each virtual warehouse is a compute cluster connected to multiple nodes allocated by a snowflake.
  • Each virtual warehouse is an independent compute cluster that does not share compute resources with other virtual warehouses. As a result, each virtual warehouse has no impact on the performance of other virtual warehouses.

Database storage

  • Snowflake reorganize the data into its internal optimized, compressed, and columnar format.
  • Data stored in snowflake can be accessed only using SQL queries.

Q3: What is shared disk and shared-nothing architecture?

Shared disk – It has a central repository for persisted data that is accessible from all the computable nodes.

Shared nothing – Uses massive parallel processing (MPP). Compute clusters where each node in the cluster stores a portion of the entire data set locally.

Q4: What are the different types of warehouse size?

  • XSMALL
  • SMALL
  • MEDIUM 
  • LARGE
  • XLARGE
  • XXLARGE 
  • XXXLARGE 
  • X4LARGE 
Most commonly medium-sized warehouse is used for heavy-duty load users.

Q5: What are the types of constraints in Snowflake?


Unique – To uniquely identify value, NULL is allowed.

Primary key – To uniquely identify each record, NULL is not allowed.

Foreign key - Primary key of another table, used to define the relationship between the tables.

NOT NULL - NULL values are not allowed.

Q6: Does Snowflake support indexes?

Snowflake does not use indexes. This is one of the things that makes Snowflake scale so well for arbitrary queries.

Q7: What is a surrogate key?


The surrogate key is the natural prime key, which means it is not generated based on the database data or values.

Q8: What are the different types of tables in Snowflake?

Temporary Table – Stores non-permanent, transitory data.

  • Only exists within the session, will not be visible to other users.

Permanent Table – Available until explicitly dropped.

  • Has fail-safe period.

Transient Table - Available until explicitly dropped.

  • Doesn’t have a fail-safe period, can prefer when the data doesn’t require the same level of data protection and recovery as the permanent table.

External Tables - When queried, an external table reads the data set from a set of files in an external stage.

Q9: What is the difference between NULL, Blank, and Zero?


NULL - Unavailable, Unassigned, Unknown, or Not applicable

Blank - It is treated as a character (' ')

Zero - It is a number

Q10: What is a  stage and explain its types?


Stage is streamline for bulk loading or unloading data out of database tables.

There are two types of stage,
1. External stage 
2. Internal stage 

Detailed Explanation:
External 
The external stage is used to access the files placed in external locations like S3, Google Cloud, Azure, etc.

Internal Stage
With the internal stage, the files are stored in the Snowflake itself.


No comments:

Post a Comment