SnowPro Specialty: Snowpark Free Sample Questions

Description

Covers Snowpark architecture and setup, the Python API and DataFrames for unstructured data, filtering, cleaning and aggregating data, and configuring Snowpark-optimized warehouses.

12 free sample questions150 in the full practice test

Try simulator

SPS-C01 Sample Questions

  1. Question 1

    Beginner

    Snowpark Concepts · Outline Snowpark architecture

    A data engineer writes a Snowpark Python script that connects to Snowflake, initializes a DataFrame via df = session.table("SALES"), applies a filter df = df.filter(col("AMOUNT") > 1000), and adds a new column df = df.with_column("TAX", col("AMOUNT") * 0.1). After executing these lines in a Jupyter Notebook, the engineer checks the Snowflake Query History but sees no queries corresponding to these operations. What is the primary reason for this behavior?

    Answer and explanation

    Correct answer: A

    Snowpark operations on DataFrames use lazy evaluation. Transformations (like filter, select, with_column) only build up a logical query plan on the client side. The actual SQL query is not compiled, sent, or executed on the Snowflake virtual warehouse until an action method (such as .show(), .collect(), .count(), or .save_as_table()) is called to evaluate the DataFrame.

  2. Question 2

    IntermediateMultiple answers

    Snowpark Concepts · Outline Snowpark architecture

    A data architecture team is migrating legacy ETL pipelines to Snowflake using Snowpark. They have two distinct requirements:

    1. Process a column containing a comma-separated string of product codes, parsing it and returning multiple distinct rows for each product code.
    2. Create a control-flow orchestration script that sequentially truncates a staging table, executes a MERGE statement, and initiates a task failure alert if exceptions occur.

    Which TWO Snowpark key objects should the team implement to satisfy these respective requirements? (Select TWO)

    Answer and explanation

    Correct answers: B, D

    A UDTF (User-Defined Table Function) is the correct object for requirement 1, as it takes zero, one, or multiple input rows and returns a tabular output (multiple rows/columns), which is necessary for parsing a single string into multiple rows. A Stored Procedure is the correct object for requirement 2, as it allows for control-flow logic, transaction management, and orchestrating multiple SQL operations natively within the Snowflake engine.

  3. Question 3

    Advanced

    Snowpark Concepts · Outline Snowpark architecture

    When developing a Snowpark application, a data scientist uses the standard Python math.sqrt() function within a local for-loop to calculate values before applying them to a DataFrame, as opposed to using snowflake.snowpark.functions.sqrt() directly on the DataFrame columns. What is the fundamental architectural difference between these two approaches?

    Answer and explanation

    Correct answer: B

    Snowpark's architecture clearly distinguishes between client-side and server-side execution. Standard Python functions (like math.sqrt) executed in loops run on the client environment where the script is hosted, forcing data to be transferred out of Snowflake into local memory. Conversely, Snowpark functions (like snowflake.snowpark.functions.sqrt) translate into SQL and execute natively on the server side within Snowflake's highly scalable virtual warehouses, avoiding data movement.

  4. Question 4

    Beginner

    Snowpark Concepts · Outline Snowpark architecture

    True or False: Third-party Python packages that are not managed by the Snowflake Anaconda repository must be uploaded to a Snowflake stage and added via session.add_import() to be utilized within Snowpark server-side objects like UDFs.

    Answer and explanation

    Correct answer: A

    This is True. While Snowflake partners with Anaconda to provide thousands of popular Python packages natively out-of-the-box (requiring no manual uploads), any custom or third-party packages not available in the Snowflake Anaconda channel must be manually uploaded to an internal stage and referenced using session.add_import() or the @udf decorator imports parameter.

  5. Question 5

    Intermediate

    Snowpark Concepts · Set-up Snowpark

    A developer is configuring their local development environment to build a Snowpark Python application. They want to ensure absolute compatibility with the packages that will eventually run server-side inside Snowflake's execution environment. Which installation approach is considered the best practice by Snowflake for setting up the Python environment?

    Answer and explanation

    Correct answer: D

    To guarantee that the packages used during local development are exactly identical to what will be executed on the Snowflake server side, Snowflake strongly recommends using Anaconda (or Miniconda) and configuring the environment to pull exclusively from the Snowflake Anaconda channel (conda create --name snowpark -c https://repo.anaconda.com/pkgs/snowflake snowflake-snowpark-python). This prevents "works on my machine" versioning issues.

  6. Question 6

    Intermediate

    Snowpark Concepts · Set-up Snowpark

    A data science team is evaluating development environments for a new ML pipeline using Snowpark. They need an environment that provides native Git integration, advanced debugging, and the ability to work entirely offline for local code authoring before pushing to Snowflake. Which development environment best satisfies these specific requirements?

    Answer and explanation

    Correct answer: C

    Microsoft Visual Studio Code (VS Code) is a local, third-party IDE that supports native Git integration, advanced step-through debugging, and offline code authoring. While Snowflake Notebooks and Snowsight Worksheets are excellent native Snowflake tools, they run entirely in the browser (requiring internet connectivity) and currently lack the deep local debugging and offline capabilities of a dedicated local IDE like VS Code.

    quadrantChart title Development Environment Comparison x-axis Browser-Based --> Local Desktop y-axis Basic Authoring --> Advanced Debugging quadrant-1 Specialized IDEs quadrant-2 Native UI quadrant-3 Legacy Tools quadrant-4 VS Code Snowsight Worksheets: [0.1, 0.4] Snowflake Notebooks: [0.2, 0.6] Jupyter Notebook (Local): [0.7, 0.5] VS Code: [0.9, 0.9]

Register free for 6 more questions

Or unlock all 150 SPS-C01 questions with explanations, timed mode and flashcards.